Avalonia: TextBlock text wrapping: Sometimes duplicates and leaves characters behind on wrap

Created on 10 Mar 2020  路  9Comments  路  Source: AvaloniaUI/Avalonia

Development Setup

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:

text-wrapping

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 --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. Edit: As Gillibald mentioned, this is working properly, and the non-breaking hyphen (\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!

Most helpful comment

4240 I think I finally fixed this. Still have to verify 馃槄

All 9 comments

applies should not be broken into characters in that scenario. For --auth you have to glue everything together. Breaking between -- should be valid.

Will investigate and fix shortly.

This issue is super weird. Somehow Skia renders an extra character with this particular font.

4240 I think I finally fixed this. Still have to verify 馃槄

Sorry, this bug still exists in 0.9.999-cibuild0008974-beta. (No problem, but since you mentioned needing to verify still, I thought I would check on it.)

Too bad. So I need to investigate this further. Thanks for testing.

I just ran your project with the latest preview and I can't see any issues
2020-07-28 174241

Closing because it seems to be fixed

8974 is out of date. I apologize for using the wrong build. I can confirm this is fixed. My bad! 馃槄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonathaN7Shepard picture JonathaN7Shepard  路  4Comments

stdcall picture stdcall  路  4Comments

GitHubington picture GitHubington  路  3Comments

x2bool picture x2bool  路  4Comments

Urgau picture Urgau  路  3Comments