Last active
April 10, 2019 22:56
-
-
Save chkn/a2cede0380080c6ee47dddc3178fad68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Extensions { | |
#if __IOS__ | |
public static Font ToFont (this UIKit.UIFont font) | |
{ | |
return Font.OfSize (font.Name, font.PointSize); | |
} | |
#endif | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Fonts { | |
public static Font LargeTitle => | |
#if __IOS__ | |
UIKit.UIFont.GetPreferredFontForTextStyle (UIKit.UIFontTextStyle.LargeTitle).ToFont (); | |
#else | |
Font.SystemFontOfSize (NamedSize.Large, FontAttributes.Bold); | |
#endif | |
public static Font ThinBody => | |
#if __IOS__ | |
UIKit.UIFontMetrics.DefaultMetrics.GetScaledFont (UIKit.UIFont.SystemFontOfSize (18, UIKit.UIFontWeight.UltraLight)).ToFont (); | |
#else | |
Font.Default; | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment