Fix compile with older FreeType

This commit is contained in:
Behdad Esfahbod 2009-12-20 23:05:02 +01:00
parent 7f7448a354
commit cd11a98fa1
2 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,13 @@ AM_CONDITIONAL(HAVE_ICU, $have_icu)
PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, have_freetype=false) PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, have_freetype=false)
if $have_freetype; then if $have_freetype; then
AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
_save_libs="$LIBS"
_save_cflags="$CFLAGS"
LIBS="$LIBS $FREETYPE_LIBS"
CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
LIBS="$_save_libs"
CFLAGS="$_save_cflags"
fi fi
AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)

View File

@ -39,11 +39,13 @@ hb_ft_get_glyph (hb_font_t *font, hb_face_t *face, const void *user_data,
{ {
FT_Face ft_face = (FT_Face) user_data; FT_Face ft_face = (FT_Face) user_data;
#ifdef HAVE_FT_FACE_GETCHARVARIANTINDEX
if (HB_UNLIKELY (variation_selector)) { if (HB_UNLIKELY (variation_selector)) {
hb_codepoint_t glyph = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector); hb_codepoint_t glyph = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector);
if (glyph) if (glyph)
return glyph; return glyph;
} }
#endif
return FT_Get_Char_Index (ft_face, unicode); return FT_Get_Char_Index (ft_face, unicode);
} }