Class FontGlyphMetrics
Represents a glyph metric from a particular font face.
public abstract class FontGlyphMetrics
- Inheritance
-
FontGlyphMetrics
- Derived
- Inherited Members
Properties
AdvanceHeight
Gets the advance height for vertical layout, expressed in font units.
public ushort AdvanceHeight { get; }
Property Value
AdvanceWidth
Gets the advance width for horizontal layout, expressed in font units.
public ushort AdvanceWidth { get; }
Property Value
BottomSideBearing
Gets the bottom side bearing for vertical layout, expressed in font units.
public short BottomSideBearing { get; }
Property Value
CodePoint
Gets the Unicode codepoint of the glyph.
public CodePoint CodePoint { get; }
Property Value
GlyphId
Gets the id of the glyph within the font tables.
public ushort GlyphId { get; }
Property Value
GlyphType
Gets the glyph type.
public GlyphType GlyphType { get; }
Property Value
Height
Gets the height, expressed in font units.
public float Height { get; }
Property Value
LeftSideBearing
Gets the left side bearing for horizontal layout, expressed in font units.
public short LeftSideBearing { get; }
Property Value
RightSideBearing
Gets the right side bearing for horizontal layout, expressed in font units.
public short RightSideBearing { get; }
Property Value
ScaleFactor
Gets the scale factor that is applied to all glyphs in this face. Normally calculated as 72 * UnitsPerEm so that 1pt = 1px unless the glyph has TextAttributes that apply scaling adjustment.
public Vector2 ScaleFactor { get; }
Property Value
TextAttributes
Gets the text attributes applied to the glyph.
public TextAttributes TextAttributes { get; }
Property Value
TextDecorations
Gets the text decorations applied to the glyph.
public TextDecorations TextDecorations { get; }
Property Value
TopSideBearing
Gets the top side bearing for vertical layout, expressed in font units.
public short TopSideBearing { get; }
Property Value
UnitsPerEm
Gets the number of font units per EM square for this face.
public ushort UnitsPerEm { get; }
Property Value
Width
Gets the width, expressed in font units.
public float Width { get; }
Property Value
Methods
ShouldSkipGlyphRendering(CodePoint)
Gets a value indicating whether the specified code point should be skipped when rendering: line terminators participate in layout but have no glyph to draw.
protected static bool ShouldSkipGlyphRendering(CodePoint codePoint)
Parameters
codePointCodePointThe code point.
Returns
TryGetHintedAdvanceWidth(float, float, HintingMode, out float)
Attempts to compute the whole pixel advance width for the glyph under full hinting. Outline formats that grid fit under Full override this so layout can accumulate whole pixel advances matching the fitted outlines. The base implementation never applies: glyphs without fitted outlines keep their shaped fractional advances. Implementations must not execute hinting or touch outline caches, as this runs on the layout hot path.
public virtual bool TryGetHintedAdvanceWidth(float pointSize, float dpi, HintingMode hintingMode, out float advancePx)
Parameters
pointSizefloatThe font size in pt units.
dpifloatThe DPI (Dots Per Inch) to render/measure the glyph at
hintingModeHintingModeThe requested hinting mode.
advancePxfloatThe advance width in whole device pixels.