diff --git a/configure.ac b/configure.ac index 017e81af5..c3b8f0199 100644 --- a/configure.ac +++ b/configure.ac @@ -533,7 +533,7 @@ if test "x$use_ft" = "xyes"; then AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM, [FT_Bitmap_Size structure includes y_ppem field]) - AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter) + AC_CHECK_FUNCS(FT_Get_X11_Font_Format FT_GlyphSlot_Embolden FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter) LIBS="$_save_libs" CFLAGS="$_save_cflags" diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index bd616b5d2..75cc132e7 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -2521,6 +2521,22 @@ _cairo_index_to_glyph_name (void *abstract_font, return CAIRO_INT_STATUS_UNSUPPORTED; } +static cairo_bool_t +_ft_is_type1 (FT_Face face) +{ +#if HAVE_FT_GET_X11_FONT_FORMAT + const char *font_format = FT_Get_X11_Font_Format (face); + if (font_format && + (strcmp (font_format, "Type 1") == 0 || + strcmp (font_format, "CFF") == 0)) + { + return TRUE; + } +#endif + + return FALSE; +} + static cairo_int_status_t _cairo_ft_load_type1_data (void *abstract_font, long offset, @@ -2533,7 +2549,6 @@ _cairo_ft_load_type1_data (void *abstract_font, cairo_status_t status = CAIRO_STATUS_SUCCESS; unsigned long available_length; unsigned long ret; - const char *font_format; assert (length != NULL); @@ -2551,11 +2566,7 @@ _cairo_ft_load_type1_data (void *abstract_font, } #endif - font_format = FT_Get_X11_Font_Format (face); - if (!font_format || - !(strcmp (font_format, "Type 1") == 0 || - strcmp (font_format, "CFF") == 0)) - { + if (! _ft_is_type1 (face)) { status = CAIRO_INT_STATUS_UNSUPPORTED; goto unlock; }