Repository navigation
C API: add OpenType script selection and feature queries - #521
Merged
Merged
Conversation
This was referenced Oct 8, 2026
dfrg
approved these changes
Oct 9, 2026
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.
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.
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, andhr_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.