Table of Contents

Struct ShapedGlyph

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Represents a single shaped glyph: the result of substitution and positioning, before line breaking.

public readonly struct ShapedGlyph
Inherited Members

Remarks

Advances and offsets are scaled to the size of the font the run was shaped against and preserve the shaper's Y-up coordinate system.

Properties

AdvanceHeight

Gets the scaled vertical advance after positioning features have been applied.

public float AdvanceHeight { get; }

Property Value

float

AdvanceWidth

Gets the scaled horizontal advance after positioning features have been applied.

public float AdvanceWidth { get; }

Property Value

float

GlyphId

Gets the glyph identifier within the font the run was shaped against. Glyph id 0 is the font's missing glyph, produced when the font cannot map the character.

public ushort GlyphId { get; }

Property Value

ushort

GraphemeIndex

Gets the zero-based grapheme index in the input text.

public int GraphemeIndex { get; }

Property Value

int

Offset

Gets the scaled placement offset in Y-up shaping space. The offset positions the glyph outline relative to its pen position and does not contribute to the advance.

public Vector2 Offset { get; }

Property Value

Vector2

StringIndex

Gets the zero-based index of the first input char represented by this glyph.

public int StringIndex { get; }

Property Value

int

Remarks

Glyphs produced from the same input chars share this value.