[ft] Conditionalize all COLOR code on >= 2.11.1

Fixes https://github.com/harfbuzz/harfbuzz/issues/3994
This commit is contained in:
Behdad Esfahbod 2023-01-01 13:14:04 -07:00
parent dc5179d465
commit a5f1f3a05c
2 changed files with 6 additions and 9 deletions

View File

@ -31,10 +31,6 @@
#include FT_COLOR_H
#ifndef HB_NO_PAINT
#if defined(TT_SUPPORT_COLRV1) and (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101
static hb_paint_composite_mode_t
_hb_ft_paint_composite_mode (FT_Composite_Mode mode)
@ -406,7 +402,6 @@ _hb_ft_paint (hb_ft_paint_context_t *c,
}
}
#endif
static bool
hb_ft_paint_glyph_colr (hb_font_t *font,
@ -434,7 +429,6 @@ hb_ft_paint_glyph_colr (hb_font_t *font,
if (error)
palette = NULL;
#ifdef TT_SUPPORT_COLRV1
/* COLRv1 */
FT_OpaquePaint paint = {0};
if (FT_Get_Color_Glyph_Paint (ft_face, gid,
@ -483,7 +477,6 @@ hb_ft_paint_glyph_colr (hb_font_t *font,
return true;
}
#endif
/* COLRv0 */
iterator.p = NULL;
@ -527,7 +520,5 @@ hb_ft_paint_glyph_colr (hb_font_t *font,
return false;
}
#endif
#endif /* HB_FT_COLR_HH */

View File

@ -45,7 +45,9 @@
#include FT_MULTIPLE_MASTERS_H
#include FT_OUTLINE_H
#include FT_TRUETYPE_TABLES_H
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101
#include FT_COLOR_H
#endif
/**
@ -838,6 +840,7 @@ hb_ft_draw_glyph (hb_font_t *font HB_UNUSED,
#endif
#ifndef HB_NO_PAINT
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101
#include "hb-ft-colr.hh"
@ -919,6 +922,7 @@ hb_ft_paint_glyph (hb_font_t *font,
}
}
#endif
#endif
static inline void free_static_ft_funcs ();
@ -957,7 +961,9 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ft
#endif
#ifndef HB_NO_PAINT
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101
hb_font_funcs_set_paint_glyph_func (funcs, hb_ft_paint_glyph, nullptr, nullptr);
#endif
#endif
hb_font_funcs_make_immutable (funcs);