summaryrefslogtreecommitdiff
path: root/core/fxge/skia
diff options
context:
space:
mode:
authorCary Clark <caryclark@skia.org>2017-07-12 14:19:54 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-13 14:51:36 +0000
commitebc351b1aa10582f8486573e65157adf5dadd8cd (patch)
treebcf9f63aae77972f076e62cdf9c6c0f73cc458ca /core/fxge/skia
parent95ea778b4411bbd46b21f93e391f3bbd3e798342 (diff)
downloadpdfium-ebc351b1aa10582f8486573e65157adf5dadd8cd.tar.xz
fix skiapaths for sparse type1 on mac
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 <npm@chromium.org> Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'core/fxge/skia')
-rw-r--r--core/fxge/skia/fx_skia_device.cpp8
1 files changed, 8 insertions, 0 deletions
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<uint16_t>(cp.m_GlyphIndex);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (cp.m_ExtGID)
+ m_glyphs[index + count] = static_cast<uint16_t>(cp.m_ExtGID);
+#endif
}
SkPoint delta;
if (MatrixOffset(pMatrix, &delta)) {
@@ -1590,6 +1594,10 @@ bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars,
}
}
glyphs[index] = static_cast<uint16_t>(cp.m_GlyphIndex);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (cp.m_ExtGID)
+ glyphs[index] = static_cast<uint16_t>(cp.m_ExtGID);
+#endif
}
if (oneAtATime)
useRSXform = false;