diff options
author | Lei Zhang <thestig@chromium.org> | 2015-03-31 13:07:21 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-03-31 13:07:21 -0700 |
commit | 6da351dd1890b465d660e6505d1b73ef3cc32558 (patch) | |
tree | 58a7b9766d23defd67c98ab874a5f2551f0d903f /core | |
parent | 3a971e141503ecfa456f62090ea0b01fa41b3d4d (diff) | |
download | pdfium-6da351dd1890b465d660e6505d1b73ef3cc32558.tar.xz |
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
(cherry picked from commit e3dd159edee8cf2eec3f30f77ef6830597c1bc2f)
Review URL: https://codereview.chromium.org/1044353002
Diffstat (limited to 'core')
-rw-r--r-- | core/src/fxge/ge/fx_ge_text.cpp | 12 |
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 aca739afae..2e13c0416c 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -1336,7 +1336,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) { |