当前位置: 首页>>代码示例>>C++>>正文


C++ CPDF_Dictionary::SetStringFor方法代码示例

本文整理汇总了C++中CPDF_Dictionary::SetStringFor方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Dictionary::SetStringFor方法的具体用法?C++ CPDF_Dictionary::SetStringFor怎么用?C++ CPDF_Dictionary::SetStringFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPDF_Dictionary的用法示例。


在下文中一共展示了CPDF_Dictionary::SetStringFor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProcessbCJK

CPDF_Dictionary* CPDF_Document::ProcessbCJK(
    CPDF_Dictionary* pBaseDict,
    int charset,
    FX_BOOL bVert,
    CFX_ByteString basefont,
    std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert) {
  CPDF_Dictionary* pFontDict = new CPDF_Dictionary(m_pByteStringPool);
  CFX_ByteString cmap;
  CFX_ByteString ordering;
  int supplement = 0;
  CPDF_Array* pWidthArray = new CPDF_Array;
  switch (charset) {
    case FXFONT_CHINESEBIG5_CHARSET:
      cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
      ordering = "CNS1";
      supplement = 4;
      pWidthArray->AddInteger(1);
      Insert(0x20, 0x7e, pWidthArray);
      break;
    case FXFONT_GB2312_CHARSET:
      cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
      ordering = "GB1";
      supplement = 2;
      pWidthArray->AddInteger(7716);
      Insert(0x20, 0x20, pWidthArray);
      pWidthArray->AddInteger(814);
      Insert(0x21, 0x7e, pWidthArray);
      break;
    case FXFONT_HANGUL_CHARSET:
      cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
      ordering = "Korea1";
      supplement = 2;
      pWidthArray->AddInteger(1);
      Insert(0x20, 0x7e, pWidthArray);
      break;
    case FXFONT_SHIFTJIS_CHARSET:
      cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
      ordering = "Japan1";
      supplement = 5;
      pWidthArray->AddInteger(231);
      Insert(0x20, 0x7d, pWidthArray);
      pWidthArray->AddInteger(326);
      Insert(0xa0, 0xa0, pWidthArray);
      pWidthArray->AddInteger(327);
      Insert(0xa1, 0xdf, pWidthArray);
      pWidthArray->AddInteger(631);
      Insert(0x7e, 0x7e, pWidthArray);
      break;
  }
  pBaseDict->SetNameFor("Subtype", "Type0");
  pBaseDict->SetNameFor("BaseFont", basefont);
  pBaseDict->SetNameFor("Encoding", cmap);
  pFontDict->SetFor("W", pWidthArray);
  pFontDict->SetNameFor("Type", "Font");
  pFontDict->SetNameFor("Subtype", "CIDFontType2");
  pFontDict->SetNameFor("BaseFont", basefont);
  CPDF_Dictionary* pCIDSysInfo = new CPDF_Dictionary(m_pByteStringPool);
  pCIDSysInfo->SetStringFor("Registry", "Adobe");
  pCIDSysInfo->SetStringFor("Ordering", ordering);
  pCIDSysInfo->SetIntegerFor("Supplement", supplement);
  pFontDict->SetFor("CIDSystemInfo", pCIDSysInfo);
  CPDF_Array* pArray = new CPDF_Array;
  pBaseDict->SetFor("DescendantFonts", pArray);
  pArray->AddReference(this, AddIndirectObject(pFontDict));
  return pFontDict;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:66,代码来源:cpdf_document.cpp


注:本文中的CPDF_Dictionary::SetStringFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。