[PATCH 2/4] gdi32: Return NTM_DSIG when table is present

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


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

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 01cb913..57cf695 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1942,7 +1942,6 @@ static inline FT_Fixed get_font_version( FT_Face ft_face )
 static inline DWORD get_ntm_flags( FT_Face ft_face )
 {
     DWORD flags = 0;
-    FT_ULong table_size = 0;
     FT_WinFNT_HeaderRec winfnt_header;
 
     if (ft_face->style_flags & FT_STYLE_FLAG_ITALIC) flags |= NTM_ITALIC;
@@ -1956,8 +1955,16 @@ static inline DWORD get_ntm_flags( FT_Face ft_face )
 
     if (flags == 0) flags = NTM_REGULAR;
 
-    if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'C','F','F',' ' ), 0, NULL, &table_size ))
-        flags |= NTM_PS_OPENTYPE;
+    if (FT_IS_SFNT( ft_face )) {
+        FT_ULong table_size = 0;
+
+        if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'C','F','F',' ' ), 0, NULL, &table_size ))
+            flags |= NTM_PS_OPENTYPE;
+
+        table_size = 0;
+        if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'D','S','I','G' ), 0, NULL, &table_size ))
+            flags |= NTM_DSIG;
+    }
 
     return flags;
 }
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index d39e701..1059d29 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -78,6 +78,7 @@ static WORD system_lang_id;
 #define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p')
 #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')
 
 static void init(void)
 {
@@ -3968,6 +3969,8 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
     has_cff = GetFontData(hdc, MS_CFF_TAG, 0, NULL, 0) != GDI_ERROR;
     ok(((ntm->ntmFlags & NTM_PS_OPENTYPE) == NTM_PS_OPENTYPE) == has_cff, "CFF test, got flags 0x%08x, CFF table %d, %s\n",
         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);
 
     test_negative_width(hdc, lf);
 
-- 
2.7.0




More information about the wine-patches mailing list