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
RenderDecorationsTo(IGlyphRenderer, Vector2, GlyphLayoutMode, Matrix3x2, float, TextOptions)
Renders text decorations, such as underline, strikeout, and overline, for the current glyph to the specified glyph renderer at the given location and layout mode.
protected void RenderDecorationsTo(IGlyphRenderer renderer, Vector2 location, GlyphLayoutMode mode, Matrix3x2 transform, float scaledPPEM, TextOptions options)
Parameters
rendererIGlyphRendererThe glyph renderer that receives the decoration drawing commands.
locationVector2The position, in device-independent coordinates, where the decorations should be rendered relative to the glyph.
modeGlyphLayoutModeThe layout mode that determines the orientation and positioning of the decorations (e.g., horizontal, vertical, or vertical rotated).
transformMatrix3x2The transformation matrix applied to the decoration coordinates before rendering.
scaledPPEMfloatThe scaled pixels-per-em value used to adjust decoration size and positioning for the current rendering context.
optionsTextOptionsAdditional text rendering options that may influence decoration appearance or behavior.
Remarks
When rendering in vertical layout modes, decoration positions are synthesized to match common typographic conventions. The renderer may override which decorations are enabled. Overline thickness is derived from underline metrics if not explicitly specified.
ShouldSkipGlyphRendering(CodePoint)
Gets a value indicating whether the specified code point should be skipped when rendering.
protected static bool ShouldSkipGlyphRendering(CodePoint codePoint)
Parameters
codePointCodePointThe code point.