Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Added new named Font Sizes, iOS Named fonts now all AutoScale based on Accessibility Options #5985

Merged
merged 2 commits into from
May 1, 2019

Conversation

Clancey
Copy link
Contributor

@Clancey Clancey commented Apr 24, 2019

We now use the iOS Prefered Font Scaling stuff so fonts are magical

Description of Change

Added new Named Fonts

fixes #5474

API Changes

Added:
NamedSize Sizes
Large = 4,
Body = 5,
Header = 6,
Title = 7,
Subtitle = 8,
Caption = 9

Platforms Affected

  • Core/XAML (all platforms)
  • iOS
  • Android
  • UWP

Behavioral/Visual Changes

iOS Font named font sizes now Scale just like Android does.

Testing Procedure

Use a named font,
Set the Large Font Size option in iOS, Accessibility options.

PR Checklist

  • Rebased on top of the target branch at time of PR
  • Changes adhere to coding standard

We now use the iOS Prefered Font Scaling stuff so fonts are magical
@Clancey
Copy link
Contributor Author

Clancey commented Apr 24, 2019

The values for Android and UWP come from the Typography guides.

Copy link
Member

@StephaneDelcroix StephaneDelcroix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the missing cases in FontTypeConverter. The fallback works, but Enum.TryParse is notoriously slow.

Make sure the WPF, GTK, Tizen guys are aware of this change too.

@rmarinho rmarinho merged commit 8e7938c into xamarin:master May 1, 2019
@rmarinho
Copy link
Member

Hey @Clancey I have been playing a little bit with this, and I think we need to revert this or think on a better way.

1 - this introduces a breaking change, that means that now our users if they have Accessibility on the app will use the font scale and existing UI will look different , breaking existing app designs.

2 - This only works when you restart the app. Since you get the font scale when iOSPlatformServices are created and you don't listen to accessibility changes and never update

So without your pr here's how a default app looks.

IMG_4057

When I enable your pr the UI will look different, we need the user to opt in for this imo.

IMG_4059
IMG_4058

And when I have the app running and change the Accessibility the UI font

IMG_4060

IMG_4061

@Clancey
Copy link
Contributor Author

Clancey commented May 17, 2019

I know, I don't listen to the changes. The reason is the font's won't update anyways unless the user has dynamic styles enabled.

@Clancey
Copy link
Contributor Author

Clancey commented May 17, 2019

As for being a breaking change, This is more of an alignment. If you use Accessibility on Android using the named fonts it scales properly just like this does now. Using named fonts never expose a specific size. This is the expected behavior and it now properly aligns with Android behavior.

@samhouts samhouts added this to the 4.1.0 milestone Jun 4, 2019
AxelUser pushed a commit to AxelUser/Xamarin.Forms that referenced this pull request Jun 15, 2019
…n Accessibility Options (xamarin#5985) fixes xamarin#5474

* Added new named Font Sizes, iOS Named fonts now all AutoScale

We now use the iOS Prefered Font Scaling stuff so fonts are magical

* Added new named font sizes to the FontSizeConverter
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/a11y 🔍 approved Has two approvals, no pending reviews, and no changes requested e/2 🕑 2 p/Android p/iOS 🍎 p/UWP t/enhancement ➕
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility: On iOS Forms should use DynamicType
5 participants