![]() |
2 vuotta sitten | |
---|---|---|
.. | ||
README.md | 2 vuotta sitten | |
compress.js | 2 vuotta sitten | |
optimize.js | 2 vuotta sitten | |
parse.js | 2 vuotta sitten |
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).
The following primitives used during encoding of the file:
The first byte is a header:
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):
The metadata record header bit 4-0 contain id of the metadata:
The records that have types 0 – 5, have the following fields in the header:
The amount of entries encoded as UN follows the header. The items records follow (see below).
Represents the following CMap block:
n begincodespacerange endcodespacerange
First record format is:
Next record format is:
Represents the following CMap block:
n beginnotdefrange code endnotdefrange
First record format is:
Next record format is:
Represents the following CMap block:
n begincidchar code endcidchar
First record format is:
Next record format is:
Represents the following CMap block:
n begincidrange code endcidrange
First record format is:
Next record format is:
Represents the following CMap block:
n beginbfchar
endbfchar
First record format is:
- char as B[ucs2Size], where ucs2Size = 2 (here and below)
- code as B[dataSize]
Next record format is:
- if sequence = 0, charDelta as UN[ucs2Size], char = charDelta + charDelta + 1
- if sequence = 1, char = char + 1
- codeDelta as SB[dataSize], code = code + codeDelta
Represents the following CMap block:
n beginbfrange
endbfrange
First record format is:
- start as B[ucs2Size]
- endDelta as UB[ucs2Size], end is calculated as (start + endDelta)
- code as B[dataSize]
Next record format is:
- if sequence = 0, startDelta as UB[ucs2Size], start = end + startDelta + 1
- if sequence = 1, start = end + 1
- endDelta as UB[ucs2Size], end = start + endDelta
- code as B[dataSize]