From 4f38fa81062e5e2e151715a162c295b9a216568a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 10 Feb 2004 18:38:58 +0000 Subject: [PATCH] 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). --- ChangeLog | 8 ++++++++ configure.in | 21 +++++++++++++++++++-- src/fcfreetype.c | 4 ++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb7be0d..b75341f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-02-10 Keith Packard + + * 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 * 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 +#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 * -- 2.39.2