summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_type1font.cpp
diff options
context:
space:
mode:
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())