From 5ea5aacda9d14833a66e9d9869c69eda0bb4034a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 7 Jan 2023 13:24:41 -0700 Subject: [PATCH] [ft-colr] Adjust for FreeType master color-stop change Part of https://github.com/harfbuzz/harfbuzz/issues/4013 --- src/hb-ft-colr.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hb-ft-colr.hh b/src/hb-ft-colr.hh index c7c73f59a..11a27a0ee 100644 --- a/src/hb-ft-colr.hh +++ b/src/hb-ft-colr.hh @@ -141,7 +141,12 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line, &stop, &cl->color_stop_iterator)) { - color_stops->offset = stop.stop_offset / 16384.f; + // https://github.com/harfbuzz/harfbuzz/issues/4013 + if (sizeof stop.stop_offset == 2) + color_stops->offset = stop.stop_offset / 16384.f; + else + color_stops->offset = stop.stop_offset / 65536.f; + color_stops->is_foreground = stop.color.palette_index == 0xFFFF; if (color_stops->is_foreground) color_stops->color = HB_COLOR (hb_color_get_blue (c->foreground),