summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/font/cpdf_font.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_font.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index a6a661b328..b9be3aa868 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -457,9 +457,12 @@ int CPDF_Font::FallbackGlyphFromCharcode(int fallbackFont, uint32_t charcode) {
if (!pdfium::IndexInBounds(m_FontFallbacks, fallbackFont))
return -1;
+ CFX_WideString str = UnicodeFromCharCode(charcode);
+ uint32_t unicode = !str.IsEmpty() ? str.GetAt(0) : charcode;
int glyph =
- FXFT_Get_Char_Index(m_FontFallbacks[fallbackFont]->GetFace(), charcode);
- if (glyph == 0 || glyph == 0xffff)
+ FXFT_Get_Char_Index(m_FontFallbacks[fallbackFont]->GetFace(), unicode);
+ if (glyph == 0)
return -1;
+
return glyph;
}