本文整理汇总了C++中CFX_ByteString::ReverseFind方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_ByteString::ReverseFind方法的具体用法?C++ CFX_ByteString::ReverseFind怎么用?C++ CFX_ByteString::ReverseFind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_ByteString
的用法示例。
在下文中一共展示了CFX_ByteString::ReverseFind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindSubstFont
FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
FX_BOOL bTrueType,
uint32_t flags,
int weight,
int italic_angle,
int WindowCP,
CFX_SubstFont* pSubstFont) {
if (!(flags & FXFONT_USEEXTERNATTR)) {
weight = FXFONT_FW_NORMAL;
italic_angle = 0;
}
CFX_ByteString SubstName = name;
SubstName.Remove(' ');
if (bTrueType && name[0] == '@')
SubstName = name.Mid(1);
PDF_GetStandardFontName(&SubstName);
if (SubstName == "Symbol" && !bTrueType) {
pSubstFont->m_Family = "Chrome Symbol";
pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
if (m_FoxitFaces[12])
return m_FoxitFaces[12];
const uint8_t* pFontData = nullptr;
uint32_t size = 0;
m_pFontMgr->GetBuiltinFont(12, &pFontData, &size);
m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
return m_FoxitFaces[12];
}
if (SubstName == "ZapfDingbats") {
pSubstFont->m_Family = "Chrome Dingbats";
pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
if (m_FoxitFaces[13])
return m_FoxitFaces[13];
const uint8_t* pFontData = nullptr;
uint32_t size = 0;
m_pFontMgr->GetBuiltinFont(13, &pFontData, &size);
m_FoxitFaces[13] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
return m_FoxitFaces[13];
}
int iBaseFont = 0;
CFX_ByteString family;
CFX_ByteString style;
bool bHasComma = false;
bool bHasHyphen = false;
int find = SubstName.Find(",", 0);
if (find >= 0) {
family = SubstName.Left(find);
PDF_GetStandardFontName(&family);
style = SubstName.Mid(find + 1);
bHasComma = true;
} else {
family = SubstName;
}
for (; iBaseFont < kExternalFontIndex; iBaseFont++) {
if (family == CFX_ByteStringC(g_Base14FontNames[iBaseFont]))
break;
}
int PitchFamily = 0;
bool bItalic = false;
uint32_t nStyle = 0;
bool bStyleAvail = false;
if (iBaseFont < kExternalFontIndex) {
if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2)
nStyle |= FX_FONT_STYLE_Bold;
if ((iBaseFont % 4) / 2)
nStyle |= FX_FONT_STYLE_Italic;
if (iBaseFont < 4)
PitchFamily |= FXFONT_FF_FIXEDPITCH;
if (iBaseFont >= 8)
PitchFamily |= FXFONT_FF_ROMAN;
} else {
if (!bHasComma) {
find = family.ReverseFind('-');
if (find >= 0) {
style = family.Mid(find + 1);
family = family.Left(find);
bHasHyphen = true;
}
}
if (!bHasHyphen) {
int nLen = family.GetLength();
int32_t nRet = GetStyleType(family, true);
if (nRet > -1) {
family = family.Left(nLen - g_FontStyles[nRet].len);
if (nRet == 0)
nStyle |= FX_FONT_STYLE_Bold;
else if (nRet == 1)
nStyle |= FX_FONT_STYLE_Italic;
else if (nRet == 2)
nStyle |= (FX_FONT_STYLE_Bold | FX_FONT_STYLE_Italic);
}
}
UpdatePitchFamily(flags, PitchFamily);
}
if (!style.IsEmpty()) {
int nLen = style.GetLength();
const FX_CHAR* pStyle = style.c_str();
int i = 0;
bool bFirstItem = true;
//.........这里部分代码省略.........