Skip to content

[Spec] Font.AutoScalingEnabled and make scaling reactive #1683

Closed

Description

Provide the ability to disable auto scaling font.

This will add a boolean property to the Font struct so that when calculating the size of the font and setting it on native elements the user can disable/enable accessibility scaling. By default accessibility scaling will be enabled.

Currently on Android/iOS if you auto scale while the app is running the font sizes don't change. Ideally the size of the fonts would increase/decrease as you are changing them in the accessibility properties.

API

struct Font

Properties

API Description
AutoScalingEnabled By default this value will be true. If the user sets this to false then for each platform we'll figure out how to translate the specified font size to an exact measurement effectively disabling whatever the user has specified for font scaling on the device

XAML Example

<Image Background="Green">
    <Image.Source>
        <FontImageSource
        FontAutoScalingEnabled="True"
        FontFamily = "Ionicons" 
        Glyph = "&#xf30c;">
        </FontImageSource>
    </Image.Source>
</Image>

<Label Text="EnableScaling disabled" FontAutoScalingEnabled="False"></Label>

Backward Compatibility

This is a breaking change on iOS because now all of the numbered fonts on iOS will scale. If users want to disable this behavior they can implement their own IFontManager that inherits from ours and then then explicitly implement GetFont to influence the font that's returned.

Difficulty : medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions