From 91bcdb66539b0e938221606526326136b4e6077f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 12 Aug 2026 19:04:10 -0600 Subject: [PATCH] [font] Widen scale multiplier setup Building the fixed-point font multipliers negated INT_MIN and shifted negative values. Replace both paths with a widened multiplication, which is defined across the full font-scale range. Tested with: meson test -C build --print-errorlogs Assisted-by: OpenAI Codex --- src/hb-font.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hb-font.hh b/src/hb-font.hh index c2b805a49..cc17f9437 100644 --- a/src/hb-font.hh +++ b/src/hb-font.hh @@ -1168,10 +1168,8 @@ struct hb_font_t x_multf = x_scale / upem; y_multf = y_scale / upem; - bool x_neg = x_scale < 0; - x_mult = (x_neg ? -((int64_t) -x_scale << 16) : ((int64_t) x_scale << 16)) / upem; - bool y_neg = y_scale < 0; - y_mult = (y_neg ? -((int64_t) -y_scale << 16) : ((int64_t) y_scale << 16)) / upem; + x_mult = (int64_t) x_scale * 0x10000 / upem; + y_mult = (int64_t) y_scale * 0x10000 / upem; is_synthetic = x_embolden || y_embolden || slant;