Skip to content

[write-fonts] Preserve unused trailing PairPos class matrix slots - #2339

Closed
behdad wants to merge 18 commits into
skera-review-variation-widthfrom
write-fonts-review-pairpos-matrix
Closed

behdad wants to merge 18 commits into
skera-review-variation-widthfrom
write-fonts-review-pairpos-matrix

Conversation

@behdad

@behdad behdad commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Converting a valid PairPos format 2 table to an owned table and writing it back failed when its matrix contained unused trailing classes. The writer derived dimensions from the ClassDefs, whose maximum class gives only the minimum required dimensions.

Use the existing matrix dimensions, validate class IDs and uniform row widths, and infer minimum dimensions for omitted zero-byte records. The regression reads, owns and writes a 2x2 matrix whose ClassDefs use only class zero, preserving its trailing values. Additional checks cover uneven rows, classes outside the matrix, and zero-byte fallback dimensions.

Validation: all 332 write-fonts unit and documentation tests passed.

Found while auditing #2263; this is separate from the mark-anchor class-width fix already included there.

Depends on #2338.

Validation of the combined fixes: 1,199 Skera, Skrifa and write-fonts tests passed with Rust 1.89 and the Skera CLI enabled; 8 existing tests were ignored. Clippy with all targets/features, formatting and diff checks passed.

@behdad
behdad force-pushed the write-fonts-review-pairpos-matrix branch from 6012cd6 to 6484c7f Compare October 14, 2026 23:11
Propagate reviewed fixes and repaired ancestry through #2339.

Assisted-by: OpenAI Codex
@behdad

behdad commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

The PairPos matrix fix and its regression test have moved into #2263 as part of reviewing that earlier class-matrix boundary. After the stack repair, this PR has no remaining tree changes against #2338; it is now redundant. The downstream #2340 branch contains both histories, so retaining this node does not lose any changes.

This tree is unchanged; the replacement evaluator already handles missing
variation rows. Preserve the repaired parent ancestry.

Assisted-by: OpenAI Codex
Preserve reviewed parent ancestry and each PR's existing feature changes.

Assisted-by: OpenAI Codex
Preserve the independently validated TrueType changes and all feature code.

Assisted-by: OpenAI Codex
Keep empty record counts and allocation bounds at each PR boundary.

Assisted-by: OpenAI Codex
Move the existing #2338 correction into the width-reduction PR.

Assisted-by: OpenAI Codex
Reject unsupported versions and oversized arrays before ownership.
Keep current HarfBuzz references with complete feature parameters.

Assisted-by: OpenAI Codex
Preserve zero float32 products and reject subnormal condition pinning.

Assisted-by: OpenAI Codex
Bound pairwise work after deduplication, avoid temporary pair vectors,
and keep the corrected HarfBuzz column order at introduction.

Assisted-by: OpenAI Codex
@behdad

behdad commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the rebuilt, consolidated instancing stack in #2416–#2423. MATH and name-table overrides remain separately covered by #2415 and #2411.

@behdad behdad closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant