summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-03-30 16:24:09 -0700
committerJUN FANG <jun_fang@foxitsoftware.com>2015-03-30 16:35:37 -0700
commit45ffe53b877cc2d03df9f1a9c58fcb3e87fa1b74 (patch)
treed9a03990e1e8b3494f238f55c852cefb7821ed17 /core/src/fxge
parentf5986cb807b95a4513eb57153a364a98e3ae5732 (diff)
downloadpdfium-45ffe53b877cc2d03df9f1a9c58fcb3e87fa1b74.tar.xz
Merge to XFA: Fix no text displayed issue when font embedded and font subsetting enabled
BUG=465322 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1045553004
Diffstat (limited to 'core/src/fxge')
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 59bd351822..e20d6bc4bd 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -1332,7 +1332,17 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);
int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
if (error) {
- return NULL;
+ //if an error is returned, try to reload glyphs without hinting.
+ if (load_flags & FT_LOAD_NO_HINTING || load_flags & FT_LOAD_NO_SCALE) {
+ return NULL;
+ }
+
+ load_flags |= FT_LOAD_NO_HINTING;
+ error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
+
+ if (error) {
+ return NULL;
+ }
}
int weight = 0;
if (bUseCJKSubFont) {