ReadGlyph(ReadOnlySpan) Method

Definition

Namespace Broadside.Fonts
Assembly Broadside.dll

Reads the glyph of the first character code of text.

public CidGlyph ReadGlyph(ReadOnlySpan<byte> text)

Parameters

text
ReadOnlySpan<Byte>

The rest of a string shown with this font.

Returns

CidGlyph
The code (advance by its Length), its CID, the glyph id and the CID's metrics. Without a descendant CIDFont, the glyph id is 0 and the metrics are the defaults (width 1000, DW2 [880 −1000]).

Remarks

ISO 32000-2 §9.7.6.2: the CMap splits the code off (per-byte codespace matching) and maps it to a CID. §9.7.6.3: an invalid code, or one without a mapping, selects CID 0; when the CIDFont has no glyph for the CID, the code's notdef mapping is tried, then the glyph of CID 0. §9.7.4.2: the CID the code maps to gives the metrics even when another glyph is shown. A CIDFont drawn with a substitute whose CIDs reach no Unicode table (Adobe-Identity, Substitute) tries, before the notdef mapping, the substitute's glyph for the one character the font's ToUnicode CMap gives the code.

Allocates nothing once the font's tables are built. An invalid code is recorded once per font.