diff options
author | Keith Packard <keithp@keithp.com> | 2004-02-10 18:38:58 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2004-02-10 18:38:58 +0000 |
commit | 4f38fa81062e5e2e151715a162c295b9a216568a (patch) | |
tree | b153d2aefbf6c42e13e4af24dd8df457b01332e6 | |
parent | b68b96464f6488dbc62c4dcd62ca7e2eed3141d2 (diff) | |
download | fontconfig-4f38fa81062e5e2e151715a162c295b9a216568a.tar.gz |
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).
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | configure.in | 21 | ||||
-rw-r--r-- | src/fcfreetype.c | 4 |
3 files changed, 31 insertions, 2 deletions
@@ -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: diff --git a/configure.in b/configure.in index 275ff4c..299410c 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/fcfreetype.c b/src/fcfreetype.c index 75da735..ea2ee88 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -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 * |