From 90020c953ac7bcd7dd39ae8e33bf20a2f4c2c58b Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 6 Oct 2005 12:28:11 +0000 Subject: [PATCH] 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. --- dlls/gdi/font.c | 13 ------------- dlls/gdi/freetype.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/gdi.h | 4 ++++ 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/dlls/gdi/font.c b/dlls/gdi/font.c index 3ccc1aaf372..59d5d965281 100644 --- a/dlls/gdi/font.c +++ b/dlls/gdi/font.c @@ -2431,19 +2431,6 @@ BOOL WINAPI CreateScalableFontResourceW( DWORD fHidden, 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.@) */ diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 7f2f765900c..41a1ded27de 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -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,32 @@ 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 +3895,16 @@ 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 */ diff --git a/include/gdi.h b/include/gdi.h index e4f608553da..af18a039571 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -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 0x8000 + #endif /* __WINE_GDI_H */ -- 2.11.4.GIT