Class Font
Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
public class Font : DisposableObject, IBaseObject, IDisposableObject, IDisposable, IEquatable<Font>
- Inheritance
-
Font
- Implements
Constructors
- Font(Font, FontStyle)
Initializes a new Font that uses the specified existing Font and FontStyle enumeration.
- Font(Font, double)
Initializes a new Font that uses the specified existing Font and
newSize
parameter.
- Font(FontFamily, double)
Initializes a new Font using a specified size.
- Font(FontFamily, double, FontStyle)
Initializes a new Font using a specified font family, size in points and style.
- Font(FontFamily, double, FontStyle, GraphicsUnit)
Initializes a new Font using a specified size, style, and unit.
- Font(FontFamily, double, FontStyle, GraphicsUnit, byte)
Initializes a new Font using a specified size, style, unit, and character set.
- Font(FontFamily, double, FontStyle, GraphicsUnit, byte, bool)
Initializes a new Font using a specified size, style, unit, and character set.
- Font(FontFamily, float, GraphicsUnit)
Initializes a new Font using a specified size and unit. Sets the style to Regular.
- Font(IFontHandler)
Initializes a new Font using a specified font handler.
- Font(string, double)
Initializes a new Font using a specified size.
- Font(string, double, FontStyle)
Initializes a new Font using a specified font familty name, size in points and style.
- Font(string, double, FontStyle, GraphicsUnit)
Initializes a new Font using a specified size, style, and unit.
- Font(string, double, FontStyle, GraphicsUnit, byte)
Initializes a new Font using a specified size, style, unit, and character set.
- Font(string, double, FontStyle, GraphicsUnit, byte, bool)
Initializes a new Font using the specified size, style, unit, and character set.
- Font(string, double, GraphicsUnit)
Initializes a new Font using a specified size and unit. The style is set to Regular.
Properties
- AsBold
Returns bold version of the font.
- AsStrokeAndFillPaint
Gets SKPaint for this font with StrokeAndFill style.
- AsUnderlined
Returns underlined version of the font.
- Default
Gets the default font used in the application.
- DefaultMono
Gets the default fixed width font used in the application.
- FontFamily
Gets the FontFamily associated with this Font.
- GdiCharSet
Gets a byte value that specifies the character set that this Font uses.
- GdiVerticalFont
Gets a bool value that indicates whether this Font is derived from a vertical font.
- Handler
Gets native font.
- IsFixedWidth
Gets whether this font is a fixed width (or monospaced) font.
- IsStrikeout
Same as IsStrikethrough.
- IsStrikethrough
Gets a value that indicates whether this Font specifies a horizontal line through the font.
- IsUnderlined
Gets a value that indicates whether this Font is underlined.
- IsUsingSizeInPixels
Gets whether font size is in pixels.
- NumericWeight
Gets the font weight as an integer value.
- OriginalFontName
Gets the name of the font originally specified.
- SizeInDips
Gets the size in dips.
- SizeInPixels
Gets the pixel size.
- SizeInPoints
Gets the em-size, in points, of this Font.
- SkiaMetrics
Gets SKFontMetrics for this font.
- Weight
Gets the font weight.
Methods
- ChangeFontStyle(FontStyle, FontStyle, bool)
Turns on or off FontStyle element(s).
- CheckSize(double)
If font size is correct, returns it; otherwise returns default font size.
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- Equals(Font?)
Indicates whether the current object is equal to another object of the same type.
- Equals(object?)
Determines whether the specified object is equal to the current object.
- Equals(string, double, FontStyle)
Indicates whether the current objects properties are equal to the specified properties.
- FromInternal(IFontHandler?)
Creates Font from native font.
- GetDefaultOrNew(string, double, FontStyle, Font?)
Creates new font or gets
defaultFont
if its properties are equal to the specified.
- GetFontStyleArraySize()
Gets size of the array with FontStyle as index.
- GetHashCode()
Serves as the default hash function.
- GetNumericWeightOf(FontWeight)
Helper function for converting FontWeight enum value to the numeric weight.
- GetSkiaWidthClosestToNumericValue(int)
Helper function for converting arbitrary numeric width to the closest value of SKFontStyleWidth enum.
- GetWeightClosestToNumericValue(int)
Helper function for converting arbitrary numeric weight to the closest value of FontWeight enum.
- IsVerticalName(string?)
Gets whether font name is from vertical font (starts with @ char).
- Larger()
Returns a larger version of this font.
- Scaled(double)
Returns a scaled version of this font.
- Smaller()
Returns a smaller version of this font.
- ToInfoString()
Returns a human-readable string representation of this Font.
- ToString()
Returns a string that represents the current object.
- WithName(string)
Returns font with same parameters, but with different name.
- WithStyle(FontStyle)
Returns font with same name and size, but with different FontStyle.
Operators
- operator ==(Font?, Font?)
Returns a value that indicates whether the two objects are equal.
- implicit operator FontNameAndSize(Font)
Converts the specified Font to a FontNameAndSize.
- implicit operator Font(FontNameAndSize)
Converts the specified FontNameAndSize to a Font.
- operator !=(Font?, Font?)
Returns a value that indicates whether the two objects are not equal.