diff options
author | Nicolas Pena <npm@chromium.org> | 2016-10-28 14:50:04 -0400 |
---|---|---|
committer | Nicolas Pena <npm@chromium.org> | 2016-10-28 14:50:04 -0400 |
commit | e3183750107b0d54a0229874b1da75e2cae8c3ea (patch) | |
tree | c37a93db5f60cc987250df3b0bf34ed9173b3e59 | |
parent | fee1e9ff603527d2ccd45d3e6fd32886228b917a (diff) | |
download | pdfium-e3183750107b0d54a0229874b1da75e2cae8c3ea.tar.xz |
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 .
-rw-r--r-- | core/fxge/apple/fx_apple_platform.cpp | 3 |
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 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<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 |