MeasureWidth(ReadOnlySpan, Double, Boolean) Method

Definition

Namespace Broadside.Fonts
Assembly Broadside.dll

Measures the advance of text shown at fontSize: the sum of its glyph widths, and of the font's kerning between neighbouring glyphs when kerning.

public double MeasureWidth(ReadOnlySpan<char> text, double fontSize, bool kerning)

Parameters

text
ReadOnlySpan<Char>

The text.

fontSize
Double

The font size (Tf's size operand).

kerning
Boolean

Whether to add the font's kerning, as ShowText(ReadOnlySpan<Char>, Boolean) with kerning shows it.

Returns

Double
The advance in unscaled text space units, without character spacing, word spacing or horizontal scaling.

Remarks

ISO 32000-2 §9.2.4 and §9.4.4 (with Tc = Tw = 0 and Th = 1); the kerning is the font's own (for a Standard 14 font, the AFM KPX pairs).