From: Keith Packard Date: Tue, 10 Feb 2004 18:38:58 +0000 (+0000) Subject: Pre-2.1.5 versions of FreeType didn't include y_ppem in the FT_Bitmap_Size X-Git-Tag: fc-2_2_93~5 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4f38fa81062e5e2e151715a162c295b9a216568a;p=fontconfig.git 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). --- 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 *