Commit c666a455 authored by Byeongsik Jeon's avatar Byeongsik Jeon Committed by Alexandre Julliard

gdi32: Add a workaround for Freetype < 2.8.1 using v40 FT_LOAD_TARGET_MONO.

Freetype < 2.8.1 v40 has incorrect advance widths and rendering issues. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41639Signed-off-by: 's avatarByeongsik Jeon <bsjeon@hanmail.net> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bfd02931
...@@ -170,6 +170,7 @@ static FT_TrueTypeEngineType (*pFT_Get_TrueType_Engine_Type)(FT_Library); ...@@ -170,6 +170,7 @@ static FT_TrueTypeEngineType (*pFT_Get_TrueType_Engine_Type)(FT_Library);
#ifdef FT_LCD_FILTER_H #ifdef FT_LCD_FILTER_H
static FT_Error (*pFT_Library_SetLcdFilter)(FT_Library, FT_LcdFilter); static FT_Error (*pFT_Library_SetLcdFilter)(FT_Library, FT_LcdFilter);
#endif #endif
static FT_Error (*pFT_Property_Set)(FT_Library, const FT_String *, const FT_String *, const void *);
#ifdef SONAME_LIBFONTCONFIG #ifdef SONAME_LIBFONTCONFIG
#include <fontconfig/fontconfig.h> #include <fontconfig/fontconfig.h>
...@@ -4162,6 +4163,7 @@ static BOOL init_freetype(void) ...@@ -4162,6 +4163,7 @@ static BOOL init_freetype(void)
#ifdef FT_LCD_FILTER_H #ifdef FT_LCD_FILTER_H
pFT_Library_SetLcdFilter = wine_dlsym(ft_handle, "FT_Library_SetLcdFilter", NULL, 0); pFT_Library_SetLcdFilter = wine_dlsym(ft_handle, "FT_Library_SetLcdFilter", NULL, 0);
#endif #endif
pFT_Property_Set = wine_dlsym(ft_handle, "FT_Property_Set", NULL, 0);
if(pFT_Init_FreeType(&library) != 0) { if(pFT_Init_FreeType(&library) != 0) {
ERR("Can't init FreeType library\n"); ERR("Can't init FreeType library\n");
...@@ -4176,6 +4178,13 @@ static BOOL init_freetype(void) ...@@ -4176,6 +4178,13 @@ static BOOL init_freetype(void)
((FT_Version.minor << 8) & 0x00ff00) | ((FT_Version.minor << 8) & 0x00ff00) |
((FT_Version.patch ) & 0x0000ff); ((FT_Version.patch ) & 0x0000ff);
/* In Freetype < 2.8.1 v40's FT_LOAD_TARGET_MONO has broken advance widths. */
if (pFT_Property_Set && FT_SimpleVersion < FT_VERSION_VALUE(2, 8, 1))
{
FT_UInt interpreter_version = 35;
pFT_Property_Set( library, "truetype", "interpreter-version", &interpreter_version );
}
font_driver = &freetype_funcs; font_driver = &freetype_funcs;
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment