LT-22324: add OpenType font feature options#870
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds OpenType font-feature support to FieldWorks’ existing WinForms/Views stack (LT-22324), including a renderer-neutral feature string model, UI integration, native Uniscribe OpenType shaping, and layered test coverage plus OpenSpec/docs artifacts.
Changes:
- Introduces renderer-neutral
tag=valuefeature parsing/normalization and integrates it into WinForms font-feature UI. - Adds native Uniscribe OpenType shaping/placing path driven by run feature strings, plus deterministic native tests using a committed SIL font fixture.
- Adds managed cache-identity tests and test-only HarfBuzzSharp/SkiaSharp comparison coverage; includes OpenSpec requirements/research/manual evidence docs.
Reviewed changes
Copilot reviewed 33 out of 38 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| openspec/changes/add-opentype-font-features/views-migration-matrix.md | Adds a Views subsystem inventory/migration matrix to guide phased migration and feature parity work. |
| openspec/changes/add-opentype-font-features/tasks.md | Documents implementation/task checklist for Phase 1 OpenType features and associated testing. |
| openspec/changes/add-opentype-font-features/specs/font-feature-settings/spec.md | Defines requirements for feature independence from Graphite and renderer-neutral storage/application. |
| openspec/changes/add-opentype-font-features/specs/architecture/ui-framework/winforms-patterns/spec.md | Specifies WinForms composition/localization requirements for feature controls. |
| openspec/changes/add-opentype-font-features/specs/architecture/ui-framework/views-rendering/spec.md | Specifies Views rendering + cache identity requirements around feature strings. |
| openspec/changes/add-opentype-font-features/specs/architecture/testing/test-strategy/spec.md | Defines layered test strategy including visual baselines and cross-renderer comparisons. |
| openspec/changes/add-opentype-font-features/research.md | Captures research notes and external references (Uniscribe OT APIs, HarfBuzz, Skia/Avalonia). |
| openspec/changes/add-opentype-font-features/proposal.md | Summarizes the change scope, goals, and impacted areas for LT-22324. |
| openspec/changes/add-opentype-font-features/manual-testing.md | Records manual WinApp/WinForms MCP evidence steps and screenshots for the UI changes. |
| openspec/changes/add-opentype-font-features/design.md | Documents design decisions (renderer-neutral model, Uniscribe OT, provider UI seam, test tooling). |
| openspec/changes/add-opentype-font-features/.openspec.yaml | Adds OpenSpec metadata for the change set. |
| Src/views/lib/UniscribeSegment.cpp | Adds OT feature parsing and optional ScriptShape/Place OpenType path during shaping/placing. |
| Src/views/Test/TestViews.vcxproj.filters | Adds Charis SIL test font fixture files to VS filters. |
| Src/views/Test/TestViews.vcxproj | Copies Charis SIL font fixture beside TestViews.exe for deterministic native tests. |
| Src/views/Test/TestUniscribeEngine.h | Adds deterministic native tests for OT feature metrics/pixel deltas and state switching. |
| Src/views/Test/TestData/Fonts/CharisSIL-5.000/README.txt | Adds redistributable font README to support deterministic fixture usage. |
| Src/views/Test/TestData/Fonts/CharisSIL-5.000/OFL.txt | Adds SIL OFL license text for the committed test font fixture. |
| Src/views/Test/RenderEngineTestBase.h | Extends TxtSrc to carry szFontVar feature strings into render props for tests. |
| Src/FwCoreDlgs/FwCoreDlgsTests/FwFontDialogTests.cs | Adds test ensuring OpenType features round-trip and normalize through font dialog save. |
| Src/FwCoreDlgs/FwCoreDlgControls/FwCoreDlgControlsTests/TestFontFeaturesButton.cs | Adds tests for renderer-neutral tag emission and normalization behavior in the control. |
| Src/FwCoreDlgs/FwCoreDlgControls/FwCoreDlgControlsTests/FwFontTabTests.cs | Adds style/font-tab tests ensuring OpenType feature strings round-trip and normalize. |
| Src/FwCoreDlgs/FwCoreDlgControls/FwCoreDlgControlsTests/FwAttributesTests.cs | Adds test verifying attributes control returns normalized feature strings and inheritance status. |
| Src/FwCoreDlgs/FwCoreDlgControls/FontFeaturesButton.cs | Refactors button around provider seam; adds OpenType discovery via GDI table parsing; normalizes input. |
| Src/FwCoreDlgs/FwCoreDlgControls/DefaultFontsControl.resx | Updates help text and group label to generic “Font Options” wording. |
| Src/FwCoreDlgs/FwCoreDlgControls/DefaultFontsControl.cs | Decouples UI enablement from Graphite checkbox; wires provider preference and setup flow. |
| Src/Common/SimpleRootSite/SimpleRootSiteTests/RenderEngineFactoryTests.cs | Adds tests for feature normalization propagation and cache identity behavior. |
| Src/Common/SimpleRootSite/RenderEngineFactory.cs | Adds feature strings into renderer cache key and normalizes/copies features into graphics props. |
| Src/Common/RenderVerification/RenderComparisonTests/RenderComparisonTests.csproj | Adds a test-only comparison project with HarfBuzzSharp/SkiaSharp dependencies. |
| Src/Common/RenderVerification/RenderComparisonTests/HarfBuzzSkiaComparisonTests.cs | Adds HarfBuzz shaping-data toggle test and a basic Skia “non-blank render” comparison test. |
| Src/Common/FwUtils/FwUtilsTests/FontFeatureSettingsTests.cs | Adds unit tests for parsing/normalizing renderer-neutral feature strings. |
| Src/Common/FwUtils/FontFeatureSettings.cs | Introduces renderer-neutral parser/normalizer and validity checks for OpenType tags. |
| Docs/opentype-font-features.md | Documents feature-string model, UI usage, renderer boundaries, and export notes. |
| Directory.Packages.props | Adds centralized package versions for HarfBuzzSharp and SkiaSharp (test infrastructure). |
|
Validated the Word export changes on this branch. How it was validated:
I do not have Microsoft Word installed on this machine, so the validation here is at the DOCX/package level rather than a final visual check in Word itself. But the exported document now contains the expected WordprocessingML that Word uses for these OpenType stylistic sets. |
11e413a to
a9d4f58
Compare
|
Follow-up review pass is pushed in Addressed in this pass:
Left open intentionally for a later pass:
Validation run on this branch after the new commit:
|
NUnit Tests 1 files ± 0 1 suites ±0 10m 44s ⏱️ -27s For more details on these failures, see this check. Results for commit f606e05. ± Comparison against base commit 8e99077. This pull request removes 2 and adds 42 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
|
Final OpenType review cleanup is pushed in Addressed in this pass:
Validation:
The three remaining Copilot review threads were replied to and resolved after this push. |
Add word generation font options Finish up the docx font updates Partial fixes LT-22324: preserve OpenType font features xWorks: preserve OpenType features in Word export
jasonleenaylor
left a comment
There was a problem hiding this comment.
@jasonleenaylor reviewed 27 files and all commit messages, and made 2 comments.
Reviewable status: 27 of 60 files reviewed, all discussions resolved.
Src/Common/SimpleRootSite/RenderEngineFactory.cs line 39 at r3 (raw file):
/// font. /// </summary> public IRenderEngine get_Renderer(ILgWritingSystem ws, IVwGraphics vg)
This name slipped through in an earlier PR I guess, this is not the correct C# style for a method, it looks more like the c++ expectation or COM naming patterns.
Src/xWorks/xWorksTests/XhtmlDocViewTests.cs line 46 at r3 (raw file):
{ using (var docView = new TestXhtmlDocView()) {
A comment explaining why this test failure is important would be good for maintainence.
johnml1135
left a comment
There was a problem hiding this comment.
@jasonleenaylor Fixed in f606e05.
RenderEngineFactorynow exposesGetRenderer(...)for C# callers/tests, while keepingIRenderEngineFactory.get_Renderer(...)as an explicit COM-interface adapter for native/generated-interface callers.- Added a comment to
XhtmlDocView_ImplementsRefreshableRootexplaining that it protects theFwXWindowrefresh traversal path for XHTML dictionary views.
Validation:
./test.ps1 -SkipNative -TestProject SimpleRootSiteTests -TestFilter "FullyQualifiedName~RenderEngineFactoryTests" -NoBuild -StartedBy agentpassed 7/7../test.ps1 -SkipNative -TestProject xWorksTests -TestFilter "FullyQualifiedName~XhtmlDocView_ImplementsRefreshableRoot" -StartedBy agentpassed 1/1.CI: Commit messagespassed.
Note: an unfiltered SimpleRootSiteTests run still hits existing Views layout failures in selection tests, so I used the focused fixture run for this review change.
Render comparison artifacts75427247010e run 26317352517.1 detected 1 render snapshot failure(s).
This comment is updated in place by CI for the latest run. |
Summary
This PR contains only the direct OpenType font feature work from LT-22324 after splitting the broader branch into separate reviewable pieces.
Included
Excluded
This change is