[PATCH 3/4] gdi32: Set NTM_TT_OPENTYPE flag for fonts with TrueType outlines

Nikolay Sivov nsivov at codeweavers.com
Mon Feb 29 22:19:03 CST 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/gdi32/freetype.c   | 2 ++
 dlls/gdi32/tests/font.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 57cf695..8d588efb 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1960,6 +1960,8 @@ static inline DWORD get_ntm_flags( FT_Face ft_face )
 
         if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'C','F','F',' ' ), 0, NULL, &table_size ))
             flags |= NTM_PS_OPENTYPE;
+        else if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'g','l','y','f' ), 0, NULL, &table_size ))
+            flags |= NTM_TT_OPENTYPE;
 
         table_size = 0;
         if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'D','S','I','G' ), 0, NULL, &table_size ))
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 1059d29..898a4e8 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -79,6 +79,7 @@ static WORD system_lang_id;
 #define MS_NAME_TAG MS_MAKE_TAG('n','a','m','e')
 #define MS_CFF_TAG MS_MAKE_TAG('C','F','F',' ')
 #define MS_DSIG_TAG MS_MAKE_TAG('D','S','I','G')
+#define MS_GLYF_TAG MS_MAKE_TAG('g','l','y','f')
 
 static void init(void)
 {
@@ -3971,6 +3972,11 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
         ntm->ntmFlags, has_cff, font_name);
     if (GetFontData(hdc, MS_DSIG_TAG, 0, NULL, 0) != GDI_ERROR)
         ok(ntm->ntmFlags & NTM_DSIG, "DSIG test, got flags 0x%08x, %s\n", ntm->ntmFlags, font_name);
+    if (ntm->ntmFlags & NTM_TT_OPENTYPE)
+    {
+        BOOL has_glyf = GetFontData(hdc, MS_GLYF_TAG, 0, NULL, 0) != GDI_ERROR;
+        ok(has_glyf, "GLYF test, got flags 0x%08x, %s\n", ntm->ntmFlags, font_name);
+    }
 
     test_negative_width(hdc, lf);
 
-- 
2.7.0




More information about the wine-patches mailing list