Skip to content

test: exercise real Skia shaping and PDF subsetting against HarfBuzz - #546

Merged
behdad merged 6 commits into
mainfrom
capi/released-skia-runtime
Oct 17, 2026
Merged

behdad merged 6 commits into
mainfrom
capi/released-skia-runtime

Conversation

@behdad

@behdad behdad commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Skia source-level compilation did not exercise actual shaping or PDF embedding. Add an optional Linux runtime comparison that compiles Skia's real HarfBuzz shaper and PDF subsetter against HarfBuzz and the subset-enabled HarfRust C library, then checks eight cases across three fonts, stream/table-callback paths, and a nondefault variable instance.

Each case covers four font sizes/horizontal scales, glyph IDs and clusters, positions, both glyph-0 policies, retained GIDs, hints, PDF font embedding, text extraction, and rasterization. An optional third executable verifies the proposed UPEM-setter removal against Skia's original HarfBuzz source. The proxy keeps stream access disabled for shaping/direct subsets and supplies the full stream needed by PDF font-descriptor creation while still forcing the PDF subsetter's table callbacks.

Validation: all eight cases complete with the explicit known-variation exception enabled. All structural/subset checks pass. Six HarfRust PDFs match HarfBuzz pixel-for-pixel. The two nondefault Linefont cases have approximately 0.00024 pixels of positioning drift and 70 changed rendered pixels each; strict pixel comparison fails by default and the opt-in flag reports the differences. UPEM removal matches original HarfBuzz positions and PDF pixels in all eight cases. This test does not claim complete variable positioning parity. #517 tracks the mismatch; repro_variable_gpos.py isolates it without Skia, FreeType, or subsetting, with matching normalized coordinates and a zero-advance custom sub-font.

The runner requires matching GN-built Skia libraries and Poppler, so it remains an optional integration check rather than rebuilding Skia in every HR CI job. No shaping/subsetting implementation changes.

Based on main after #545 landed; follows #507. Uses the published Skera 0.8 subset API and can land before the extended subset APIs in #547. The remaining merge order is #546 → #519 → #547; only #547 waits for a Skera release.

Replaces #516; the earlier PR retains its review history.

Base automatically changed from capi/released-subset-ci to main October 17, 2026 17:35
@behdad
behdad merged commit 99d9cf9 into main Oct 17, 2026
5 checks passed
@behdad
behdad deleted the capi/released-skia-runtime branch October 17, 2026 17:41
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.

2 participants