本文整理汇总了C++中CPDF_Object::AsName方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Object::AsName方法的具体用法?C++ CPDF_Object::AsName怎么用?C++ CPDF_Object::AsName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Object
的用法示例。
在下文中一共展示了CPDF_Object::AsName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadPDFEncoding
void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding,
int& iBaseEncoding,
std::vector<CFX_ByteString>* pCharNames,
bool bEmbedded,
bool bTrueType) {
if (!pEncoding) {
if (m_BaseFont == "Symbol") {
iBaseEncoding = bTrueType ? PDFFONT_ENCODING_MS_SYMBOL
: PDFFONT_ENCODING_ADOBE_SYMBOL;
} else if (!bEmbedded && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
iBaseEncoding = PDFFONT_ENCODING_WINANSI;
}
return;
}
if (pEncoding->IsName()) {
if (iBaseEncoding == PDFFONT_ENCODING_ADOBE_SYMBOL ||
iBaseEncoding == PDFFONT_ENCODING_ZAPFDINGBATS) {
return;
}
if ((m_Flags & PDFFONT_SYMBOLIC) && m_BaseFont == "Symbol") {
if (!bTrueType) {
iBaseEncoding = PDFFONT_ENCODING_ADOBE_SYMBOL;
}
return;
}
CFX_ByteString bsEncoding = pEncoding->GetString();
if (bsEncoding.Compare("MacExpertEncoding") == 0) {
bsEncoding = "WinAnsiEncoding";
}
GetPredefinedEncoding(bsEncoding, &iBaseEncoding);
return;
}
CPDF_Dictionary* pDict = pEncoding->AsDictionary();
if (!pDict)
return;
if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) {
CFX_ByteString bsEncoding = pDict->GetStringFor("BaseEncoding");
if (bsEncoding.Compare("MacExpertEncoding") == 0 && bTrueType) {
bsEncoding = "WinAnsiEncoding";
}
GetPredefinedEncoding(bsEncoding, &iBaseEncoding);
}
if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN)
iBaseEncoding = PDFFONT_ENCODING_STANDARD;
CPDF_Array* pDiffs = pDict->GetArrayFor("Differences");
if (!pDiffs)
return;
pCharNames->resize(256);
uint32_t cur_code = 0;
for (uint32_t i = 0; i < pDiffs->GetCount(); i++) {
CPDF_Object* pElement = pDiffs->GetDirectObjectAt(i);
if (!pElement)
continue;
if (CPDF_Name* pName = pElement->AsName()) {
if (cur_code < 256)
(*pCharNames)[cur_code] = pName->GetString();
cur_code++;
} else {
cur_code = pElement->GetInteger();
}
}
}