Repository navigation
test: exercise real Skia shaping and PDF subsetting against HarfBuzz - #546
Merged
Merged
Conversation
This was referenced Oct 16, 2026
dfrg
approved these changes
Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyisolates 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.