-
Notifications
You must be signed in to change notification settings - Fork 742
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
[Android] When using custom fonts, text position in TextBox
or Button
doesn't render correctly
#6528
Comments
Thanks for the report. Can you create a repro sample so we're sure that we're looking at the same issue ? |
Here is a sample. It works fine on iOS and Windows but not on Android. |
Thanks for the repro. I was not able to reproduce the issue visually, the content is appearing properly. Which device are you using to run this repro ? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. We don't monitor discussions on closed issues thus please open a new GitHub issue if you need the team to revisit this matter. |
@jeromelaban Sorry, I didn't know there were comments. I'm having a problem with the Android emulator (Pixel5 - API 30 Android 11.0-API30) and the Samsung Galaxy M12. |
Thanks for the update. |
I'm hitting the same issue, and it looks like the custom font I'm using exacerbates it even more because text ends up rendered way below. Repro code: <Page
x:Class="UnoTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel VerticalAlignment="Top" Orientation="Horizontal" Margin="20">
<Border BorderThickness="1" BorderBrush="Green">
<TextBlock Text="Default Font" FontSize="30" />
</Border>
<Border BorderThickness="1" BorderBrush="Red">
<TextBlock FontFamily="ms-appx:///Assets/Assets/BravuraText.otf#Bravura Text" Text="Bravura Font" FontSize="30" />
</Border>
</StackPanel>
</Page>
Android (incorrect text metrics which adds space above and below): Hacky workaround: use Android-specific negative vertical margins on the
|
TextBox
or Button
doesn't render correctly
same issue here. |
This makes text based UI Layout different on iOS and Android, and it makes UI bug frequently. |
@ramezgerges can you please check the repro to see what could be the cause? |
Current behavior
When using custom fonts, text position in TextBox or Button doesn't render correctly on Android
Expected behavior
When using custom fonts, text position in TextBox or Button render correctly on Android
How to reproduce it (as minimally and precisely as possible)
https://platform.uno/docs/articles/features/custom-fonts.html
Workaround
None
Works on UWP/WinUI
Yes
Environment
Nuget Package:
Nuget Package Version(s):
Affected platform(s):
IDE:
Anything else we need to know?
The text was updated successfully, but these errors were encountered: