Class FontMetrics
Represents a font face with metrics, which is a set of glyphs with a specific style (regular, italic, bold etc).
public abstract class FontMetrics
- Inheritance
-
FontMetrics
- Inherited Members
Properties
Description
Gets the basic description of the face.
public abstract FontDescription Description { get; }
Property Value
HorizontalMetrics
Gets the metrics specific to horizontal text.
public abstract HorizontalMetrics HorizontalMetrics { get; }
Property Value
ItalicAngle
Gets the italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).
public abstract float ItalicAngle { get; }
Property Value
ScaleFactor
Gets the scale factor that is applied to all glyphs in this face. Calculated as 72 * UnitsPerEm so that 1pt = 1px.
public abstract float ScaleFactor { get; }
Property Value
StrikeoutPosition
Gets the position of the top of the strikeout stroke relative to the baseline in font design units.
public abstract short StrikeoutPosition { get; }
Property Value
StrikeoutSize
Gets thickness of the strikeout stroke in font design units.
public abstract short StrikeoutSize { get; }
Property Value
SubscriptXOffset
Gets the recommended horizontal offset in font design units for subscripts for this font.
public abstract short SubscriptXOffset { get; }
Property Value
SubscriptXSize
Gets the recommended horizontal size in font design units for subscripts for this font.
public abstract short SubscriptXSize { get; }
Property Value
SubscriptYOffset
Gets the recommended vertical offset in font design units for subscripts for this font.
public abstract short SubscriptYOffset { get; }
Property Value
SubscriptYSize
Gets the recommended vertical size in font design units for subscripts for this font.
public abstract short SubscriptYSize { get; }
Property Value
SuperscriptXOffset
Gets the recommended horizontal offset in font design units for superscripts for this font.
public abstract short SuperscriptXOffset { get; }
Property Value
SuperscriptXSize
Gets the recommended horizontal size in font design units for superscripts for this font.
public abstract short SuperscriptXSize { get; }
Property Value
SuperscriptYOffset
Gets the recommended vertical offset in font design units for superscripts for this font.
public abstract short SuperscriptYOffset { get; }
Property Value
SuperscriptYSize
Gets the recommended vertical size in font design units for superscripts for this font.
public abstract short SuperscriptYSize { get; }
Property Value
UnderlinePosition
Gets the suggested distance of the top of the underline from the baseline (negative values indicate below baseline).
public abstract short UnderlinePosition { get; }
Property Value
UnderlineThickness
Gets the suggested values for the underline thickness. In general, the underline thickness should match the thickness of the underscore character (U+005F LOW LINE), and should also match the strikeout thickness, which is specified in the OS/2 table.
public abstract short UnderlineThickness { get; }
Property Value
UnitsPerEm
Gets the number of font units per EM square for this face.
public abstract ushort UnitsPerEm { get; }
Property Value
VerticalMetrics
Gets the metrics specific to vertical text.
public abstract VerticalMetrics VerticalMetrics { get; }
Property Value
Methods
GetAvailableCodePoints()
Gets the unicode codepoints for which a glyph exists in the font.
public abstract ReadOnlyMemory<CodePoint> GetAvailableCodePoints()
Returns
- ReadOnlyMemory<CodePoint>
A read-only memory region containing the available codepoints.
TryGetGlyphMetrics(CodePoint, TextAttributes, TextDecorations, LayoutMode, ColorFontSupport, out FontGlyphMetrics?)
Gets the glyph metrics for a given code point.
public abstract bool TryGetGlyphMetrics(CodePoint codePoint, TextAttributes textAttributes, TextDecorations textDecorations, LayoutMode layoutMode, ColorFontSupport support, out FontGlyphMetrics? metrics)
Parameters
codePointCodePointThe Unicode code point to get the glyph for.
textAttributesTextAttributesThe text attributes applied to the glyph.
textDecorationsTextDecorationsThe text decorations applied to the glyph.
layoutModeLayoutModeThe layout mode applied to the glyph.
supportColorFontSupportOptions for enabling color font support during layout and rendering.
metricsFontGlyphMetricsWhen this method returns, contains the metrics for the given codepoint and color support if the metrics are found; otherwise the default value. This parameter is passed uninitialized.
Returns
TryGetVariationAxes(out ReadOnlyMemory<VariationAxis>)
Tries to get the variation axes that this font supports. The font needs to have a fvar table.
public abstract bool TryGetVariationAxes(out ReadOnlyMemory<VariationAxis> variationAxes)
Parameters
variationAxesReadOnlyMemory<VariationAxis>A read-only memory region containing the variation axes.
Returns
- bool
True, if fvar table is present.