Font Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a font, including family, size, weight, slant, and auto-scaling settings.
public value class Font : IEquatable<Microsoft::Maui::Font>
public readonly struct Font : IEquatable<Microsoft.Maui.Font>
type Font = struct
Public Structure Font
Implements IEquatable(Of Font)
- Inheritance
-
Font
- Implements
Remarks
The font used to display text. Supported fonts and their rendering depend on the platform.
Properties
AutoScalingEnabled |
Gets a value indicating whether auto-scaling is enabled for this font. |
Default |
Gets the default font for the platform. |
Family |
Gets the font family name, or null for the default system font. |
IsDefault |
Gets a value indicating whether this font is the default font (no family, non-positive size, default slant, and regular weight). |
Size |
Gets the size of the font. |
Slant |
Gets the slant (style) of the font (e.g., default or italic). |
Weight |
Gets the weight of the font, defaulting to Regular if unspecified. |
Methods
Equals(Object) |
Determines whether the specified object is equal to this font. |
GetHashCode() |
Returns the hash code for this font. |
OfSize(String, Double, FontWeight, FontSlant, Boolean) |
Creates a font with the specified family, size, weight, slant, and auto-scaling. |
SystemFontOfSize(Double, FontWeight, FontSlant, Boolean) |
Returns a system font of the specified size, weight, slant, and auto-scaling. |
SystemFontOfWeight(FontWeight, FontSlant, Boolean) |
Returns a font instance with the specified weight, slant, and auto-scaling with a default size. |
ToString() |
Returns a string that represents this font. |
WithAutoScaling(Boolean) |
Returns a new Font with auto-scaling enabled or disabled. |
WithSize(Double) |
Returns a new Font with the specified size. |
WithSlant(FontSlant) |
Returns a new Font with the specified slant (style). |
WithWeight(FontWeight, FontSlant) |
Returns a new Font with the specified weight and slant. |
WithWeight(FontWeight) |
Returns a new Font with the specified weight. |
Operators
Equality(Font, Font) |
Determines whether two fonts are equal. |
Inequality(Font, Font) |
Determines whether two fonts are not equal. |
Explicit Interface Implementations
IEquatable<Font>.Equals(Font) |
Extension Methods
GetFontAttributes(Font) | |
WithAttributes(Font, FontAttributes) |