Skip to content

subset capi: expose plans, mappings, metadata, and C++ ownership - #547

Draft
behdad wants to merge 4 commits into
mainfrom
capi/subset-plan-extensions
Draft

behdad wants to merge 4 commits into
mainfrom
capi/subset-plan-extensions

Conversation

@behdad

@behdad behdad commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Requires a Skera release containing the public Plan APIs from googlefonts/fontations#2234 . Keep this PR in draft until that release is available and replace the temporary Skera/write-fonts Git pins before merging.

Add HarfBuzz-compatible subset plan creation/reference/destruction/execution, original-to-subset and reverse glyph maps, Unicode-to-original maps, and user data on inputs and plans. Plans snapshot source tables and input settings, support repeated/concurrent execution, and return borrowed core hr_map_t handles that may be retained independently. Metadata replacement/destruction invokes release callbacks outside the lock for reentrancy. Custom no-subset-table selections pass through unchanged, with explicit drops and hint removal taking precedence.

Extend hr-hb-cplusplus.hh with subset input and plan ownership helpers, including both header include orders. Extend Linux CI with the 16 plan/map comparisons, bringing the total to 79, and exercise plan execution/mapping queries in the C example.

These APIs are part of the optional subset feature of harfrust_capi; enable it with cargo build -p harfrust_capi --features subset and link the single harfrust_c library. Headers, examples, and tests live under harfrust_capi.

Validation: all 79 differential subset cases pass, including plan snapshots, mappings, concurrent execution, retained map lifetimes, metadata rejection/replacement/reentry/destruction, and table passthrough/drop precedence. GCC/Clang C99 shared/static and C++11/C++17 ownership consumers pass. Generated headers remain synchronized.

Stacked on #519. Merge order: #544 → #545 → #546 → #519 → #547. The first four PRs use published dependencies and can merge while this PR waits for Skera. Axis instancing, user-specified glyph mapping, and CFF/CFF2/VARC support remain separate work.

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

@behdad
behdad changed the base branch from capi/released-skia-runtime to capi/skrifa-draw-paint October 16, 2026 21:19
Base automatically changed from capi/skrifa-draw-paint to main October 17, 2026 17:42
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