Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 3cd312379c [ft] Drop the custom vertical-origin cache; use hb_cache_t
hb-ft's vertical-origin callback cached a full origin -- x, y, and a
load-failure flag -- in a bespoke 256-entry direct-mapped cache, because
hb_cache_t holds only a single non-negative integer.

Do what hb-ot does instead.  The vertical origin's x is half the glyph's
horizontal advance, already cached for horizontal advances, so only y
needs a cache of its own, and y fits hb_cache_t once its sign is
normalized the way hb-ot normalizes the origin.  v_origins now fills x
from hb_ft_get_glyph_h_advances() before taking the lock and caches only
y; the custom cache and its origin struct are removed.

This changes the origin's x for fonts whose FreeType vertical bearing
does not center the glyph (eg. a proportional font laid out vertically):
x was horiBearingX - vertBearingX and is now advance/2, which matches
hb-ot.  For CJK and other centered glyphs it is unchanged.

A FreeType load failure is no longer turned into a failed origin that
sent the whole run to the caller's fallback.  The glyph will not render,
so its y origin is cached as 0 and the rest of the run keeps its real
origins.

Reported by Anthropic's OSS Scanner as ordinary bug ANT-2026-Y24FNCOQ.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 11:06:28 -06:00
..
2025-04-06 18:08:50 -06:00
2026-07-30 19:02:25 -06:00
2026-09-04 14:14:49 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2020-01-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00