summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_type1font.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-13 19:28:39 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-13 19:28:39 +0000
commit1a99f200c59a89fe297ac79658d2fe11b13b1553 (patch)
tree12202f250b102a1a7a7d3fb1bea087f91df67439 /core/fpdfapi/font/cpdf_type1font.cpp
parentb850c987d141c5578535faba64d14782dbfc13da (diff)
downloadpdfium-1a99f200c59a89fe297ac79658d2fe11b13b1553.tar.xz
Mark CPDF_Font::GlyphFromCharCodeExt() and friends Mac only.
Change-Id: I4906351a6e21fb8480670a6daf15bd7cb9e441c5 Reviewed-on: https://pdfium-review.googlesource.com/39911 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_type1font.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_type1font.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp
index 8d0eafcc97..9e2f4eff58 100644
--- a/core/fpdfapi/font/cpdf_type1font.cpp
+++ b/core/fpdfapi/font/cpdf_type1font.cpp
@@ -62,7 +62,11 @@ bool FT_UseType1Charmap(FXFT_Face face) {
CPDF_Type1Font::CPDF_Type1Font(CPDF_Document* pDocument,
CPDF_Dictionary* pFontDict)
- : CPDF_SimpleFont(pDocument, pFontDict) {}
+ : CPDF_SimpleFont(pDocument, pFontDict) {
+#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
+ memset(m_ExtGID, 0xff, sizeof(m_ExtGID));
+#endif
+}
CPDF_Type1Font::~CPDF_Type1Font() = default;
@@ -102,16 +106,15 @@ bool CPDF_Type1Font::Load() {
return LoadCommon();
}
+#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
int CPDF_Type1Font::GlyphFromCharCodeExt(uint32_t charcode) {
- if (charcode > 0xff) {
+ if (charcode > 0xff)
return -1;
- }
- int index = m_ExtGID[(uint8_t)charcode];
- if (index == 0xffff) {
- return -1;
- }
- return index;
+
+ int index = m_ExtGID[static_cast<uint8_t>(charcode)];
+ return index != 0xffff ? index : -1;
}
+#endif
void CPDF_Type1Font::LoadGlyphMap() {
if (!m_Font.GetFace())