Use Skrifa's bitmap-strike API to provide glyph extents and paint PNG
and BGRA images from CBDT and sbix tables. Select strikes using the
font's requested ppem and preserve the OT backend's table precedence.
Keep the face blob alive through image blobs retained by paint
callbacks.
Tests: meson test -C build --no-rebuild
Assisted-by: OpenAI Codex <codex@openai.com>
Skrifa exposes resolved COLRv1 clip boxes independently of outline
glyph metrics. Use them when present so glyph extents report the clip
bounds instead of falling back to painted-content bounds.
Keep the existing paint fallback for color glyphs without a clip box.
Assisted-by: OpenAI Codex <codex@openai.com>
The RuleSet fast paths filtered out rules requiring another glyph when
the skipping iterator reached the end of the buffer. Unlike the normal
rule walk, that early return did not record the resulting
unsafe-to-concat range.
Keep the end-of-input optimization, but track filtered rules and mark
their concat hazard before returning. Cover both contextual and chained
contextual rule sets with a five-rule font that forces the fast paths.
Assisted-by: OpenAI Codex <codex@openai.com>
A zero-valued PairPos record can select a different, non-zero record
if the second glyph changes, so keep the pair unsafe to concat even
when no positioning was applied.
Likewise, make the ligature second-glyph digest rejection report the
same hazard as the full ligature walk.
Tests: meson test -C build
Port of https://github.com/harfbuzz/harfrust/pull/465
Assisted-by: OpenAI Codex <codex@openai.com>
Replace the singular named font and text options with repeated
positional FONTFILE TEXTFILE pairs. Register every supplied pair and
reject incomplete input so no requested benchmark is silently omitted.
Tested with the full Meson suite and an unfiltered two-pair run.
Assisted-by: Codex <codex@openai.com>
The --variations option previously parsed its entire argument as one
hb_variation_t, so only one axis could be selected. Parse the
comma-separated argument into an array and apply all valid axes.
Tested with the full Meson suite and a two-axis benchmark-shape run.
Assisted-by: Codex <codex@openai.com>
Build a compact class digest for every format-2 contextual RuleSet in
the subtable's existing external cache. Reject a RuleSet before walking
its rules when the next input glyph cannot match any rule's first class.
Rules without another input position force the digest open. Digest
collisions only cause the normal rule walk, and allocation failure falls
back to the uncached path.
Assisted-by: Codex <codex@openai.com>
Add a 100,000-character Japanese shaping corpus derived from Natsume
Soseki's copyright-expired Wagahai wa Neko de Aru. Split the sample
into pure Han, Hiragana, and Katakana runs, with Inherited characters
allowed within a run and Common characters omitted.
Document the Aozora Bunko source, reuse terms, source checksum, and
transformations in perf/texts/COPYING.
Testing: meson test -C build (274 tests passed)
Assisted-by: OpenAI Codex
U+180F MONGOLIAN FREE VARIATION SELECTOR FOUR was added in Unicode
14.0 and has Default_Ignorable_Code_Point=Yes, but
is_default_ignorable() only covered U+180B..180E, so FVS4 was never
hidden and leaked a .notdef into the output.
8c65442069 ("[Unicode 14] Handle U+180F FVS4") added the U+180F case
to _hb_glyph_info_set_unicode_props() and to the Arabic shaper, but
that branch sits inside "if (unicode->is_default_ignorable (u))", so
it has been unreachable since it was written. Extending the range to
U+180B..180F makes it live.
U+180B..180F are all Default_Ignorable_Code_Point per
DerivedCoreProperties.txt, so the range stays contiguous.
Before, with a font with no Mongolian coverage:
$ hb-shape Roboto-Regular.abc.ttf -u U+0061,U+180F
[1=0+1114|0=0@-908,0+0]
Every other default ignorable (U+180B..180E, U+FE00, U+200B) on that
font shapes to [1=0+1114]. After the change U+180F matches them.
Added two cases to mongolian-variation-selector.tests, which already
covered FVS1, FVS2, FVS3 and MVS but not FVS4: U+180F, and U+1810
MONGOLIAN DIGIT ZERO to pin the top of the range so it cannot be
widened by accident.
Tested with "meson test -C build": 254/254 OK, 0 failures. Restoring
the old U+180B..180E fails in-house 6174/6176, and widening it to
U+180B..1810 fails the same way.
Assisted-by: claude-opus-5
Co-authored-by: Dylan Pulver <dylanpulver@users.noreply.github.com>
Error handling in repacker is in rough shape. Many of the methods are fallible, but often the return values aren't being checked for error state.
To help address this I thought it might be useful to introduce a result type similar to Result<> in rust (or std::expected) that would force callers to deal with errors in the returns.
This PR introduces hb_result_t<OkVal, ErrVal>.
Assisted by: Gemini
FreeType requires face creation and destruction on a shared
FT_Library to be serialized. Protect the lazily-created static library,
its reference count, and its internally-owned faces with a lazy mutex.
Keep caller-owned FT_Library instances outside the new lock, and add a
multithreaded regression test for blob-backed faces and font funcs.
Tests: meson test -C build (272/272 passed)
Fixes: https://github.com/harfbuzz/harfbuzz/issues/6224
Assisted-by: OpenAI Codex <codex@openai.com>