mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-14 14:28:17 +02:00
ft: Fix compilation on 1.12 without FT_Get_X11_Font_Format
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
This commit is contained in:
parent
c565bad890
commit
813143c220
2 changed files with 18 additions and 7 deletions
|
|
@ -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,
|
AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
|
||||||
[FT_Bitmap_Size structure includes y_ppem field])
|
[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"
|
LIBS="$_save_libs"
|
||||||
CFLAGS="$_save_cflags"
|
CFLAGS="$_save_cflags"
|
||||||
|
|
|
||||||
|
|
@ -2521,6 +2521,22 @@ _cairo_index_to_glyph_name (void *abstract_font,
|
||||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
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
|
static cairo_int_status_t
|
||||||
_cairo_ft_load_type1_data (void *abstract_font,
|
_cairo_ft_load_type1_data (void *abstract_font,
|
||||||
long offset,
|
long offset,
|
||||||
|
|
@ -2533,7 +2549,6 @@ _cairo_ft_load_type1_data (void *abstract_font,
|
||||||
cairo_status_t status = CAIRO_STATUS_SUCCESS;
|
cairo_status_t status = CAIRO_STATUS_SUCCESS;
|
||||||
unsigned long available_length;
|
unsigned long available_length;
|
||||||
unsigned long ret;
|
unsigned long ret;
|
||||||
const char *font_format;
|
|
||||||
|
|
||||||
assert (length != NULL);
|
assert (length != NULL);
|
||||||
|
|
||||||
|
|
@ -2551,11 +2566,7 @@ _cairo_ft_load_type1_data (void *abstract_font,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
font_format = FT_Get_X11_Font_Format (face);
|
if (! _ft_is_type1 (face)) {
|
||||||
if (!font_format ||
|
|
||||||
!(strcmp (font_format, "Type 1") == 0 ||
|
|
||||||
strcmp (font_format, "CFF") == 0))
|
|
||||||
{
|
|
||||||
status = CAIRO_INT_STATUS_UNSUPPORTED;
|
status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue