From e377888990239dc6d108777c1be61a99bade6e01 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 Jan 2023 13:26:47 -0700 Subject: [PATCH] [ft-colr] Conditionalize on (unreleased0 FreeType 2.13.0 That's the version that the color API is called stable, and includes changes that we rely on. --- src/hb-ft.cc | 6 +++--- test/api/test-paint.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 92da7e09e..efa3a8eaa 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -45,7 +45,7 @@ #include FT_MULTIPLE_MASTERS_H #include FT_OUTLINE_H #include FT_TRUETYPE_TABLES_H -#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101 +#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300 #include FT_COLOR_H #endif @@ -851,7 +851,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 +#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300 #include "hb-ft-colr.hh" @@ -972,7 +972,7 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t= 21101 +#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300 hb_font_funcs_set_paint_glyph_func (funcs, hb_ft_paint_glyph, nullptr, nullptr); #endif #endif diff --git a/test/api/test-paint.c b/test/api/test-paint.c index 480f8bf83..2a73c2d14 100644 --- a/test/api/test-paint.c +++ b/test/api/test-paint.c @@ -30,18 +30,18 @@ #ifdef HB_HAS_FREETYPE #include -#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101 +#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300 #include FT_COLOR_H #endif static inline hb_bool_t have_ft_colrv1 (void) { -#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21101 - // https://github.com/harfbuzz/harfbuzz/issues/4013 - return sizeof (FT_ColorStop) == 2 * sizeof (FT_Fixed); -#endif +#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300 + return TRUE; +#else return FALSE; +#endif } #endif