Table of Contents

Struct VerticalMetrics

Namespace
Egami.Fonts
Assembly
Egami.Fonts.dll

One set of a face's ascent, descent and line gap as stored in a table, in font units with y up.

public readonly record struct VerticalMetrics : IEquatable<VerticalMetrics>
Implements
Inherited Members

Examples

// Character map, advance, ink box and kerning, all in font units with y up.
ushort a = face.GetGlyph('A'), v = face.GetGlyph('V');
float advance = face.GetAdvance(a);
GlyphExtents ink = face.GetGlyphExtents(a);
float kern = face.GetKerning(a, v);
FontExtents extents = face.Extents;

// An outline arrives through a sink: lines and quadratics for TrueType, lines and cubics for CFF.
var counter = new SegmentCounter();
face.GetGlyphOutline(a, counter);

Constructors

VerticalMetrics(int, int, int)

One set of a face's ascent, descent and line gap as stored in a table, in font units with y up.

public VerticalMetrics(int Ascent, int Descent, int LineGap)

Parameters

Ascent int

The distance above the baseline, usually positive.

Descent int

The distance below the baseline, usually negative.

LineGap int

The extra space between lines.

Examples

// Character map, advance, ink box and kerning, all in font units with y up.
ushort a = face.GetGlyph('A'), v = face.GetGlyph('V');
float advance = face.GetAdvance(a);
GlyphExtents ink = face.GetGlyphExtents(a);
float kern = face.GetKerning(a, v);
FontExtents extents = face.Extents;

// An outline arrives through a sink: lines and quadratics for TrueType, lines and cubics for CFF.
var counter = new SegmentCounter();
face.GetGlyphOutline(a, counter);

Properties

Ascent

The distance above the baseline, usually positive.

public int Ascent { get; init; }

Property Value

int

Descent

The distance below the baseline, usually negative.

public int Descent { get; init; }

Property Value

int

LineGap

The extra space between lines.

public int LineGap { get; init; }

Property Value

int