From 9aa6279a2d64ab8057b0d7acbcc77044442c6d0e Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 27 Oct 2018 14:24:58 +0330 Subject: [PATCH] [ot-color/png] Try to get image blob from sbix first options.aat is set --- src/hb-ot-color.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-color.cc b/src/hb-ot-color.cc index 84035069..a2b75383 100644 --- a/src/hb-ot-color.cc +++ b/src/hb-ot-color.cc @@ -310,15 +310,21 @@ hb_ot_color_glyph_reference_blob_png (hb_font_t *font, unsigned int *strike_x_ppem /* OUT */, unsigned int *strike_y_ppem /* OUT */) { - if (_get_cbdt (font->face).has_data ()) - return _get_cbdt (font->face).reference_blob_for_glyph (glyph, font->x_ppem, font->y_ppem, + hb_blob_t *blob = hb_blob_get_empty (); + /* don't run cbdt first if aat is set */ + if (!hb_options ().aat && _get_cbdt (font->face).has_data ()) + blob = _get_cbdt (font->face).reference_blob_for_glyph (glyph, font->x_ppem, font->y_ppem, strike_x_ppem, strike_y_ppem); - if (_get_sbix (font->face).has_data ()) - return _get_sbix (font->face).reference_blob_for_glyph (glyph, font->ptem, + if (_get_sbix (font->face).has_data () && !hb_blob_get_length (blob)) + blob = _get_sbix (font->face).reference_blob_for_glyph (glyph, font->ptem, MAX (font->x_ppem, font->y_ppem), HB_TAG('p','n','g',' '), strike_x_ppem, strike_y_ppem); - return hb_blob_get_empty (); + if (hb_options ().aat && _get_cbdt (font->face).has_data () && !hb_blob_get_length (blob)) + blob = _get_cbdt (font->face).reference_blob_for_glyph (glyph, font->x_ppem, font->y_ppem, + strike_x_ppem, strike_y_ppem); + + return blob; } -- GitLab