Xamarin.Forms Guides | Samples

Xamarin.Forms.Font Structure

The font used to display text.

See Also: Font

Syntax

[Xamarin.Forms.TypeConverter(typeof(Xamarin.Forms.FontTypeConverter))]
public struct Font

Remarks

The available fonts, and the matching between Font and real displayed fonts is device-dependent.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.Font are listed below.

See Also: ValueType

Public Properties

[read-only]
static
DefaultFont. Gets the default font for the device.
[read-only]
FontAttributesFontAttributes. Gets a value that indicates whether the font is bold, italic, or neither.
[read-only]
FontFamilyString. Gets the font family to which this font belongs.
[read-only]
FontSizeDouble. Gets the size of the font.
[read-only]
IsDefaultBoolean. Gets a value that tells whether this font has no attributes, belongs to the default family, and has no attributes set.
[read-only]
NamedSizeNamedSize. Gets the named font size, such as "Large" or "Small".
[read-only]
UseNamedSizeBoolean. Gets a value that indicates whether the target operating system should use size that is specified by the NamedSize property.

Public Methods

static
BoldSystemFontOfSize(Double) : Font
Returns a font instance that represents the default bold font, in the requested size, for the device.
static
BoldSystemFontOfSize(NamedSize) : Font
Returns an usable font instance representing the default bold font, in the requested NamedSize, for the device.
override
Equals(Object) : Boolean
Determine if the provided Object is equivalent to the current Font.
override
GetHashCode() : Int32
Get the Hashcode for this Object.
static
OfSize(String, Double) : Font
Returns a Font structure with the requested font and size.
static
OfSize(String, NamedSize) : Font
Returns an usable Font, with the requested font and NamedSize.
static
SystemFontOfSize(Double) : Font
Returns an usable font instance representing the default font, in the requested size, for the device and platform.
static
SystemFontOfSize(NamedSize) : Font
Returns an usable font instance representing the default font, in the requested size, for the device and platform.
static
SystemFontOfSize(Double, FontAttributes) : Font
Returns a font structure with the specified size and attributes.
static
SystemFontOfSize(NamedSize, FontAttributes) : Font
Returns a font structure with the specified size and attributes.
override
ToString() : String
Returns a string representation of this font structure.
WithAttributes(FontAttributes) : Font
Returns a new font structure with the specified attributes.
WithSize(Double) : Font
Returns a new font structure with the size that was specified with size.
WithSize(NamedSize) : Font
A new Font structure with the size that was specified with size.

Public Operators

static
Equality(Font, Font)Returns true if left represents the same font that right represents. Otherwise, false.
static
Inequality(Font, Font)Returns true if left does not represent the same font that right represents. Otherwise, false.