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

Fix ".SFUI" magic font string on iOS/MacCatalyst #15990

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

Redth
Copy link
Member

@Redth Redth commented Jul 5, 2023

For some reason UIFont.FromName always returns some font even if you specify an invalid name, but it may not be the correct font.

There was some logic added in MAUI to clean up the font name and try and load by the cleaned up name, however since UIFont.FromName always returns a result and not null, it will always be used before we would even get to checking the ".SFUI" magic string.

This also probably means the final attempt to get a font by (non cleaned up) name actually never gets hit, but for now this is still an improvement.

Fixes #15882

For some reason `UIFont.FromName` always returns _some_ font even if you specify an invalid name, but it may not be the _correct_ font.

There was some logic added in MAUI to clean up the font name and try and load by the cleaned up name, however since `UIFont.FromName` always returns a result and not null, it will always be used before we would even get to checking the ".SFUI" magic string.

This also probably means the final attempt to get a font by (non cleaned up) name actually never gets hit, but for now this is still an improvement.
@jsuarezruiz
Copy link
Contributor

/azp run

@jsuarezruiz jsuarezruiz added area-fonts Custom fonts and Font related API's t/bug Something isn't working labels Jul 5, 2023
@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mattleibow mattleibow merged commit 39aca1f into main Jul 5, 2023
@mattleibow mattleibow deleted the dev/fix-ios-system-font-sfui branch July 5, 2023 18:57
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-fonts Custom fonts and Font related API's fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System fonts such as ".SFUI-Semibold" are not applied on iOS
5 participants