From 42c81425316190f6424ecb9b19d5a886aa1e4136 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 13 Sep 2016 23:49:46 +0200 Subject: [PATCH] [GX] Fix build with older FreeType --- configure.ac | 4 ++++ src/hb-ft.cc | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 0fdaf531..6948aa6f 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,10 @@ if test "x$with_freetype" = "xyes" -a "x$have_freetype" != "xtrue"; then fi if $have_freetype; then AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) + save_libs=$LIBS + LIBS="$LIBS $FREETYPE_LIBS" + AC_CHECK_FUNCS(FT_Get_Var_Blend_Coordinates) + LIBS=$save_libs fi AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 30d28c09..f127066a 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -617,18 +617,22 @@ hb_ft_font_create (FT_Face ft_face, ft_face->size->metrics.y_ppem); #endif +#ifdef HAVE_FT_GET_VAR_BLEND_COORDINATES FT_MM_Var *mm_var = NULL; - if (!FT_Get_MM_Var (ft_face, &mm_var)) { + if (!FT_Get_MM_Var (ft_face, &mm_var)) + { FT_Fixed coords[mm_var->num_axis]; int hbCoords[mm_var->num_axis]; - if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, coords)) { - for (int i = 0; i < mm_var->num_axis; ++i) { + if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, coords)) + { + for (int i = 0; i < mm_var->num_axis; ++i) hbCoords[i] = coords[i] >> 2; - } + hb_font_set_var_coords_normalized (font, hbCoords, mm_var->num_axis); } } free (mm_var); +#endif return font; } -- GitLab