A CMap: how the bytes of a string shown in a composite font split into character codes, and which CID each code selects.
public sealed class CMap
ISO 32000-2 §9.7.5 and §9.7.6.2-§9.7.6.3; Adobe TN 5014 §5 and §7.4 (the CMap file format); Adobe TN 5099 §1.3. The two Identity CMaps (§9.7.5.2, Table 116) are built in (IdentityH, IdentityV); an embedded CMap stream is parsed by Parse(ReadOnlySpan<Byte>, CMapContext?) or reached through Encoding. The other predefined CMaps of Table 116 ship in a separate package.
A CMap that uses another (usecmap, UseCMap) keeps it as its Parent: its own mappings win, the
parent's apply to codes it does not map, and its codespace is its own ranges and the parent's. Where a CMap's own mappings
overlap, the later one wins (TN 5014 §5.2). Ranges are kept as ranges, never expanded code by code.
Thread safety: a CMap is immutable and shared by every font and thread that uses it. Reading a code and looking up its CID allocate nothing.
kind:method, kind:property, kind:ctor. Press Esc to clear.IdentityHGets the predefined Identity-H CMap: two-byte codes 0000 to FFFF, each mapping to the CID of the same value, horizontal.IsIdentityGets a value indicating whether this is one of the built-in Identity CMaps.NameGets the CMap's name (CMapName), or null when the file gives none.ParentGets the CMap this one uses (usecmap, the stream's UseCMap), or null.SystemInfoGets the character collection the CMap maps to (CIDSystemInfo), or null when the file gives none.WritingModeGets the writing mode the CMap selects (WMode); horizontal unless the file says 1.GetCid(CharacterCode)Returns the CID a code selects: its character mapping, else its notdef mapping, else 0.Parse(ReadOnlySpan<Byte>, CMapContext?)Parses a CMap file, such as the data of an embedded CMap stream.ReadCode(ReadOnlySpan<Byte>)Reads the character code at the start of text.TryGetCid(CharacterCode, out Int32)Looks up a code's character mapping (cidchar, cidrange), in this CMap and then its parents.TryGetNotdefCid(CharacterCode, out Int32)Looks up a code's notdef mapping (notdefchar, notdefrange), in this CMap and then its parents.