From e3183750107b0d54a0229874b1da75e2cae8c3ea Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Fri, 28 Oct 2016 14:50:04 -0400 Subject: M55: 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 (cherry picked from commit 4ee6139e8cfecab9e181115894b26131ad6de09a) R=thestig@chromium.org Review URL: https://codereview.chromium.org/2460993002 . --- 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 2108d4d2e4..a4ec101750 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