Keep BaseCoord format 4 behind HB_NO_BEYOND_64K, matching the other
24-bit Layout formats.
Add API coverage for reading a format 4 baseline coordinate.
Assisted-by: OpenAI Codex
During variation instancing, outline subsetting populates the metrics,
bounds, and maxp data used by dependent tables. Make both lowercase and
uppercase dependent tables wait for either pending outline table.
Add coverage for independently pairing lowercase outlines with uppercase
horizontal metrics.
Assisted-by: OpenAI Codex
Generate a GLYF and LOCA pair containing an outline only for glyph
0x10001. Verify the outline can be read and is remapped correctly
during subsetting.
Assisted-by: OpenAI Codex
Exercise PaintGlyph2 and VORG version 2 using glyph IDs above 65535,
including remapping during subsetting. Ignore both extended formats in
HB_NO_BEYOND_64K builds.
Assisted-by: OpenAI Codex
Leave head generation to GLYF when it is being subset, matching the
existing glyf handling. Drop GVAR when all variation axes are pinned,
matching gvar.
Add regression coverage for both cases.
Assisted-by: OpenAI Codex
Move SmallTypes, MediumTypes, and the dual table accelerator
helpers into hb-ot-dual.hh. Keep Layout cache aliases in Layout
common and update standalone users to include the shared header.
Testing: meson test -C build
Assisted-by: OpenAI Codex
Maintain the encoded ClassDef glyph set and range count as classes
are added instead of reconstructing them for every size estimate.
This avoids quadratic PairPos splitting on large class definitions.
Assisted-by: OpenAI Codex
Use tableDirectoryOffsets2 for TTC header versions 1.1 and 2.1.
Keep older builds on the legacy directory list.
Validate only the selected directory list.
Assisted-by: OpenAI Codex
Template the variation-selector structures by glyph-ID width.
Add format 15 lookup, collection, sanitization, and closure.
Add format 15 subsetting.
Prefer format 15 when both variation-selector formats are present.
Assisted-by: OpenAI Codex
Pass the selected outline-table kind explicitly through composite
parsing and subsetting so the extended component flag remains reserved
in lowercase glyf.
Assisted-by: OpenAI Codex
When the uppercase GVAR table has data, initialize the lowercase gvar
accelerator from the empty face. This keeps direct member lifetime while
avoiding a real fallback table load that will never be used.
Return a null gvar scalar cache when neither accelerator has data,
matching the no-variation path that callers already handle.
Tested with meson test -C build.
Assisted-by: OpenAI Codex
The gvar facade only needs to pick between concrete table
accelerators. Embed the lowercase and uppercase accelerators directly
instead of allocating the selected implementation by hand.
This removes the extra allocation failure path and lifetime helpers,
while preserving the GVAR-first fallback order.
Tested with meson test -C build.
Assisted-by: OpenAI Codex
Expose only face->table.gvar to clients and let its accelerator
prefer GVAR before falling back to gvar. Keep the concrete table
types for tagged parsing and subsetting, while removing the
separate GVAR face-table slot from callers.
The facade owns the selected concrete accelerator so GVAR still
uses MediumTypes and gvar still uses SmallTypes.
Tested with meson test -C build and local subset-fuzzer target
builds.
Assisted-by: OpenAI Codex
The fuzzer build links static objects with C++11 and odr-used the
static constexpr glyph_count_max member through hb_min references,
requiring an out-of-class definition. Make it a constexpr helper
function instead so no storage definition is needed.
Tested with meson test -C build and local subset-fuzzer target builds.
Assisted-by: OpenAI Codex
The maxp/MAXP facade now carries the only recursion guard that was
needed for face glyph-count loading. The remaining face-table entries
do not need the core table sanitizer special case, so list them with
the regular table macro and drop the extra lazy-loader template
parameter.
Tested with meson test -C build and a no-beyond64k fuzzer target build.
Assisted-by: OpenAI Codex
Expose only face->table.maxp to clients and let its accelerator
choose MAXP before falling back to maxp. This keeps the uppercase
table as a tagged concrete type for subsetting while avoiding a second
client-facing face-table slot.
Use a sanitizer context with num_glyphs set to zero, matching core
table loading, so reading maxp/MAXP does not recurse back through
hb_face_t::get_num_glyphs().
Tested with meson test -C build and a no-beyond64k fuzzer target build.
Assisted-by: OpenAI Codex
Chained context format 5 widens the rule-set offsets, but its
rule-set count remains uint16. Likewise, the coverage-array counts in
the shared chained coverage-context body remain uint16 while the
coverage offsets can widen.
Use Array16Of with Types-sized offset entries for those fields.
Tested with: ninja -Cbuild
Tested with: meson test -C build --suite subset
Tested with: meson test -C build --suite shape
Tested with: meson test -C build
Assisted-by: OpenAI Codex
ReverseChainSingleSubst format 2 widens the coverage offsets and
substitute glyph IDs, but the backtrack and lookahead coverage-array
counts remain uint16. Keep both arrays with 16-bit counts while using
the selected Types offset width for their entries.
Tested with: ninja -Cbuild
Tested with: meson test -C build --suite subset
Tested with: meson test -C build --suite shape
Tested with: meson test -C build
Assisted-by: OpenAI Codex
GVAR uses the same structure as gvar, but its glyphCount field is
uint24. Keep the shared gvar_GVAR body typed by the OpenType size
family, use that field width when serializing glyphCount, and route
uppercase GVAR through the subsetter.
Tested with: ninja -Cbuild
Tested with: meson test -C build --suite subset
Tested with: meson test -C build
Assisted-by: OpenAI Codex
Rename the templated maxp/MAXP shared body to maxp_MAXP to match the
existing gvar_GVAR naming pattern.
Tested with: meson test -C build
Assisted-by: OpenAI Codex
The VORG tag is unchanged, but version 2 widens both
numVertOriginYMetrics and VertOriginYMetrics.glyphIndex to uint24.
Template the VORG body over the OpenType size family and keep the
public VORG type as a version-dispatch wrapper.
Subsetting preserves the source VORG major version, so version 1 stays
16-bit and version 2 stays 24-bit.
Tested with: meson test -C build --suite subset
Tested with: meson test -C build in-house test-ot-extents-cff
Tested with: meson test -C build
Assisted-by: OpenAI Codex
Templatize the existing maxp implementation over the OpenType size
family and add MAXP as the 24-bit numGlyphs variant. Prefer MAXP when
loading the face glyph count, expose it through the face table list, and
keep MAXP as MAXP during subsetting.
The earlier order-sensitive failure reproduced only with libharfbuzz and
libharfbuzz-subset built against different lazy-loader table orders.
After rebuilding both libraries with MAXP next to maxp, the reproducer
and full suite pass.
Tested with: meson test -C build --suite subset
Tested with: meson test -C build
Assisted-by: OpenAI Codex
Drop the hmtx/vmtx paths that encoded and read synthetic advance data past the 16-bit glyph range. Keep the existing count bookkeeping and use the same behavior as the HB_NO_BEYOND_64K path for glyphs beyond the normal metrics data.
Tested with: meson test -C build
Assisted-by: OpenAI Codex
Use maxp as the face-wide glyph count source and remove the old beyond-64k fallback that inferred glyph count from the loca table length. The glyf accelerator still keeps its own loca-derived bounds separately.
Tested with: meson test -C build
Assisted-by: OpenAI Codex
The beyond-64k spec adds COLR PaintGlyph2 format 33, matching
PaintGlyph format 10 but using a 24-bit glyph ID.
Template PaintGlyph over the glyph ID type and dispatch format 33
through the existing sanitize, subset, closure, and paint paths.
Testing: meson test -C build test-ot-color test-paint test-subset-colr
Testing: meson test -C build --suite subset
Testing: meson test -C build
Assisted-by: OpenAI Codex
The repacker graph sanitizer accepted non-v1 GSUB/GPOS roots
because GSUBGPOS::get_size() returns only the version field size
for unsupported major versions. Graph specialization then still
consulted the numeric version and could read the v1.2 lookupList2
field from a too-small fuzz object.
Require version major 1 before using GSUB/GPOS graph-specific
lookup discovery.
Testing: meson test -C build test-repacker test-classdef-graph
Testing: meson test -C build --suite subset
Testing: meson test -C build
Assisted-by: OpenAI Codex
GDEF subsetting started by allocating only the base v1.0 header
and then tried to extend the final v1.4 tail field directly.
That jumps over the intervening v1.4 offsets and can trip the
serializer head assertion under CIFuzz.
Keep the existing incremental allocation for v1.2/v1.3 so GDEF
downgrade snapshots can still trim those tails, but allocate the
full version-dependent header before writing v1.4 offsets.
Testing: meson test -C build --suite subset
Testing: meson test -C build
Assisted-by: OpenAI Codex
GSUB/GPOS v1.2 subsetting allocates the full version-dependent
header before writing the 32-bit list offsets. That already includes
the v1.1 featureVars field.
Avoid extending featureVars a second time after child list serialization
has advanced the serializer head, which can assert under CIFuzz.
Testing: meson test -C build --suite subset
Testing: meson test -C build
Assisted-by: OpenAI Codex
GSUB/GPOS subsetting started by allocating only the base v1.0
header, then jumped directly to lookupList2 for v1.2 tables. That
can pass a pointer beyond the serializer head to extend_min(), which
asserts under fuzzing.
Keep the old incremental allocation for v1.0/v1.1 tables so feature
variation downgrade snapshots can still trim the tail, but allocate
the full version-dependent header before writing v1.2 offsets.
Testing: meson test -C build --suite subset
Testing: meson test -C build
Assisted-by: OpenAI Codex
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
Coverage and ClassDef serialization use one pass over the input to
choose the compact format, then a second pass to write the selected
format. Reusing the same iterator for both passes left some iterator
types exhausted, which surfaced in test-classdef-graph for high glyph
IDs after the 24-bit forms were added.
Take a fresh iterator view for the sizing pass and another for the
actual serialization.
Testing: meson test -C build
Assisted-by: OpenAI Codex
MarkBasePos, MarkLigPos, and MarkMarkPos format 2 use nested
MarkArray2, BaseArray2, LigatureArray2, and Mark2Array2 tables
with 24-bit counts and offsets in different combinations.
Template the shared mark records and anchor matrices so format 1
continues to use SmallTypes while format 2 uses the widths specified
for the beyond-64k layout forms. Keep the subset graph wrappers bound
to their existing 16-bit forms.
Testing: meson test -C build
Assisted-by: OpenAI Codex
LookupOffsetList is parameterized by offset width, but its sanitizer
called the 16-bit offset-list base explicitly. Dispatch through the
actual List16OfOffsetTo base so 32-bit lookup-list views use the right
offset element type.
Tested with: meson test -C build
Assisted-by: OpenAI Codex
MarkMarkPos subsetting can drop empty Mark2 rows after filtering the
original coverage. Serialize the Mark2Array row count from the kept
coverage instead of the original candidate iterator length.
Tested with: meson test -C build --suite subset
Tested with: meson test -C build
Assisted-by: OpenAI Codex
Move the repeated typed offset casts in GSUBGPOS sanitize and subset
paths behind local accessors. The table fields keep their existing
reader-facing types, while lookup and feature subsetting can ask for
the specialized list views they need.
Tested with: meson test -C build
Assisted-by: OpenAI Codex
Update graph splitter comments to document that 24-bit layout formats
are intentionally left unsplit because their relevant offsets are
already widened.
Testing: not run; comment-only change.
Assisted-by: OpenAI Codex
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
Template the graph Coverage sanitizers on the layout type width and
dispatch formats 3 and 4 through the MediumTypes variants. This lets
graph sanitization accept 24-bit Coverage tables instead of rejecting
those formats outright.
Testing: meson test -C build
Assisted-by: OpenAI Codex
Template the graph ClassDef format wrappers on the layout type width
and dispatch formats 3 and 4 through the MediumTypes variants. This
lets graph sanitization accept 24-bit ClassDef tables instead of
rejecting those formats outright.
Testing: meson test -C build
Assisted-by: OpenAI Codex
Select ClassDef formats 3 and 4 by updating the local format value
before storing it in the serialized table. The previous code adjusted
the union format field before overwriting it, so 24-bit glyph IDs could
still serialize as format 1 or 2.
Use the Types integer width for format 1/3 class values and preserve
the matching format tag for empty ClassDef tables.
Testing: meson test -C build
Assisted-by: OpenAI Codex