FontFace Class
A font face (https://drafts.csswg.org/css-font-loading/#fontface-interface), created by a script or by an @font-face rule of a style sheet of the document (a CSS-connected font face, whose attributes reflect the descriptors of the rule).
public sealed class FontFaceRemarks
Loading a font face fetches its sources (with the DocumentLoader of the browsing context, or from a data: URL) until one of them is a valid font file (an OpenType, TrueType or collection file, WOFF or WOFF2, decoded and validated by the managed font reader). The local() sources are the bundled fonts (the installed fonts of the library, see BundledFonts), matched by full name or PostScript name.
See also
Constructors
| Name | Description |
|---|---|
| FontFace(string, ReadOnlySpan<byte>, FontFaceDescriptors?) | Creates a font face from the binary data of a font file. |
| FontFace(string, string, FontFaceDescriptors?) | Creates a font face whose source is a list of URLs (the value of the src descriptor of @font-face, e.g. url(font.woff)). |
FontFace overloads
FontFace(string, ReadOnlySpan<byte>, FontFaceDescriptors?)
FontFace.csCreates a font face from the binary data of a font file.
public FontFace(string family, ReadOnlySpan<byte> source, FontFaceDescriptors? descriptors = null)FontFace(string, string, FontFaceDescriptors?)
FontFace.csCreates a font face whose source is a list of URLs (the value of the src descriptor of @font-face, e.g. url(font.woff)).
public FontFace(string family, string source, FontFaceDescriptors? descriptors = null)Properties
| Name | Description |
|---|---|
| AscentOverride | Gets or sets the ascent-override descriptor of the font face. |
| DescentOverride | Gets or sets the descent-override descriptor of the font face. |
| Display | Gets or sets the font-display descriptor of the font face. |
| Family | Gets or sets the font-family descriptor of the font face. |
| FeatureSettings | Gets or sets the font-feature-settings descriptor of the font face. |
| Features | Gets the features of the font face. |
| LineGapOverride | Gets or sets the line-gap-override descriptor of the font face. |
| Loaded | The [[FontStatusPromise]]: fulfilled when the font face is loaded, rejected when it fails to load. |
| Palettes | Gets the color palettes of the font face. |
| SizeAdjust | Gets or sets the size-adjust descriptor of the font face. |
| Status | Gets the load status of the font face. |
| Stretch | The legacy name alias of FontFace.Width. |
| Style | Gets or sets the font-style descriptor of the font face. |
| UnicodeRange | Gets or sets the unicode-range descriptor of the font face. |
| VariationSettings | Gets or sets the font-variation-settings descriptor of the font face. |
| Variations | Gets the variation axes of the font face: the axes of the font once it is loaded. |
| Weight | Gets or sets the font-weight descriptor of the font face. |
| Width | Gets or sets the font-width descriptor of the font face. |
AscentOverride
FontFace.csGets or sets the ascent-override descriptor of the font face.
public string AscentOverride { get; set; }DescentOverride
FontFace.csGets or sets the descent-override descriptor of the font face.
public string DescentOverride { get; set; }Display
FontFace.csGets or sets the font-display descriptor of the font face.
public string Display { get; set; }Family
FontFace.csGets or sets the font-family descriptor of the font face.
public string Family { get; set; }FeatureSettings
FontFace.csGets or sets the font-feature-settings descriptor of the font face.
public string FeatureSettings { get; set; }Features
FontFace.csLineGapOverride
FontFace.csGets or sets the line-gap-override descriptor of the font face.
public string LineGapOverride { get; set; }Loaded
FontFace.csThe [[FontStatusPromise]]: fulfilled when the font face is loaded, rejected when it fails to load.
Palettes
FontFace.csGets the color palettes of the font face.
public FontFacePalettes Palettes { get; }Property value
See also
SizeAdjust
FontFace.csGets or sets the size-adjust descriptor of the font face.
public string SizeAdjust { get; set; }Status
FontFace.csGets the load status of the font face.
public FontFaceLoadStatus Status { get; }Property value
See also
Stretch
FontFace.csThe legacy name alias of FontFace.Width.
public string Stretch { get; set; }Style
FontFace.csGets or sets the font-style descriptor of the font face.
public string Style { get; set; }UnicodeRange
FontFace.csGets or sets the unicode-range descriptor of the font face.
public string UnicodeRange { get; set; }VariationSettings
FontFace.csGets or sets the font-variation-settings descriptor of the font face.
public string VariationSettings { get; set; }Property value
See also
Variations
FontFace.csGets the variation axes of the font face: the axes of the font once it is loaded.
public FontFaceVariations Variations { get; }Property value
See also
Weight
FontFace.csGets or sets the font-weight descriptor of the font face.
public string Weight { get; set; }Width
FontFace.csGets or sets the font-width descriptor of the font face.
public string Width { get; set; }Methods
| Name | Description |
|---|---|
| Load() | Loads a font face whose source is a list of URLs (https://drafts.csswg.org/css-font-loading/#font-face-load). |
Load()
FontFace.csLoads a font face whose source is a list of URLs (https://drafts.csswg.org/css-font-loading/#font-face-load).