Skip to content

C API: add OpenType script selection and feature queries - #521

Merged
behdad merged 3 commits into
mainfrom
capi/chromium-ot-queries
Oct 9, 2026
Merged

behdad merged 3 commits into
mainfrom
capi/chromium-ot-queries

Conversation

@behdad

@behdad behdad commented Oct 8, 2026

Copy link
Copy Markdown
Member

Chromium's small-caps probing and feature enumeration still need three OpenType queries after the earlier compatibility work landed. Add hr_ot_layout_table_select_script, hr_ot_layout_language_find_feature, and hr_ot_layout_table_get_feature_tags, with their HarfBuzz aliases, layout tag/index constants, and the deprecated MATH extender-flag spelling Chromium uses.

Script selection honors requested-tag order and the DFLT/dflt/latn fallback chain. Feature lookup returns table-wide indices and excludes the required feature; enumeration preserves duplicate feature tags and follows HarfBuzz's pagination/null-query conventions. Queries use read-fonts and support callback-created faces. Script lookup uses Rust's native binary search; no duplicate-script selection behavior is promised for invalid fonts.

Validation: 139 C API tests; 37,987 comparisons against HarfBuzz 14.5.1 across 495 font faces; workspace Clippy 1.99 with all features/targets; Rust 1.85 checking; GCC/Clang C99 linking and C++17 header checks. The differential harness skips absent or HarfBuzz-rejected layout tables, since Fontations queries readable metadata without HarfBuzz's whole-table sanitizer.

Part of #520; also addresses the remaining script/feature queries in #468.

behdad added 2 commits October 9, 2026 13:34
Regenerate C headers while preserving the new OpenType queries and deprecated MATH flag alias. Keep layout tags and sentinel indices unsigned for C++ source compatibility.
Combine OpenType query documentation and tests with the merged color, palette, axis/name, and AAT APIs. Regenerate the core and HarfBuzz compatibility headers from the combined source.
@behdad
behdad merged commit 332e0b7 into main Oct 9, 2026
3 checks passed
@behdad
behdad deleted the capi/chromium-ot-queries branch October 9, 2026 19:44
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