Parses a CMap file, such as the data of an embedded CMap stream.
public static CMap Parse(ReadOnlySpan<byte> data, CMapContext? context = null)
The CMap file, decoded.
Limits, reading mode and the diagnostics sink; null for a lenient stand-alone parse.
Adobe TN 5014 §7 (lexical elements, operators, file order) and ISO 32000-2 §9.7.5.4: begincodespacerange,
begincidrange, begincidchar, beginnotdefrange, beginnotdefchar, usecmap, CMapName,
WMode and CIDSystemInfo. beginbfchar and beginbfrange are not allowed in a CMap used as an encoding
(§9.7.5.4 c): their destinations are read as CIDs, as viewers do, with a diagnostic. The block counts are not trusted: each
block runs to its end operator. Operators glued to what follows them (endcidchar1) are split.
A usecmap standing alone can only resolve Identity-H or Identity-V; another name of Table 116 is
recorded as unavailable and only its codespace is used, and any other name is recorded and the CMap read without a parent.
Inside a document, predefined CMaps come from the engine's font resolvers (the Broadside.Fonts.Cmaps package), and the
stream's UseCMap entry may name another embedded CMap stream.