From 9194e13e25563f7170c68b0126f5852925c526ff Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Dec 2022 07:31:16 -0700 Subject: [PATCH] [font] Apply slant to glyph extents Fixes https://github.com/harfbuzz/harfbuzz/issues/3952 hb-ft not fixed since doesn't use this code. --- src/hb-font.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-font.hh b/src/hb-font.hh index 4e4a98766..08f9c5c4f 100644 --- a/src/hb-font.hh +++ b/src/hb-font.hh @@ -185,6 +185,10 @@ struct hb_font_t extents->y_bearing = em_scale_x (extents->y_bearing); extents->width = em_scale_x (extents->width); extents->height = em_scale_x (extents->height); + + /* Apply slant. */ + extents->x_bearing += roundf (extents->y_bearing * slant_xy); + extents->width += roundf (extents->height * slant_xy); }