-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] System Fonts fix #20961
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] System Fonts fix #20961
Conversation
|
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
| _ = App.WaitForElement("label"); | ||
|
|
||
| // The test passes if fonts are correctly rendered | ||
| VerifyScreenshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting CI to pass tests and generate the reference snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz how do we get the screenshot? this looks ok to merge now otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, you need to go to the UITest run https://dev.azure.com/xamarin/public/_build/results?buildId=110953&view=ms.vss-test-web.build-test-results-tab&runId=2620968&resultId=100163&paneView=debug
And check the failed test .

Then go to the Attachments and download the image for the test SystemFontsShouldRenderCorrectly

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Hi, Edit: Typeface? CreateTypeface((string? fontFamilyName, FontWeight weight, bool italic) fontData)
{
var (fontFamily, weight, italic) = fontData;
fontFamily ??= string.Empty;
var style = ToTypefaceStyle(weight, italic);
var result = Typeface.Default;
var isDefaultTypeface = false;
if (!string.IsNullOrWhiteSpace(fontFamily))
{
if (LoadDefaultTypeface(fontFamily) is Typeface systemTypeface)
{
result = systemTypeface;
isDefaultTypeface = true;
}
else if (GetFromAssets(fontFamily) is Typeface typeface)
result = typeface;
else
result = Typeface.Create(fontFamily, style);
}
if (OperatingSystem.IsAndroidVersionAtLeast(28))
result = Typeface.Create(result, (!isDefaultTypeface || result == null) ? (int)weight : result.Weight, italic);
else
result = Typeface.Create(result, style);
return result;
}Thank you |
|
@jonathanpeppers I've added a commit with your suggested changes. Thanks for the tips! |
jonathanpeppers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if the test & screenshot are working. 👍
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |

Issues Fixed
Fixes #19556