本文整理汇总了C++中CPDF_Font::GetSubstFont方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Font::GetSubstFont方法的具体用法?C++ CPDF_Font::GetSubstFont怎么用?C++ CPDF_Font::GetSubstFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Font
的用法示例。
在下文中一共展示了CPDF_Font::GetSubstFont方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNativeInterFormFont
CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag)
{
csNameTag = "";
FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
CFX_SubstFont* pSubst;
CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument);
if (pFont != NULL) {
pSubst = (CFX_SubstFont*)pFont->GetSubstFont();
if (pSubst != NULL && pSubst->m_Charset == (int)charSet) {
FindInterFormFont(pFormDict, pFont, csNameTag);
return pFont;
}
}
return GetNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
}
示例2: GetNativeInterFormFont
CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
CPDF_Document* pDocument,
CFX_ByteString& csNameTag) {
csNameTag.clear();
uint8_t charSet = CPDF_InterForm::GetNativeCharSet();
CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument);
if (pFont) {
CFX_SubstFont* pSubst = pFont->GetSubstFont();
if (pSubst && pSubst->m_Charset == (int)charSet) {
FindInterFormFont(pFormDict, pFont, csNameTag);
return pFont;
}
}
return GetNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
}
示例3: FindResFontSameCharset
CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
CFX_ByteString& sFontAlias,
int32_t nCharset) {
if (!pResDict)
return NULL;
CPDF_Document* pDocument = GetDocument();
ASSERT(pDocument != NULL);
CPDF_Dictionary* pFonts = pResDict->GetDict("Font");
if (pFonts == NULL)
return NULL;
CPDF_Font* pFind = NULL;
FX_POSITION pos = pFonts->GetStartPos();
while (pos) {
CPDF_Object* pObj = NULL;
CFX_ByteString csKey;
pObj = pFonts->GetNextElement(pos, csKey);
if (pObj == NULL)
continue;
CPDF_Object* pDirect = pObj->GetDirect();
if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY)
continue;
CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
if (pElement->GetString("Type") != "Font")
continue;
CPDF_Font* pFont = pDocument->LoadFont(pElement);
if (pFont == NULL)
continue;
const CFX_SubstFont* pSubst = pFont->GetSubstFont();
if (pSubst == NULL)
continue;
if (pSubst->m_Charset == nCharset) {
sFontAlias = csKey;
pFind = pFont;
}
}
return pFind;
}
示例4: GetNativeInterFormFont
CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
CPDF_Document* pDocument,
uint8_t charSet,
CFX_ByteString& csNameTag) {
if (!pFormDict) {
return NULL;
}
CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
if (!pDR) {
return NULL;
}
CPDF_Dictionary* pFonts = pDR->GetDict("Font");
if (!pFonts) {
return NULL;
}
for (const auto& it : *pFonts) {
const CFX_ByteString& csKey = it.first;
CPDF_Object* pObj = it.second;
if (!pObj) {
continue;
}
CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
if (!pElement)
continue;
if (pElement->GetString("Type") != "Font")
continue;
CPDF_Font* pFind = pDocument->LoadFont(pElement);
if (!pFind) {
continue;
}
CFX_SubstFont* pSubst = (CFX_SubstFont*)pFind->GetSubstFont();
if (!pSubst) {
continue;
}
if (pSubst->m_Charset == (int)charSet) {
csNameTag = csKey;
return pFind;
}
}
return NULL;
}
示例5: FindResFontSameCharset
CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
CFX_ByteString& sFontAlias,
int32_t nCharset) {
if (!pResDict)
return nullptr;
CPDF_Dictionary* pFonts = pResDict->GetDictBy("Font");
if (!pFonts)
return nullptr;
CPDF_Document* pDocument = GetDocument();
CPDF_Font* pFind = nullptr;
for (const auto& it : *pFonts) {
const CFX_ByteString& csKey = it.first;
CPDF_Object* pObj = it.second;
if (!pObj)
continue;
CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
if (!pElement)
continue;
if (pElement->GetStringBy("Type") != "Font")
continue;
CPDF_Font* pFont = pDocument->LoadFont(pElement);
if (!pFont)
continue;
const CFX_SubstFont* pSubst = pFont->GetSubstFont();
if (!pSubst)
continue;
if (pSubst->m_Charset == nCharset) {
sFontAlias = csKey;
pFind = pFont;
}
}
return pFind;
}
示例6: ProcessText
FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath)
{
if(textobj->m_nChars == 0) {
return TRUE;
}
int text_render_mode = textobj->m_TextState.GetObject()->m_TextMode;
if (text_render_mode == 3) {
return TRUE;
}
CPDF_Font* pFont = textobj->m_TextState.GetFont();
if (pFont->GetFontType() == PDFFONT_TYPE3) {
return ProcessType3Text(textobj, pObj2Device);
}
FX_BOOL bFill = FALSE, bStroke = FALSE, bClip = FALSE;
if (pClippingPath) {
bClip = TRUE;
} else {
switch (text_render_mode) {
case 0:
case 4:
bFill = TRUE;
break;
case 1:
case 5:
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
bFill = TRUE;
} else {
bStroke = TRUE;
}
break;
case 2:
case 6:
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
bFill = TRUE;
} else {
bFill = bStroke = TRUE;
}
break;
case 3:
case 7:
return TRUE;
default:
bFill = TRUE;
}
}
FX_ARGB stroke_argb = 0, fill_argb = 0;
FX_BOOL bPattern = FALSE;
if (bStroke) {
if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) {
bPattern = TRUE;
} else {
stroke_argb = GetStrokeArgb(textobj);
}
}
if (bFill) {
if (textobj->m_ColorState.GetFillColor()->IsPattern()) {
bPattern = TRUE;
} else {
fill_argb = GetFillArgb(textobj);
}
}
CFX_AffineMatrix text_matrix;
textobj->GetTextMatrix(&text_matrix);
if(IsAvailableMatrix(text_matrix) == FALSE) {
return TRUE;
}
FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
if (bPattern) {
DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke);
return TRUE;
}
#if defined(_FPDFAPI_MINI_)
if (bFill) {
bStroke = FALSE;
}
if (bStroke) {
if (font_size * text_matrix.GetXUnit() * pObj2Device->GetXUnit() < 6) {
bStroke = FALSE;
}
}
#endif
if (bClip || bStroke) {
const CFX_AffineMatrix* pDeviceMatrix = pObj2Device;
CFX_AffineMatrix device_matrix;
if (bStroke) {
const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM;
if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
CFX_AffineMatrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
text_matrix.ConcatInverse(ctm);
device_matrix.Copy(ctm);
device_matrix.Concat(*pObj2Device);
pDeviceMatrix = &device_matrix;
}
}
int flag = 0;
if (bStroke && bFill) {
flag |= FX_FILL_STROKE;
flag |= FX_STROKE_TEXT_MODE;
}
#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
//.........这里部分代码省略.........