Merge to XFA: Correct unexpected hinting fonts
authorTom Sepez <tsepez@chromium.org>
Thu, 11 Jun 2015 22:24:26 +0000 (15:24 -0700)
committerTom Sepez <tsepez@chromium.org>
Thu, 11 Jun 2015 22:24:26 +0000 (15:24 -0700)
If the font is 'tricky', it needs to be hinted by default according to the description in freetype.

BUG=490814
TBR=jun_fang@foxitsoftware.com

Original Review URL: https://codereview.chromium.org/1170313003.

Review URL: https://codereview.chromium.org/1175243008.

DEPS
core/src/fxge/ge/fx_ge_text.cpp

diff --git a/DEPS b/DEPS
index 59e39a4..af90a67 100644 (file)
--- a/DEPS
+++ b/DEPS
@@ -6,7 +6,7 @@ deps = {
     "https://chromium.googlesource.com/chromium/buildtools.git@46ce8cb60364e9e0b21a81136c7debdddfd063a8",
 
   "testing/corpus":
-     "https://pdfium.googlesource.com/pdfium_tests@73e1d0c915fe574a470fcbc76dd36246ac9fec45",
+     "https://pdfium.googlesource.com/pdfium_tests@4b9a1d593e5a101d034a4f1195174a22c179a42d",
 
   "testing/gmock":
      "https://chromium.googlesource.com/external/googlemock.git@29763965ab52f24565299976b936d1265cb6a271",
index 7133d65..3a98154 100644 (file)
@@ -1638,7 +1638,10 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
         }
     }
     FXFT_Set_Transform(m_Face, &ft_matrix, 0);
-    int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;
+    int load_flags = FXFT_LOAD_NO_BITMAP;
+    if (!(m_Face->face_flags & FT_FACE_FLAG_SFNT) || !FT_IS_TRICKY(m_Face)) {
+        load_flags |= FT_LOAD_NO_HINTING;
+    }
     int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
     if (error) {
         return NULL;