tools: Don't try to use FT_Load_Sfnt_Table unless FreeType has it.

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Apr 12 06:14:27 CDT 2006


Huw Davies <huw at codeweavers.com>
tools: Don't try to use FT_Load_Sfnt_Table unless FreeType has it.
-- 
Huw Davies
huw at codeweavers.com

---

 configure.ac     |    4 ++++
 tools/sfnt2fnt.c |    9 +++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

496b7ec782a17752588af82985b12885952a28da
diff --git a/configure.ac b/configure.ac
index d1cc526..2c92dc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -657,6 +657,10 @@ else
                     wine_cv_fttrigon=yes],
                     wine_cv_fttrigon=no)
         AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include <freetype/ftmodapi.h>])
+        ac_save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $FREETYPELIBS"
+        AC_CHECK_FUNCS(FT_Load_Sfnt_Table)
+        CFLAGS="$ac_save_CFLAGS"
 	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/tools/sfnt2fnt.c b/tools/sfnt2fnt.c
index 51a0e41..8f96332 100644
--- a/tools/sfnt2fnt.c
+++ b/tools/sfnt2fnt.c
@@ -202,10 +202,13 @@ static void fill_fontinfo(FT_Face face, 
     const union cptable *cptable;
     FT_SfntName sfntname;
     TT_OS2 *os2;
+
+#ifdef HAVE_FT_LOAD_SFNT_TABLE
     FT_ULong needed;
     eblcHeader_t *eblc;
     bitmapSizeTable_t *size_table;
     int num_sizes;
+#endif
 
     cptable = wine_cp_get_table(enc);
     if(!cptable)
@@ -220,6 +223,7 @@ static void fill_fontinfo(FT_Face face, 
 
     ppem = face->size->metrics.y_ppem;
 
+#ifdef HAVE_FT_LOAD_SFNT_TABLE
     needed = 0;
     if(FT_Load_Sfnt_Table(face, TTAG_EBLC, 0, NULL, &needed))
         error("Can't find EBLC table\n");
@@ -241,6 +245,9 @@ static void fill_fontinfo(FT_Face face, 
         size_table++;
     }
 
+    free(eblc);
+#endif
+
     /* Versions of fontforge prior to early 2006 have incorrect
        ascender values in the eblc table, so we won't find the 
        correct bitmapSizeTable.  In this case use the height of
@@ -253,8 +260,6 @@ static void fill_fontinfo(FT_Face face, 
         descent = ppem - ascent;
     }
 
-    free(eblc);
-
     start = sizeof(FNT_HEADER) + sizeof(FONTINFO16);
 
     if(FT_Load_Char(face, 'M', FT_LOAD_DEFAULT))
-- 
1.2.6




More information about the wine-patches mailing list