From 4ee6139e8cfecab9e181115894b26131ad6de09a Mon Sep 17 00:00:00 2001 From: npm Date: Tue, 25 Oct 2016 11:37:02 -0700 Subject: 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 --- core/fxge/apple/fx_apple_platform.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 glyph_indices(nChars); CFX_FixedBufGrow 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 -- cgit v1.2.3