feat(TextBlock): TextTrimming#22572
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements TextTrimming support (CharacterEllipsis and WordEllipsis) for TextBlock controls in Skia-based platforms, along with spell checking capabilities and text highlighting features. The implementation builds on PR #22448 for text highlighters and introduces significant infrastructure for font fallback and spell checking.
Changes:
- Added TextTrimming support with character-level and word-level ellipsis algorithms
- Implemented spell checking service using Hunspell dictionaries with visual red underlines
- Added TextHighlighter API for marking text ranges with custom foreground/background colors
- Introduced font fallback service infrastructure for better Unicode character support
Reviewed changes
Copilot reviewed 133 out of 138 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| UnicodeText.skia.cs | Core text layout engine with trimming, spell checking, and font fallback logic |
| TextBlock.skia.cs | Integration of TextHighlighters collection and spell checking support |
| TextBox.skia.cs | Spell checking UI with context menu suggestions |
| TextHighlighter.cs | New API for text highlighting with customizable brushes |
| TextRange.cs | Structure representing text range with start index and length |
| ISpellCheckingService.cs | Interface for spell checking implementations |
| IFontFallbackService.skia.cs | Interface for font fallback providers |
| FontFallbackService.skia.cs | Noto fonts-based fallback implementation |
| SpellCheckingService.cs | Hunspell-based spell checking implementation |
| FontFallbackPreprocessor | Tool to generate font coverage maps from Noto fonts |
| Uno.WinUI.SpellChecking.csproj | New add-in package for spell checking |
| Resource files | Localized strings for spell checking UI (80+ languages) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBlock.cs
Show resolved
Hide resolved
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22572/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22572/wasm-skia-net9/index.html |
|
|
8170bbc to
c95ea35
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22572/wasm-skia-net9/index.html |
|
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/Uno.UI/UI/Xaml/Documents/UnicodeText.skia.cs:786
- Typo:
lineBreakingOpporunities/lineBreakingOpporunityshould belineBreakingOpportunities/lineBreakingOpportunityfor readability and consistency.
private static List<List<BidiRun>> ApplyLineBreaking(float lineWidth, List<BidiRun> logicallyOrderedRuns,
List<(int endRunIndex, int endIndexInLastRun)> lineBreakingOpporunities, bool rtl,
TextWrapping textWrapping)
{
var lines = new List<List<BidiRun>>();
(int firstRunIndex, int startingIndexInFirstRun) = (0, 0);
(int endRunIndex, int endIndexInLastRun)? prevInSameLine = null;
for (var lineBreakingOpportunityIndex = 0; lineBreakingOpportunityIndex < lineBreakingOpporunities.Count; lineBreakingOpportunityIndex++)
{
var lineBreakingOpporunity = lineBreakingOpporunities[lineBreakingOpportunityIndex];
💡 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-22572/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-22572/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-22572/wasm-skia-net9/index.html |
GitHub Issue: closes https://github.com/unoplatform/kahua-private/issues/406, closes #18716
The branch is on top of #22448