A new NuGet package for accessibility fonts

Alessandro Del Sole 1 Reputation point MVP
2020-12-17T08:47:10.48+00:00

Hi all, I just wanted to share a new plugin for Xamarin as a NuGet package with GitHub repo that I have created and published, which allows for detecting if accessibility fonts are enabled and with which size, on Android and iOS devices.

It's here: https://github.com/AlessandroDelSole/XamarinDeviceFontSize/

There are basically two simple properties that do the job.

Enjoy.
Alessandro

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,292 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alessandro Del Sole 1 Reputation point MVP
    2020-12-17T13:12:35.797+00:00

    Absolutely. It's fully documented on GitHub, by the way the usage is very simple.

    A bool property called HasAccessibilityFontsEnabled returns whether these are set on the device.

    bool isEnabled = CrossDeviceFontSize.Current.HasAccessibilityFontsEnabled; 
    

    The DeviceFontSize property returns the actual font size set on the device:

    SystemFontSize currentFontSize = CrossDeviceFontSize.Current.DeviceFontSize;
    

    The returned value is of type SystemFontSize, an enumeration described as follows:

    public enum SystemFontSize
    {
        ExtraSmall,
        Small,
        Medium,
        Normal,
        Large,
        ExtraLarge,
        Huge
    }
    

    At the moment UWP is not supported.

    0 comments No comments