fonts: GetRasterizerCaps hinter enabled flag

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Oct 5 05:55:37 CDT 2005


        Huw Davies <huw at codeweavers.com>
        Add a Wine specific flag to GetRasterizeCaps that reports
        whether freetype's patented hinter is enabled.  This will
        be used by winex11 to check whether it should honour the
        gasp table settings.
-- 
Huw Davies
huw at codeweavers.com
Index: include/gdi.h
===================================================================
RCS file: /home/wine/wine/include/gdi.h,v
retrieving revision 1.101
diff -u -p -r1.101 gdi.h
--- include/gdi.h	13 Apr 2005 16:11:18 -0000	1.101
+++ include/gdi.h	5 Oct 2005 10:50:12 -0000
@@ -84,6 +84,10 @@ typedef struct tagPALETTEOBJ
 extern void *GDI_GetObjPtr( HGDIOBJ, WORD );
 extern void GDI_ReleaseObj( HGDIOBJ );
 
+/* GetGlyphOutline */
 #define WINE_GGO_GRAY16_BITMAP 0x7f
 
+/* GetRasterizerCaps */
+#define WINE_TT_HINTER_ENABLED 0x80000000
+
 #endif  /* __WINE_GDI_H */
Index: dlls/gdi/font.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/font.c,v
retrieving revision 1.20
diff -u -p -r1.20 font.c
--- dlls/gdi/font.c	28 Sep 2005 10:14:45 -0000	1.20
+++ dlls/gdi/font.c	5 Oct 2005 10:50:13 -0000
@@ -2431,19 +2431,6 @@ BOOL WINAPI CreateScalableFontResourceW(
     return FALSE; /* create failed */
 }
 
-
-/*************************************************************************
- *             GetRasterizerCaps   (GDI32.@)
- */
-BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
-{
-  lprs->nSize = sizeof(RASTERIZER_STATUS);
-  lprs->wFlags = TT_AVAILABLE|TT_ENABLED;
-  lprs->nLanguageID = 0;
-  return TRUE;
-}
-
-
 /*************************************************************************
  *             GetKerningPairsA   (GDI32.@)
  */
Index: dlls/gdi/freetype.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/freetype.c,v
retrieving revision 1.104
diff -u -p -r1.104 freetype.c
--- dlls/gdi/freetype.c	16 Sep 2005 18:46:54 -0000	1.104
+++ dlls/gdi/freetype.c	5 Oct 2005 10:50:13 -0000
@@ -103,6 +103,7 @@ static void *ft_handle = NULL;
 MAKE_FUNCPTR(FT_Vector_Unit);
 MAKE_FUNCPTR(FT_Done_Face);
 MAKE_FUNCPTR(FT_Get_Char_Index);
+MAKE_FUNCPTR(FT_Get_Module);
 MAKE_FUNCPTR(FT_Get_Sfnt_Table);
 MAKE_FUNCPTR(FT_Init_FreeType);
 MAKE_FUNCPTR(FT_Load_Glyph);
@@ -1476,6 +1477,7 @@ BOOL WineEngInit(void)
     LOAD_FUNCPTR(FT_Vector_Unit)
     LOAD_FUNCPTR(FT_Done_Face)
     LOAD_FUNCPTR(FT_Get_Char_Index)
+    LOAD_FUNCPTR(FT_Get_Module)
     LOAD_FUNCPTR(FT_Get_Sfnt_Table)
     LOAD_FUNCPTR(FT_Init_FreeType)
     LOAD_FUNCPTR(FT_Load_Glyph)
@@ -3752,6 +3754,34 @@ BOOL WINAPI FontIsLinked(HDC hdc)
     return ret;
 }
 
+static BOOL is_hinting_enabled(void)
+{
+    FT_Module mod = pFT_Get_Module(library, "truetype");
+    if(mod && FT_DRIVER_HAS_HINTER(mod))
+        return TRUE;
+
+    return FALSE;
+}
+
+/*************************************************************************
+ *             GetRasterizerCaps   (GDI32.@)
+ */
+BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
+{
+    static int hinting = -1;
+
+    if(hinting == -1)
+        hinting = is_hinting_enabled();
+
+    lprs->nSize = sizeof(RASTERIZER_STATUS);
+    lprs->wFlags = TT_AVAILABLE | TT_ENABLED | 
+        hinting ? WINE_TT_HINTER_ENABLED : 0;
+    lprs->nLanguageID = 0;
+    return TRUE;
+}
+
+
+
 #else /* HAVE_FREETYPE */
 
 BOOL WineEngInit(void)
@@ -3867,4 +3897,15 @@ BOOL WINAPI FontIsLinked(HDC hdc)
 {
     return FALSE;
 }
+
+/*************************************************************************
+ *             GetRasterizerCaps   (GDI32.@)
+ */
+BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
+{
+    lprs->nSize = sizeof(RASTERIZER_STATUS);
+    lprs->wFlags = 0;
+    lprs->nLanguageID = 0;
+    return TRUE;
+}
 #endif /* HAVE_FREETYPE */



More information about the wine-patches mailing list