diff options
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r-- | core/fpdfapi/render/cpdf_charposlist.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp index 6d4540e163..d4c6b3b5f9 100644 --- a/core/fpdfapi/render/cpdf_charposlist.cpp +++ b/core/fpdfapi/render/cpdf_charposlist.cpp @@ -39,19 +39,23 @@ void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes, charpos.m_bFontStyle = true; charpos.m_GlyphIndex = pFont->GlyphFromCharCode(CharCode, &bVert); - if (charpos.m_GlyphIndex != static_cast<uint32_t>(-1)) { + uint32_t GlyphID = charpos.m_GlyphIndex; +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + charpos.m_ExtGID = pFont->GlyphFromCharCodeExt(CharCode); + GlyphID = charpos.m_ExtGID; +#endif + if (GlyphID != static_cast<uint32_t>(-1)) { charpos.m_FallbackFontPosition = -1; } else { charpos.m_FallbackFontPosition = pFont->FallbackFontFromCharcode(CharCode); charpos.m_GlyphIndex = pFont->FallbackGlyphFromCharcode( charpos.m_FallbackFontPosition, CharCode); - } - -// TODO(npm): Figure out how this affects m_ExtGID #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - charpos.m_ExtGID = pFont->GlyphFromCharCodeExt(CharCode); + charpos.m_ExtGID = charpos.m_GlyphIndex; #endif + } + if (!pFont->IsEmbedded() && !pFont->IsCIDFont()) charpos.m_FontCharWidth = pFont->GetCharWidthF(CharCode); else |