From ebc351b1aa10582f8486573e65157adf5dadd8cd Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 12 Jul 2017 14:19:54 -0400 Subject: fix skiapaths for sparse type1 on mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PDFium's native code reverse engineers the glyph code on Mac by taking the character code point, looking up its name in FreeType, and then finding the named glyph's index from CoreGraphics. If the FreeType glyph index and the CoreGraphics index don't match, it uses CoreGraphics' index when drawing. The IDs match except when drawing an embedded Type 1 font tha has been sparsely populated to cut down on the PDF size. R=dsinclair@chromium.org Bug: 738279 Change-Id: I16d993b611afe3b2481b36f886644524c9c351ef Reviewed-on: https://pdfium-review.googlesource.com/7650 Reviewed-by: Nicolás Peña Commit-Queue: Cary Clark --- core/fxge/skia/fx_skia_device.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 278b6d874f..3363973aae 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -872,6 +872,10 @@ class SkiaState { m_positions[index + count] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip}; m_glyphs[index + count] = static_cast(cp.m_GlyphIndex); +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + if (cp.m_ExtGID) + m_glyphs[index + count] = static_cast(cp.m_ExtGID); +#endif } SkPoint delta; if (MatrixOffset(pMatrix, &delta)) { @@ -1590,6 +1594,10 @@ bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, } } glyphs[index] = static_cast(cp.m_GlyphIndex); +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + if (cp.m_ExtGID) + glyphs[index] = static_cast(cp.m_ExtGID); +#endif } if (oneAtATime) useRSXform = false; -- cgit v1.2.3