The format is designed to package some information from the CMap files located at external/cmap. Please notice for size optimization reasons, the original information blocks can be changed (split or joined) and items in the blocks can be swapped.
The data stored in binary format in network byte order (big-endian).
# Data primitives
The following primitives used during encoding of the file:
- byte (B) – a byte, bits are numbered from 0 (less significant) to 7 (most significant)
- bytes block (B[n]) – a sequence of n bytes
- unsigned number (UN) – the number is encoded as sequence of bytes, bit 7 is flag to continue decoding the byte, bits 6-0 store number information, e.g. bytes 0x818407 will represent 16903 (0x4207). Limited to the 32 bit.
- signed number (SN) – the number is encoded as sequence of bytes, as UN, however shall be transformed before encoding: if n <0,thenshallbeencodedas(-2*n-1)usingUNencoding,othernshallbeencodedas(2*n)usingUNencoding.Sothelowestbitofthenumberindicatesthesignoftheinitialnumber
- unsigned fixed number (UB[n]) – similar to the UN, but it represents an unsigned number that is stored in B[n]
- signed fixed number (SB[n]) – similar to the SN, but it represents a signed number that is stored in B[n]
- string (S) – the string is encoded as sequence of bytes. First comes length is characters encoded as UN, when UTF16 characters encoded as UN.
# File structure
The first byte is a header:
- bits 2-1 – indicate a CMapType. Valid values are 1 and 2
- bit 0 – indicate WMode. Valid values are 0 and 1.
Then records follow. The records starts from the record header encoded as B, where bits 7-5 indicate record type (see description of other bits below):
- 0 – codespacerange
- 1 – notdefrange
- 2 – cidchar
- 3 – cidrange
- 4 – bfchar
- 5 – bfrange
- 6 – reserved
- 7 – metadata
## Metadata record
The metadata record header bit 4-0 contain id of the metadata: