]> git.wh0rd.org Git - fontconfig.git/commitdiff
Pre-2.1.5 versions of FreeType didn't include y_ppem in the FT_Bitmap_Size
authorKeith Packard <keithp@keithp.com>
Tue, 10 Feb 2004 18:38:58 +0000 (18:38 +0000)
committerKeith Packard <keithp@keithp.com>
Tue, 10 Feb 2004 18:38:58 +0000 (18:38 +0000)
    record. Add a configure.in test for this and change the code
    accordingly (using height instead).

ChangeLog
configure.in
src/fcfreetype.c

index cb7be0d2aa6441fde2aebd6bf0a4a06c703ca37b..b75341f78bd8a643097d3aaf5ca6655d0dd3d709 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-02-10  Keith Packard  <keithp@keithp.com>
+
+       * configure.in:
+       * src/fcfreetype.c: (FcGetPixelSize):
+       Pre-2.1.5 versions of FreeType didn't include y_ppem in the
+       FT_Bitmap_Size record.  Add a configure.in test for this
+       and change the code accordingly (using height instead).
+
 2004-02-06  Keith Packard  <keithp@keithp.com>
 
        * fc-lang/nds.orth:
index 275ff4ca7cd48896e0b8315d6dabc559db7e3393..299410c80ea4476ac80323a306d11f467c9abd06 100644 (file)
@@ -120,10 +120,27 @@ AC_SUBST(FREETYPE_CFLAGS)
 #  FT_Has_PS_Glyph_Names
 #
 
-fontconfig_save_libs=$LIBS
+fontconfig_save_libs="$LIBS"
+fontconfig_save_cflags="$CFLAGS"
 LIBS="$LIBS $FREETYPE_LIBS"
+CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
 AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names)
-LIBS=$fontconfig_save_libs
+AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,,,
+[#include <ft2build.h>
+#include FT_FREETYPE_H])
+LIBS="$fontconfig_save_libs"
+CFLAGS="$fontconfig_save_cflags"
+
+case "$ac_cv_member_FT_Bitmap_Size_y_ppem" in
+yes)
+       HAVE_FT_BITMAP_SIZE_Y_PPEM=1
+       ;;
+*)
+       HAVE_FT_BITMAP_SIZE_Y_PPEM=0
+       ;;
+esac
+AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
+                  [FT_Bitmap_Size structure includes y_ppem field])
 
 #
 # Check expat configuration
index 75da7357424dcf105d0f5b8bc29ca1865faff768..ea2ee88a570bd6967e14461d188e715dddd91abd 100644 (file)
@@ -358,7 +358,11 @@ FcGetPixelSize (FT_Face face, int i)
            return (double) prop.u.integer;
     }
 #endif
+#ifdef HAVE_FT_BITMAP_SIZE_Y_PPEM
     return (double) face->available_sizes[i].y_ppem / 64.0;
+#else
+    return (double) face->available_sizes[i].height / 64.0;
+#endif
 }
 
 FcPattern *