summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-10-25 11:37:02 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-25 11:37:03 -0700
commit4ee6139e8cfecab9e181115894b26131ad6de09a (patch)
tree1bb459b765624c1e922869ea55ea608fd6757b86 /core
parent37b203059210426d8739c37eb00b2ca9583fa4b6 (diff)
downloadpdfium-4ee6139e8cfecab9e181115894b26131ad6de09a.tar.xz
Use m_GlyphIndex as backup for m_ExtGID on Mac
When CGFontGetGlyphWithGlyphName returns 0, it means the glyph name was not recognized. In this case, try using the glyph index to load the glyph. BUG=pdfium:625 Review-Url: https://codereview.chromium.org/2445933002
Diffstat (limited to 'core')
-rw-r--r--core/fxge/apple/fx_apple_platform.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index 211e5745e2..6428c1d9e5 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -63,7 +63,8 @@ FX_BOOL CGDrawGlyphRun(CGContextRef pContext,
CFX_FixedBufGrow<uint16_t, 32> glyph_indices(nChars);
CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
for (int i = 0; i < nChars; i++) {
- glyph_indices[i] = pCharPos[i].m_ExtGID;
+ glyph_indices[i] =
+ pCharPos[i].m_ExtGID ? pCharPos[i].m_ExtGID : pCharPos[i].m_GlyphIndex;
if (bNegSize)
glyph_positions[i].x = -pCharPos[i].m_OriginX;
else