From 5933468261edffd58c2343a3a8705d1563f07cff Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 23 Apr 2025 20:56:32 -0600 Subject: [PATCH] [shape] Only apply slant to shaping results if horizontal --- src/OT/Layout/GPOS/GPOS.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/OT/Layout/GPOS/GPOS.hh b/src/OT/Layout/GPOS/GPOS.hh index f4af98b25..ce3f74d8c 100644 --- a/src/OT/Layout/GPOS/GPOS.hh +++ b/src/OT/Layout/GPOS/GPOS.hh @@ -152,8 +152,11 @@ GPOS::position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer) for (unsigned i = 0; i < len; i++) propagate_attachment_offsets (pos, len, i, direction); - if (unlikely (font->slant)) + if (unlikely (font->slant_xy) && + HB_DIRECTION_IS_HORIZONTAL (direction)) { + /* Slanting shaping results is only supported for horizontal text, + * as it gets weird otherwise. */ for (unsigned i = 0; i < len; i++) if (unlikely (pos[i].y_offset)) pos[i].x_offset += roundf (font->slant_xy * pos[i].y_offset);