Bold text - .NET MAUI

In MAUI, there is no built-in way to detect if the user has enabled bold fonts. You can create a method and consume the Native API to detect user preferences.

For Android, you can use the App Resources Config.

For iOS, you can use UIKit.UIAccessibility.IsBoldTextEnabled.

public bool PrefersBold()
{
#if ANDROID

    if (OperatingSystem.IsAndroidVersionAtLeast(31))
    {
        return false;
    }

    return Platform.AppContext.Resources.Configuration.FontWeightAdjustment >= Android.Graphics.Fonts.FontStyle.FontWeightBold;

#elif IOS

    return UIKit.UIAccessibility.IsBoldTextEnabled;

#endif
}