From f3985d948279c00518d5f3dea925a71a8e2be23f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Dec 2022 10:11:28 -0700 Subject: [PATCH] [paint] Fix drawing non-color glyphs --- src/OT/glyf/glyf.hh | 6 +----- src/hb-ot-cff1-table.cc | 6 +----- src/hb-ot-cff2-table.cc | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index 0923814d0..58af9ead5 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -335,15 +335,11 @@ struct glyf_accelerator_t bool paint_glyph (hb_font_t *font, hb_codepoint_t gid, hb_paint_funcs_t *funcs, void *data, hb_color_t foreground) const { - funcs->push_root_transform (data, font); - funcs->push_clip_glyph (data, gid, font); funcs->color (data, true, foreground); funcs->pop_clip (data); - funcs->pop_root_transform (data); - - return false; + return true; } const glyf_impl::Glyph diff --git a/src/hb-ot-cff1-table.cc b/src/hb-ot-cff1-table.cc index da403c366..5040c7462 100644 --- a/src/hb-ot-cff1-table.cc +++ b/src/hb-ot-cff1-table.cc @@ -555,15 +555,11 @@ bool _get_path (const OT::cff1::accelerator_t *cff, hb_font_t *font, hb_codepoin bool OT::cff1::accelerator_t::paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data, hb_color_t foreground) const { - funcs->push_root_transform (data, font); - funcs->push_clip_glyph (data, glyph, font); funcs->color (data, true, foreground); funcs->pop_clip (data); - funcs->pop_root_transform (data); - - return false; + return true; } bool OT::cff1::accelerator_t::get_path (hb_font_t *font, hb_codepoint_t glyph, hb_draw_session_t &draw_session) const diff --git a/src/hb-ot-cff2-table.cc b/src/hb-ot-cff2-table.cc index 6fb43cf63..795556555 100644 --- a/src/hb-ot-cff2-table.cc +++ b/src/hb-ot-cff2-table.cc @@ -145,15 +145,11 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font, bool OT::cff2::accelerator_t::paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data, hb_color_t foreground) const { - funcs->push_root_transform (data, font); - funcs->push_clip_glyph (data, glyph, font); funcs->color (data, true, foreground); funcs->pop_clip (data); - funcs->pop_root_transform (data); - - return false; + return true; } struct cff2_path_param_t