diff --git a/configure b/configure index 30aff749bf1..b962b54873a 100755 --- a/configure +++ b/configure @@ -10156,6 +10156,71 @@ sed 's/^/| /' conftest.$ac_ext >&5 wine_cv_fttrigon=no fi rm -f conftest.err conftest.$ac_ext + echo "$as_me:$LINENO: checking for FT_TrueTypeEngineType" >&5 +echo $ECHO_N "checking for FT_TrueTypeEngineType... $ECHO_C" >&6 +if test "${ac_cv_type_FT_TrueTypeEngineType+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +if ((FT_TrueTypeEngineType *) 0) + return 0; +if (sizeof (FT_TrueTypeEngineType)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_FT_TrueTypeEngineType=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_FT_TrueTypeEngineType=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_FT_TrueTypeEngineType" >&5 +echo "${ECHO_T}$ac_cv_type_FT_TrueTypeEngineType" >&6 +if test $ac_cv_type_FT_TrueTypeEngineType = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_FT_TRUETYPEENGINETYPE 1 +_ACEOF + + +fi + CPPFLAGS="$ac_save_CPPFLAGS" if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes" then diff --git a/configure.ac b/configure.ac index 652de1a2098..a8b4e2e453e 100644 --- a/configure.ac +++ b/configure.ac @@ -606,6 +606,7 @@ else [Define if you have the header file.]) wine_cv_fttrigon=yes], wine_cv_fttrigon=no) + AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include ]) CPPFLAGS="$ac_save_CPPFLAGS" dnl Check that we have at least freetype/freetype.h if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes" diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index a983d25d602..ad0d6ebbe6f 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -90,8 +90,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(font); #define SONAME_LIBFREETYPE "libfreetype.so" #endif -#ifndef FT_MODULE_DRIVER_HAS_HINTER -#define FT_MODULE_DRIVER_HAS_HINTER 0x400 +#ifndef HAVE_FT_TRUETYPEENGINETYPE +typedef enum +{ + FT_TRUETYPE_ENGINE_TYPE_NONE = 0, + FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, + FT_TRUETYPE_ENGINE_TYPE_PATENTED +} FT_TrueTypeEngineType; #endif static FT_Library library = 0; @@ -126,7 +131,7 @@ MAKE_FUNCPTR(FT_Vector_Transform); static void (*pFT_Library_Version)(FT_Library,FT_Int*,FT_Int*,FT_Int*); static FT_Error (*pFT_Load_Sfnt_Table)(FT_Face,FT_ULong,FT_Long,FT_Byte*,FT_ULong*); static FT_ULong (*pFT_Get_First_Char)(FT_Face,FT_UInt*); -static FT_Error (*pFT_Module_Get_Flags)(FT_Module,FT_ULong*); +static FT_TrueTypeEngineType (*pFT_Get_TrueType_Engine_Type)(FT_Library); #ifdef HAVE_FREETYPE_FTWINFNT_H MAKE_FUNCPTR(FT_Get_WinFNT_Header); #endif @@ -1504,7 +1509,7 @@ BOOL WineEngInit(void) pFT_Library_Version = wine_dlsym(ft_handle, "FT_Library_Version", NULL, 0); pFT_Load_Sfnt_Table = wine_dlsym(ft_handle, "FT_Load_Sfnt_Table", NULL, 0); pFT_Get_First_Char = wine_dlsym(ft_handle, "FT_Get_First_Char", NULL, 0); - pFT_Module_Get_Flags = wine_dlsym(ft_handle, "FT_Module_Get_Flags", NULL, 0); + pFT_Get_TrueType_Engine_Type = wine_dlsym(ft_handle, "FT_Get_TrueType_Engine_Type", NULL, 0); #ifdef HAVE_FREETYPE_FTWINFNT_H pFT_Get_WinFNT_Header = wine_dlsym(ft_handle, "FT_Get_WinFNT_Header", NULL, 0); #endif @@ -3844,19 +3849,19 @@ BOOL WINAPI FontIsLinked(HDC hdc) static BOOL is_hinting_enabled(void) { - FT_Module mod = pFT_Get_Module(library, "truetype"); + FT_Module mod; /* Use the >= 2.2.0 function if available */ - if(pFT_Module_Get_Flags) + if(pFT_Get_TrueType_Engine_Type) { - FT_ULong flags; - pFT_Module_Get_Flags(mod, &flags); - return flags & FT_MODULE_DRIVER_HAS_HINTER; + FT_TrueTypeEngineType type = pFT_Get_TrueType_Engine_Type(library); + return type == FT_TRUETYPE_ENGINE_TYPE_PATENTED; } /* otherwise if we've been compiled with < 2.2.0 headers use the internal macro */ #ifdef FT_DRIVER_HAS_HINTER + mod = pFT_Get_Module(library, "truetype"); if(mod && FT_DRIVER_HAS_HINTER(mod)) return TRUE; #endif diff --git a/include/config.h.in b/include/config.h.in index 8d2502128b8..18f11277887 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -149,6 +149,9 @@ /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE +/* Define to 1 if the system has the type `FT_TrueTypeEngineType'. */ +#undef HAVE_FT_TRUETYPEENGINETYPE + /* Define to 1 if you have the `futimes' function. */ #undef HAVE_FUTIMES