Commit Graph
15 Commits
Author SHA1 Message Date
Behdad Esfahbod d2e218ac26 [layout] Use 24-bit ClassDef format 3 values
ClassDef format 3 stores startGlyphID, glyphCount, and each class value
as uint24.  Use the medium integer type for the class array, select a
serializable format based on both glyph and class ranges, and keep the
subsetter size estimator in sync.

Test parsing and querying a class value above 65535, and test that the
serializer and size estimator select the matching format.

Testing: meson test -C build

Assisted-by: OpenAI Codex
2026-10-01 13:29:55 -06:00
Behdad Esfahbod 17af97aae4 Merge remote-tracking branch 'origin/main' into beyond-64k
Reconcile the beyond-64K table type changes with the dependency API,
graph result handling, and variation-budget updates from main. Preserve
the branch's wider table variants while adopting the new behavior.

Build and test with Meson (281 passed, 1 skipped).

Assisted-by: OpenAI Codex <noreply@openai.com>
2026-10-01 12:59:54 -06:00
Garret Rieger 2f291a46ae Convert repacker and graph code to utilize to hb_result_t.
Converts all error handling in the repacker/graph code to use hb_result_t.
2026-09-04 17:08:08 -06:00
Behdad Esfahbod 336d65cdab [graph] Guard beyond-64k classdef graph tests
The default build has HB_NO_BEYOND_64K enabled, so serializers reject
glyph IDs above 0xffff with an integer-overflow error. Keep the high
glyph ClassDef size checks for beyond-64k builds only.

Testing: meson test -C build

Assisted-by: OpenAI Codex
2026-06-05 12:34:52 +02:00
Behdad Esfahbod 8a7a5e9baa [graph] Account for 24-bit ClassDef size estimates
Update the ClassDef and Coverage size estimator used by graph
splitting to derive glyph and range widths from the included glyphs
instead of assuming 16-bit table formats. Keep ClassDef size selection
aligned with the serializer heuristic, including class breaks and the
fact that class zero is not encoded in ClassDef tables.

Add high-glyph test cases that compare the estimator against actual
24-bit ClassDef and Coverage serialization sizes.

Testing: meson test -C build

Assisted-by: OpenAI Codex
2026-06-05 12:34:51 +02:00
Behdad Esfahbod 75f919876f [src/test-*] Use hb_always_assert() which isn't compiled out under NDEBUG
Part of https://github.com/harfbuzz/harfbuzz/issues/5418
2025-07-25 03:00:38 -06:00
Behdad Esfahbod 2dc0b070e8 [test] Mark a couple functions as unused
Under NDEBUG.
2025-07-25 02:28:44 -06:00
Garret Rieger 025f52769f [repacker] fix mem leak in test-classdef-graph test. 2024-03-09 00:32:36 +00:00
Garret Rieger 17b37f10d5 [repacker] add classdef size est. test that you can add the same class multiple times. 2024-03-08 22:01:05 +00:00
Garret Rieger 0ac9e7da39 [repacker] in classdef estimator tests compare results to actual class def serialization.
Fix the estimator to actually match real serialization sizes.
2024-03-08 21:53:10 +00:00
Garret Rieger 8129b21dea Update classdef size estimator to pick the min coverage format.
Previously this just assumed a worst case format 1.
2024-03-08 20:15:43 +00:00
Garret Rieger 252a926fbf [repacker] Rework how ClassDef sizes are estimated during splitting.
The old approach considered only one class at a time, which in some cases can generate the wrong answer. This change updates the estimation to consider how all classes in the current split would end up encoded in a single ClassDef table. Additionally compute whether glyphs are consecutive only for the current split (instead of the fully mapping).
2024-03-08 19:46:48 +00:00
Behdad Esfahbod ca27925d55 Use hb_codepoint_pair_t in more places 2023-06-03 16:18:15 -06:00
Garret Rieger 0e48a65d32 [repacker] estimate size of classDef1 and coverage during PairPos2 split point analysis. 2022-08-05 20:19:11 +00:00
Garret Rieger 2264df6da3 [repacker] add utility that can calculate the size of Coverage+ClassDef via incremental class inclusion. 2022-08-05 18:33:03 +00:00