mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 15:01:01 +01:00
[font] Saturate fallback origin conversion
Bulk origin fallback converts between horizontal and vertical origins by adding advances and ascenders. Saturate those temporary position updates before applying them to the buffer. This is part of the complete position-overflow fix for issue #6151. Testing: meson test -C build --print-errorlogs Assisted-by: Codex <codex@openai.com>
This commit is contained in:
1 parent
5528a71752
commit
eb4e60290f
1 file changed
+4
-4
+4
-4
@@ -905,8 +905,8 @@ struct hb_font_t
|
||||
for (unsigned j = 0; j < n; j++)
|
||||
{
|
||||
hb_codepoint_t glyph = buf->info[offset + j].codepoint;
|
||||
origins[j].x -= get_glyph_h_advance (glyph) / 2;
|
||||
origins[j].y -= ascender;
|
||||
origins[j].x = hb_saturate_sub (origins[j].x, get_glyph_h_advance (glyph) / 2);
|
||||
origins[j].y = hb_saturate_sub (origins[j].y, ascender);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -969,8 +969,8 @@ struct hb_font_t
|
||||
for (unsigned j = 0; j < n; j++)
|
||||
{
|
||||
hb_codepoint_t glyph = buf->info[offset + j].codepoint;
|
||||
origins[j].x += get_glyph_h_advance (glyph) / 2;
|
||||
origins[j].y += ascender;
|
||||
origins[j].x = hb_saturate_add (origins[j].x, get_glyph_h_advance (glyph) / 2);
|
||||
origins[j].y = hb_saturate_add (origins[j].y, ascender);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user