Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

LT-22638: Show OpenType feature names and multi-valued variants#1029

Draft
jasonleenaylor wants to merge 1 commit into
mainsillsdev/FieldWorks:mainfrom
LT-22638sillsdev/FieldWorks:LT-22638Copy head branch name to clipboard
Draft

LT-22638: Show OpenType feature names and multi-valued variants#1029
jasonleenaylor wants to merge 1 commit into
mainsillsdev/FieldWorks:mainfrom
LT-22638sillsdev/FieldWorks:LT-22638Copy head branch name to clipboard

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes LT-22638. Makes OpenType font
features usable in Font Options: features show human-readable names from the
font (or a registered-feature catalog), and character variants with multiple
named alternates are selectable instead of a single On/Off toggle — parity with
the existing Graphite experience, with no change to the dropdown menu, so both
the Writing System and Styles font dialogs inherit it.

What changed

  • New OpenTypeFontFeatureInfoReader (FwUtils) — parses GSUB/GPOS feature
    lists, featureParams, and the name table via a table-source delegate (GDI
    GetFontData in the app, font-file bytes in tests). Bounds-checked; malformed
    fonts degrade to tag-only records. Adapted from Paratext's OpenTypeFeatures.Ttf.
  • New OpenTypeFeatureCatalog (FwUtils) — classifies registered features
    (hidden / default-on) and supplies English names, seeded from Paratext and
    audited against the OpenType registry (dlig visible, aalt hidden, kern
    default-on).
  • Rewrote the OpenType provider in FontFeaturesButton — character variants
    with named options become "None + option" submenus stored as cvNN=k; labels
    resolve font-supplied → resx → catalog → numbered fallback; default-on features
    initialize enabled; hidden features filtered.
  • resx — added None / numbered-set fallbacks; removed dead labels (aalt,
    ccmp) and entries orphaned by the rewrite (ss01ss05, ValueOff/ValueOn).
  • DocsDocs/opentype-font-features.md updated.

Storage, rendering, and CSS/Word export are untouched — the renderer-neutral
tag=value string already carried multi-values.

Testing

  • Reader verified against real Charis SIL 6.200 (cv43 "Capital Eng" + 3
    options, ss01 "Single-story a and g", GPOS mark/mkmk) and Scheherazade
    New
    (cv70 "Damma").
  • Synthetic malformed-table robustness tests.
  • Provider tests: multi-value cv, binary fallback, default-on init, label
    priority, hidden filtering, cv43=2 round-trip, resx↔catalog consistency.
  • Green: FwUtilsTests 33, FwCoreDlgControlsTests 17, FwCoreDlgsTests 19. Coverage:
    catalog/info 100%, reader 86%.
  • Manual acceptance passed (WS setup → Font tab → Charis → Font Features).

🤖 Generated with Claude Code


This change is Reviewable

- Read the font-supplied names and named options from GSUB featureParams
  and the name table so features are comprehensible and character
  variants are selectable, as with Graphite.
- Add OpenTypeFontFeatureInfoReader adapted from Paratext's
  OpenTypeFeatures.Ttf.
- Add OpenTypeFeatureCatalog registered-feature hidden and default-on
  classification plus English names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ± 0      1 suites  ±0   10m 51s ⏱️ + 2m 38s
4 345 tests +32  4 272 ✅ +32  73 💤 ±0  0 ❌ ±0 
4 354 runs  +32  4 281 ✅ +32  73 💤 ±0  0 ❌ ±0 

Results for commit b8a2dd1. ± Comparison against base commit ac89f08.

This pull request removes 2 and adds 34 tests. Note that renamed tests count towards both.
SIL.FieldWorks.FwCoreDlgControlsTests.TestFontFeaturesButton ‑ OpenTypeFontFeatureReader_CachesFeatureTagsForSameFontKey
SIL.FieldWorks.FwCoreDlgControlsTests.TestFontFeaturesButton ‑ OpenTypeFontFeatureReader_FiltersRequiredShapingFeatures
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ AccessAllAlternates_IsHidden
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ CommonlyDefaultOnFeatures_AreDefaultOn("calt")
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ CommonlyDefaultOnFeatures_AreDefaultOn("clig")
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ CommonlyDefaultOnFeatures_AreDefaultOn("kern")
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ CommonlyDefaultOnFeatures_AreDefaultOn("liga")
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ DiscretionaryLigatures_AreUserVisible
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ LegacyBlocklistTags_AreAllHidden
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ UnknownTag_IsNeitherKnownNorHidden
SIL.FieldWorks.Common.FwUtils.OpenTypeFeatureCatalogTests ‑ VisibleFeatures_HaveEnglishNames
SIL.FieldWorks.Common.FwUtils.OpenTypeFontFeatureInfoReaderRobustnessTests ‑ FeatureParamsOffsetPastTableEnd_YieldsTagWithoutLabel
…

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.02148% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.09%. Comparing base (321ba87) to head (b8a2dd1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/Common/FwUtils/OpenTypeFontFeatureInfoReader.cs 81.46% 16 Missing and 17 partials ⚠️
...FwCoreDlgs/FwCoreDlgControls/FontFeaturesButton.cs 85.36% 3 Missing and 9 partials ⚠️
Src/Common/FwUtils/OpenTypeFeatureCatalog.cs 99.37% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1029      +/-   ##
==========================================
+ Coverage   33.02%   33.09%   +0.07%     
==========================================
  Files        1202     1204       +2     
  Lines      278232   278559     +327     
  Branches    37169    37226      +57     
==========================================
+ Hits        91880    92196     +316     
+ Misses     158502   158493       -9     
- Partials    27850    27870      +20     
Files with missing lines Coverage Δ
Src/Common/FwUtils/OpenTypeFeatureCatalog.cs 99.37% <99.37%> (ø)
...FwCoreDlgs/FwCoreDlgControls/FontFeaturesButton.cs 62.85% <85.36%> (+2.17%) ⬆️
...rc/Common/FwUtils/OpenTypeFontFeatureInfoReader.cs 81.46% <81.46%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.