Table of Contents

Class FontGlyphMetrics

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

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

ushort

AdvanceWidth

Gets the advance width for horizontal layout, expressed in font units.

public ushort AdvanceWidth { get; }

Property Value

ushort

BottomSideBearing

Gets the bottom side bearing for vertical layout, expressed in font units.

public short BottomSideBearing { get; }

Property Value

short

CodePoint

Gets the Unicode codepoint of the glyph.

public CodePoint CodePoint { get; }

Property Value

CodePoint

GlyphId

Gets the id of the glyph within the font tables.

public ushort GlyphId { get; }

Property Value

ushort

GlyphType

Gets the glyph type.

public GlyphType GlyphType { get; }

Property Value

GlyphType

Height

Gets the height, expressed in font units.

public float Height { get; }

Property Value

float

LeftSideBearing

Gets the left side bearing for horizontal layout, expressed in font units.

public short LeftSideBearing { get; }

Property Value

short

RightSideBearing

Gets the right side bearing for horizontal layout, expressed in font units.

public short RightSideBearing { get; }

Property Value

short

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

Vector2

TextAttributes

Gets the text attributes applied to the glyph.

public TextAttributes TextAttributes { get; }

Property Value

TextAttributes

TextDecorations

Gets the text decorations applied to the glyph.

public TextDecorations TextDecorations { get; }

Property Value

TextDecorations

TopSideBearing

Gets the top side bearing for vertical layout, expressed in font units.

public short TopSideBearing { get; }

Property Value

short

UnitsPerEm

Gets the number of font units per EM square for this face.

public ushort UnitsPerEm { get; }

Property Value

ushort

Width

Gets the width, expressed in font units.

public float Width { get; }

Property Value

float

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

renderer IGlyphRenderer

The glyph renderer that receives the decoration drawing commands.

location Vector2

The position, in device-independent coordinates, where the decorations should be rendered relative to the glyph.

mode GlyphLayoutMode

The layout mode that determines the orientation and positioning of the decorations (e.g., horizontal, vertical, or vertical rotated).

transform Matrix3x2

The transformation matrix applied to the decoration coordinates before rendering.

scaledPPEM float

The scaled pixels-per-em value used to adjust decoration size and positioning for the current rendering context.

options TextOptions

Additional 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

codePoint CodePoint

The code point.

Returns

bool

The bool.