Repository navigation
feat: FeatureConfiguration.Font.FallbackService - #23164
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a configurable Skia font-fallback service so apps can override how fallback font families/typefaces are resolved (via FeatureConfiguration.Font.FallbackService), and updates the Skia font-fallback plumbing accordingly.
Changes:
- Adds
FeatureConfiguration.Font.FallbackServiceas an override hook for Skia font fallback resolution. - Promotes and updates
IFontFallbackServiceAPI (rename methods to*FontFamily*) and updates call sites/implementations. - Refactors the built-in Noto fallback service and restricts generated fallback maps visibility.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Documents/TextFormatting/FontDetailsCache.skia.cs | Uses FeatureConfiguration.Font.FallbackService (if set) before falling back to ApiExtensibility service; updates method calls to the renamed interface. |
| src/Uno.UI/UI/Xaml/Documents/IFontFallbackService.skia.cs | Makes the interface public, renames methods to “FontFamily”, and adds XML documentation. |
| src/Uno.UI/UI/Xaml/Documents/FontFallbackService.skia.cs | Refactors Noto fallback service to delegate to a coverage-table-based service (new types referenced). |
| src/Uno.UI/UI/Xaml/Documents/FontFallbackMaps.skia.cs | Changes generated fallback maps type from public to internal. |
| src/Uno.UI/FeatureConfiguration.cs | Adds FeatureConfiguration.Font.FallbackService property for overriding Skia fallback. |
| src/Uno.UI.Runtime.Skia.Android/UI/Xaml/Controls/TextBox/AndroidSkiaFontFallbackService.cs | Updates Android Skia fallback implementation to the renamed interface methods. |
| src/FontFallbackPreprocessor/Program.cs | Updates generator output to emit internal static class FallbackFontMaps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
34b3779 to
ae1d24a
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23164/wasm-skia-net9/index.html |
|
The build 210082 did not find any UI Test snapshots differences. |
ae1d24a to
6fbfb5f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/Uno.UI/UI/Xaml/Documents/TextFormatting/FontDetailsCache.skia.cs:112
- Unlike
GetFontForCodepoint, this call into the fallback service isn’t wrapped in a try/catch. If a customIFontFallbackServicethrows while providing a stream, it can fault the font-loading task and potentially break text rendering. Consider catching exceptions aroundGetFontStreamForFontFamily(log + fall back toSKTypeface.FromFamilyName).
if (_fontFallbackService is { } fallbackService
&& await fallbackService.GetFontStreamForFontFamily(name, weight, stretch, style) is { } fallbackStream
&& SKTypeface.FromStream(fallbackStream) is { } typeface)
{
return typeface;
}
// FromFontFamilyName may return null: https://github.com/mono/SkiaSharp/issues/1058
return SKTypeface.FromFamilyName(name, skWeight, skWidth, skSlant);
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
|
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23164/wasm-skia-net9/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23164/wasm-skia-net9/index.html |
|
The build 210297 did not find any UI Test snapshots differences. |
|
@mergify backport release/stable/6.6 |
✅ Backports have been createdDetails
|
…6.6/pr-23164 feat: FeatureConfiguration.Font.FallbackService (backport #23164)
GitHub Issue: closes https://github.com/unoplatform/kahua-private/issues/431
PR Type:
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.