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

Label italic width incorrect #8118

Open
nk54 opened this issue Jun 16, 2022 · 5 comments
Open

Label italic width incorrect #8118

nk54 opened this issue Jun 16, 2022 · 5 comments
Labels
area-controls-label Label, Span platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@nk54
Copy link

nk54 commented Jun 16, 2022

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
image
image
image

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

@nk54 nk54 added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jun 16, 2022
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jun 16, 2022
@jfversluis
Copy link
Member

This might be related to #8028

@jfversluis jfversluis added platform/android 🤖 and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 16, 2022
@kristinx0211 kristinx0211 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jun 17, 2022
@kristinx0211
Copy link

verified repro on android on android 12 with code above.

@rachelkang rachelkang added the area-controls-label Label, Span label Jun 27, 2022
@rachelkang rachelkang added this to the 6.0-servicing milestone Jun 27, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

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.

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 5, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 16, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.6.0 Preview 7.0. Repro on Android 13.0 with below Project:
8118.zip

Android:
image
Windows 11:
image

@nmanocha
Copy link

nmanocha commented Nov 2, 2023

This is still reproducible with 8.0 RC2

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-label Label, Span platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants