diff options
author | Gilles Espinasse <g.esp@free.fr> | 2012-10-20 23:06:44 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-21 09:34:08 +0100 |
commit | 813143c2205c12923519ce6dcf3c8e10f63f1085 (patch) | |
tree | c3776831af7779b9b5176b29554666b053381537 /src | |
parent | c565bad8901dbe66e1402cdc2418986e96e698e3 (diff) |
ft: Fix compilation on 1.12 without FT_Get_X11_Font_Format
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-ft-font.c | 23 |
1 files changed, 17 insertions, 6 deletions
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; } |