TextBlock text wrapping: Sometimes duplicates and leaves characters behind on wrap
See original GitHub issueDevelopment Setup
- Avalonia v0.9.999-cibuild0006280-beta (latest as of 2020-03-10 at 1:50 PM EDT)
- .NET Core 3.1
- Visual Studio 16.4.5
- Windows 10
- Repo: https://github.com/Deadpikle/AvaloniaBugs/tree/master/ItalicTextWrapping
Bug description
Sometimes, when wrapping, certain characters are left behind on text wrapping and show up in two places. This only seems to happen with the NotoSans-Italic font (in repro project below); with normal font or default Windows font w/Italic FontStyle, things wrap properly.
This is easiest shown by a picture:

Notice how “applies” gets broken up on text wrapping – the “a” is left on the first line and appears again on the second line with the rest of the word.
I’m not sure if the Edit: As Gillibald mentioned, this is working properly, and the non-breaking hyphen (--auth line breaking is working right either? I’d prefer that to show up on one line, since there’s room, but that’s debatable.\u2011) works great in my app.
XAML:
<TextBlock Text="Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
Margin="0,4,0,0"
Width="238"
FontFamily="avares://ItalicTextWrapping/Assets/NotoSans-Italic.ttf#Noto Sans"
TextWrapping="Wrap"/>
Repo for easy reproducing: https://github.com/Deadpikle/AvaloniaBugs/tree/master/ItalicTextWrapping
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)

Top Related StackOverflow Question
#4240 I think I finally fixed this. Still have to verify 😅
This issue is super weird. Somehow Skia renders an extra character with this particular font.