string
font name.double
.FontAttributes
enumeration in C#).FontSize
property can be set to a double value, for instance:NamedSize
enumeration that represent specific font sizes. For more information about named font sizes, see Named font sizes.FontAttributes
property. The following values are currently supported:FontAttribute
enumeration can be used as follows (you can specify a single attribute or OR
them together):Device.RuntimePlatform
property can be used to set different font names on each platform, as demonstrated in this code:FontSize
property that can be set in XAML. The simplest way to set the font in XAML is to use the named size enumeration values, as shown in this example:FontSize
property that allows all font settings to be expressed as a string value in XAML. In addition, the FontAttributes
property can be used to specify font attributes:Device.RuntimePlatform
property can also be used in XAML to render a different font on each platform. The example below uses different fonts on each platform:NamedSize
enumeration that represent specific font sizes. The following table shows the NamedSize
members, and their default sizes on iOS, Android, and the Universal Windows Platform (UWP):Member | iOS | Android | UWP |
---|---|---|---|
Default | 16 | 14 | 14 |
Micro | 11 | 10 | 15.667 |
Small | 13 | 14 | 18.667 |
Medium | 16 | 17 | 22.667 |
Large | 20 | 22 | 32 |
Body | 17 | 16 | 14 |
Header | 17 | 96 | 46 |
Title | 28 | 24 | 24 |
Subtitle | 22 | 16 | 20 |
Caption | 12 | 12 | 12 |
Device.GetNamedSize
method can be called to return a double
that represents the named font size:ExportFont
attribute. An optional alias can also be specified.FontImageSource
object. This class, which derives from the ImageSource
class, has the following properties:Glyph
– the unicode character value of the font icon, specified as a string
.Size
– a double
value that indicates the size, in device-independent units, of the rendered font icon. The default value is 30. In addition, this property can be set to a named font size.FontFamily
– a string
representing the font family to which the font icon belongs.Color
– an optional Color
value to be used when displaying the font icon.ImageSource
. This approach permits font icons, such as emojis, to be displayed by multiple views, as opposed to limiting font icon display to a single text presenting view, such as a Label
.Image
view:Image
view. Note that while the unicode character for this icon is uf30c
, it has to be escaped in XAML and so becomes 
. The equivalent C# code is: