mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
[draw] Always slant around horizontal origin (#5638)
Fixes https://github.com/harfbuzz/harfbuzz/issues/5632
This commit is contained in:
1 parent
e8c839425b
commit
31cdb587f2
3 files changed
+16
No files matched your search
@@ -719,7 +719,13 @@ struct hb_font_t
|
||||
// Slant before embolden; produces nicer results.
|
||||
|
||||
if (slanted)
|
||||
{
|
||||
hb_position_t xo = 0, yo = 0;
|
||||
get_glyph_h_origin (glyph, &xo, &yo, false);
|
||||
outline.translate (-xo, -yo);
|
||||
outline.slant (slant_xy);
|
||||
outline.translate (xo, yo);
|
||||
}
|
||||
|
||||
if (embolden)
|
||||
{
|
||||
|
||||
@@ -84,6 +84,15 @@ void hb_outline_t::replay (hb_draw_funcs_t *pen, void *pen_data) const
|
||||
}
|
||||
}
|
||||
|
||||
void hb_outline_t::translate (float dx, float dy)
|
||||
{
|
||||
for (auto &p : points)
|
||||
{
|
||||
p.x += dx;
|
||||
p.y += dy;
|
||||
}
|
||||
}
|
||||
|
||||
void hb_outline_t::slant (float slant_xy)
|
||||
{
|
||||
for (auto &p : points)
|
||||
|
||||
@@ -69,6 +69,7 @@ struct hb_outline_t
|
||||
|
||||
HB_INTERNAL void replay (hb_draw_funcs_t *pen, void *pen_data) const;
|
||||
HB_INTERNAL float control_area () const;
|
||||
HB_INTERNAL void translate (float dx, float dy);
|
||||
HB_INTERNAL void slant (float slant_xy);
|
||||
HB_INTERNAL void embolden (float x_strength, float y_strength,
|
||||
float x_shift, float y_shift);
|
||||
|
||||
Reference in new issue
Block a user