-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Label italic width incorrect #8118
Comments
This might be related to #8028 |
verified repro on android on android 12 with code above. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Verified this on Visual Studio Enterprise 17.6.0 Preview 7.0. Repro on Android 13.0 with below Project: |
This is still reproducible with 8.0 RC2 |
Description
I have a HorizontalStackLayout (same result with StackLayout) that contains a Label and a CheckBox.
If I set the FontAttributes to Italic, the Label's width is incorrect : it's the same size as normal text but being italic, the text is cut.
I found a workaround by setting the text in the span (Label>FormattedText>FormattedString>Span).
I did a custom control (ItalicLabel) to hack the bug. But I prefer to use the Label directly.
PS : Margin/Padding doesn't fix the issue (I tried this before the Span hack).
Here is the XAML
<HorizontalStackLayout Spacing="8"> <!-- Normal Text not cut --> <Label Text="Bool" VerticalOptions="Center" /> <!-- Italic Text cut : 80% of last char missing --> <Label FontAttributes="Italic" Text="Bool" VerticalOptions="Center" /> <!-- Text italic not cut --> <Label VerticalOptions="Center"> <Label.FormattedText> <FormattedString> <Span FontAttributes="Italic" Text="Bool" /> </FormattedString> </Label.FormattedText> </Label> <CheckBox IsChecked="{Binding IsChecked}" /> </HorizontalStackLayout>
Here are some screenshots (code format isn't readable...) of both XAML and the result



Steps to Reproduce
Use the given XAML in the description
Version with bug
6.0 Release Candidate 3
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11
Did you find any workaround?
Use Label > Label.FormattedText > FormattedString > Span > Text="Bool"
Instead of Label Text="Bool"
Relevant log output
No response
The text was updated successfully, but these errors were encountered: