Skip to content

subset capi: expose configurable input sets, flags, and preprocessing - #512

Merged
behdad merged 22 commits into
mainfrom
capi/subset-input-controls
Oct 16, 2026
Merged

behdad merged 22 commits into
mainfrom
capi/subset-input-controls

Conversation

@behdad

@behdad behdad commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Extend the subset C API beyond Skia's initial glyph workflow with hr_subset_input_set, hr_subset_input_keep_everything, and hr_subset_preprocess, plus HarfBuzz aliases. Expose configurable names/languages, layout features/scripts, and dropped-table sets, along with the implemented Skera flags for legacy names, overlap bits, unknown-table passthrough, glyph names, Unicode ranges, layout closure, and bidi closure.

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.

Preserve inverted input tag sets when building Skera plans. Skera uses that representation to select existing script records efficiently; materializing all possible tags would make it enumerate billions of values. Preprocessing returns an immutable standalone face owning copied tables, without promising an acceleration cache.

Published Skera fixes its no-subset-table set internally, so modifying that set currently returns failure rather than ignoring the request. A small upstream Plan API extension is being prepared for customization and glyph mappings. Axis instancing, CFF/CFF2/VARC, and unimplemented dependency flags remain unavailable.

Validation: the original 48 differential cases and 15 additional HarfBuzz comparisons pass, including input-set defaults, keep-everything, name/layout/drop controls, all added flags, unknown tables, overlap bits, and preprocessing ownership. Rust 1.85 checking, rustfmt, and Clippy pass. The CI C smoke test now also exercises preprocessing, inverted selections, and subsequent customization.

Stacked on #511; extends #507.

behdad added 13 commits October 7, 2026 15:57
Support Skia face setup and callback-backed table enumeration. Keep collection selection separate from mutable face index metadata.

Assisted-by: OpenAI Codex
Map strided batches in public queries and shaping, with scalar/batch fallback and callback precedence through subfonts.

Assisted-by: OpenAI Codex
Keep the package version unchanged while making hb_version and HB_VERSION aliases report the matched shaping release. Add hr-hb-ot.h and generate portable include guards.

Assisted-by: OpenAI Codex
Provide Skia glyph/Unicode selection, retained IDs, notdef outlines, and hint removal through hr_subset APIs and hr-hb-subset.h. Import the core C ABI instead of embedding a second shaping library.

Assisted-by: OpenAI Codex
Add configurable name/layout/drop sets, keep-everything, and supported Skera flags. Preserve inverted tag sets and return an owned immutable preprocessing face.

Assisted-by: OpenAI Codex
Base automatically changed from capi/skia-subset to main October 16, 2026 20:14
@behdad
behdad merged commit 23d9c50 into main Oct 16, 2026
4 checks passed
@behdad
behdad deleted the capi/subset-input-controls branch October 16, 2026 20:19
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