SystemFontDescriptor Class
A face of a font installed on the machine: the file that holds it, and its names and its style, read without loading the font.
public sealed class SystemFontDescriptorRemarks
A descriptor is immutable and can be used by several threads at the same time. To use the face, load SystemFontDescriptor.FilePath and take the face at SystemFontDescriptor.FaceIndex. The file may have changed or been removed since the fonts were scanned: loading it can fail.
The characters of the face (SystemFontDescriptor.Covers) are read from its file the first time they are asked for, not when the fonts are scanned.
Properties
| Name | Description |
|---|---|
| Axes | Gets the axes of a variable font, empty for a font that is not variable. |
| FaceIndex | Gets the index of the face in the file: 0, or its index in a font collection. |
| FamilyName | Gets the preferred family name: the typographic family name, else the family name, else an empty string. |
| FamilyNames | Gets the names the face is found by in SystemFontCollection.GetFamily: the typographic family names and the family names, in every language of the name table, each one once. |
| FilePath | Gets the full path of the font file. |
| FullName | Gets the full name of the face (name 4 of the name table), or null when the font has none. |
| HasOs2 | Gets whether the face has an OS/2 table. |
| IsItalic | Gets whether the face is italic: bit 0 of OS/2.fsSelection, else bit 1 of head.macStyle. |
| IsMonospaced | Gets whether the face is monospaced (post.isFixedPitch). |
| IsOblique | Gets whether the face is oblique rather than italic: bit 9 of OS/2.fsSelection. |
| ItalicAngle | Gets the italic angle of the post table, in degrees counter-clockwise from the vertical. |
| MacStyle | Gets the head.macStyle field. |
| PostScriptName | Gets the PostScript name of the face, or null when the font has none. |
| Selection | Gets the OS/2.fsSelection field, 0 without an OS/2 table. |
| SubfamilyName | Gets the preferred subfamily name, such as Bold Italic, else an empty string. |
| Weight | Gets the weight class: OS/2.usWeightClass, else 700 or 400 from head.macStyle. |
| WidthClass | Gets the width class, OS/2.usWidthClass: from 1 (ultra-condensed) to 9 (ultra-expanded), 5 without an OS/2 table. |
Gets the axes of a variable font, empty for a font that is not variable.
public ReadOnlySpan<FontAxisRecord> Axes { get; }Property value
FaceIndex
SystemFontDescriptor.csFamilyName
SystemFontDescriptor.csGets the preferred family name: the typographic family name, else the family name, else an empty string.
public string FamilyName { get; }FamilyNames
SystemFontDescriptor.csGets the names the face is found by in SystemFontCollection.GetFamily: the typographic family names and the family names, in every language of the name table, each one once.
public IReadOnlyList<string> FamilyNames { get; }Property value
FilePath
SystemFontDescriptor.csFullName
SystemFontDescriptor.csHasOs2
SystemFontDescriptor.csIsItalic
SystemFontDescriptor.csIsMonospaced
SystemFontDescriptor.csIsOblique
SystemFontDescriptor.csItalicAngle
SystemFontDescriptor.csMacStyle
SystemFontDescriptor.csPostScriptName
SystemFontDescriptor.csSelection
SystemFontDescriptor.csSubfamilyName
SystemFontDescriptor.csWeight
SystemFontDescriptor.csWidthClass
SystemFontDescriptor.csMethods
| Name | Description |
|---|---|
| Covers(Rune) | Determines whether the face has a glyph for a character. |
| ToString() | Returns a string that represents the current object. |
Covers(Rune)
SystemFontDescriptor.csDetermines whether the face has a glyph for a character.
Parameters
characterRune- The character.
Returns
bool true when the character map of the face gives the character a glyph other than the missing glyph, as a loaded face does; false when it does not, or when the file can no longer be read or its character map is malformed.
Remarks
The first call reads the character map (the cmap table) of the face from its file, and keeps the characters it has with the collection, as ranges of characters. The characters of the faces of a collection are kept within a bounded amount of memory: when it is reached, the ones that were read first are dropped, and read again when they are needed. Scanning the fonts reads no character map.