Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Layout issue, missing last letter #13298

Open
dbriard opened this issue Oct 17, 2023 · 18 comments
Open

Text Layout issue, missing last letter #13298

dbriard opened this issue Oct 17, 2023 · 18 comments

Comments

@dbriard
Copy link
Contributor

dbriard commented Oct 17, 2023

With the following configuration, the x of CheckBox is missing.

<CheckBox UseLayoutRounding="False" 
		  FontFamily="Inter" 
		  FontSize="13">CheckBox</CheckBox>

It must be a precision issue as if I change one of the 3 properties below, the x appear correctly.

image

For example:
image

You can test with 11.0.5 but the bug was not new to this version.

@robloo
Copy link
Contributor

robloo commented Oct 18, 2023

Are you using any display scaling on your OS? I'm fairly certain these types of issues are tied to 125%+ display scaling on Windows.

@dbriard
Copy link
Contributor Author

dbriard commented Oct 18, 2023

Are you using any display scaling on your OS? I'm fairly certain these types of issues are tied to 125%+ display scaling on Windows.

I am using 250% but I have the exact same issue with 100%. You cannot reproduce?

@timunie
Copy link
Contributor

timunie commented Oct 19, 2023

Is it the FluentTheme? Which Font? Do you use the inter font?

Side node: today I guess a font measure fix was merged. Can you probably test your case against nightly? Not sure if it is related to this issue. See: #13268

@dbriard
Copy link
Contributor Author

dbriard commented Oct 19, 2023

Is it the FluentTheme? Which Font? Do you use the inter font?

Side node: today I guess a font measure fix was merged. Can you probably test your case against nightly? Not sure if it is related to this issue. See: #13268

The settings in the capture: inter 13, with no layout rounding. I just don't remember which Inter font, the one from Avalonia or one installed on my system as they can be a little different.

@Gillibald
Copy link
Contributor

The font should not matter. This is some measure / arrange issue with unrounded text measurement values.

@dbriard
Copy link
Contributor Author

dbriard commented Oct 19, 2023

The font should not matter. This is some measure / arrange issue with unrounded text measurement values.

Sure it is just for you to reproduce the issue, as on a full page of controls, this is the only one that is missing a char, so not an obvious bug.

@Developer-Alexander
Copy link

I am experiencing basically the same issue in my apps.
Curiously, I wasn't able to reproduce the phenomenon in a small standalone app.

@timunie
Copy link
Contributor

timunie commented Oct 20, 2023

yeah, a minimal sample to reproduce would be ❤️ . Seems like a hard to catch issue though. I guess it must be some rounding issue somewhere.

@Developer-Alexander
Copy link

I don‘t know if this helps: I can see this phenomenon sometimes in an autosize column of a Grid.

@timunie
Copy link
Contributor

timunie commented Oct 20, 2023

@Developer-Alexander yeah then it could be related to grid layout, not text layout 🤔 . Maybe Auto should always round up.

@Developer-Alexander
Copy link

Developer-Alexander commented Oct 20, 2023

With this demo app I was able to catch the issue for a Checkbox with UseLayoutRound="False".
However I was not able to reproduce it for an autosize column of a grid.

grafik

MissingTrailingCharacter.zip

Note: The app uses embedded Roboto Mono Light.

@robloo
Copy link
Contributor

robloo commented Oct 20, 2023

Note that this is again very similar to a reported issue in the previews:

It was briefly fixed and then came back. Most recently it was mentioned here:

If we have a reliable example that everyone can see now that's great!

@Developer-Alexander yeah then it could be related to grid layout, not text layout 🤔 . Maybe Auto should always round up.

If it's the same issue I've been seeing in ToolTip it doesn't appear related to Grid. The ToolTip doesn't seem to have a Grid in the visual tree when displaying text.

@Developer-Alexander
Copy link

If it's the same issue I've been seeing in ToolTip it doesn't appear related to Grid. The ToolTip doesn't seem to have a Grid in the visual tree when displaying text.

I can confirm that the phenomenon also occurs very frequently with ToolTips.

The thing with the autosize columns of a grid was probably not relevant to the problem.

@Gillibald
Copy link
Contributor

I can't reproduce the issue with the sample you posted above

@Developer-Alexander
Copy link

I can't reproduce the issue with the sample you posted above

A pity! I can reproduce it with this example at both 100% scaling and 175%.

@dbriard
Copy link
Contributor Author

dbriard commented Oct 20, 2023

I can't reproduce the issue with the sample you posted above

@Gillibald and @timunie Here is a repro sample with my Inter font embedded in resources as it does not happen with all versions of the Inter font, size 13 and use layout rounding to false. Please tell me if you can reproduce with this repro (whatever the Windows zoom). Thanks a lot!
CheckBoxBug.zip

@timunie
Copy link
Contributor

timunie commented Oct 30, 2023

@dbriard I can reproduce using your sample

@timunie
Copy link
Contributor

timunie commented Oct 30, 2023

Works if I remove the Padding btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants