Shape(String, TextShaping) Method

Definition

Namespace Broadside.Fonts
Assembly Broadside.dll

Shapes text into the glyphs this font shows for it: for an embedded OpenType or TrueType program, its GSUB lookups for the features shaping turns on (ligatures, contextual and localised forms, Arabic joining forms), then its GPOS lookups (pair kerning, marks on their bases, cursive attachment; its legacy kern table when GPOS has no kerning); for other fonts, one glyph per character and pair kerning. A right-to-left run shows each character that has a Bidi_Mirroring_Glyph (parentheses, brackets, less-than) with the glyph of its mirror when the font has one.

public ShapedText Shape(string text, TextShaping shaping)

Parameters

text
String

The text, one script in one direction.

shaping
TextShaping

How the text is shaped (Default for the defaults).

Returns

ShapedText
The shaped text, to show with ShowText(ShapedText) while this font is the canvas's font.

Remarks

OpenType specification, "GSUB — Glyph Substitution Table" (lookup types 1–8), "GPOS — Glyph Positioning Table" (lookup types 1–9), "kern" and "Developing OpenType Fonts for Arabic Script"; Unicode §9.2 (cursive joining); UAX #9 rule L4 (mirroring). Shown glyphs map back to their text through the font's ToUnicode CMap (ISO 32000-2 §9.10.3; a ligature maps to all its characters) or, where it cannot, an ActualText span (§14.9.4).