[ot-font] Fix emboldening CFF

This commit is contained in:
Behdad Esfahbod 2023-02-01 17:06:15 -07:00
parent 6b3fe8ac1b
commit 36dcc9a432
1 changed files with 7 additions and 5 deletions

View File

@ -467,13 +467,15 @@ hb_ot_draw_glyph (hb_font_t *font,
hb_outline_t outline; hb_outline_t outline;
auto *pen = hb_outline_recording_pen_get_funcs (); auto *pen = hb_outline_recording_pen_get_funcs ();
hb_draw_session_t draw_session (pen, &outline, font->slant_xy); { // Need draw_session to be destructed before emboldening.
if (!font->face->table.glyf->get_path (font, glyph, draw_session)) hb_draw_session_t draw_session (pen, &outline, font->slant_xy);
if (!font->face->table.glyf->get_path (font, glyph, draw_session))
#ifndef HB_NO_CFF #ifndef HB_NO_CFF
if (!font->face->table.cff1->get_path (font, glyph, draw_session)) if (!font->face->table.cff1->get_path (font, glyph, draw_session))
if (!font->face->table.cff2->get_path (font, glyph, draw_session)) if (!font->face->table.cff2->get_path (font, glyph, draw_session))
#endif #endif
{} {}
}
outline.embolden (font->x_shift, font->y_shift); outline.embolden (font->x_shift, font->y_shift);
outline.replay (draw_funcs, draw_data); outline.replay (draw_funcs, draw_data);