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).
This commit is contained in:
Keith Packard 2004-02-10 18:38:58 +00:00
parent b68b96464f
commit 4f38fa8106
3 changed files with 31 additions and 2 deletions

View File

@ -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:

View 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

View 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 *