Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
cmap [2020/02/23 11:17] christian [Mappings outside the codespace] |
cmap [2020/02/23 14:26] christian [Char to string mapping] |
||
---|---|---|---|
Line 126: | Line 126: | ||
===== Monster from the wild ===== | ===== Monster from the wild ===== | ||
+ | CMaps are not well defined. Therefore, there are some interesting variations of them in the wild. Here is a small selection of some issues. | ||
+ | ==== Codespace problems ==== | ||
- | ==== Mappings outside the codespace ==== | + | === Wrong code length |
- | single byte mappings in a double byte codespace | + | <code postscript> |
+ | %... | ||
+ | 1 begincodespacerange | ||
+ | < | ||
+ | endcodespacerange | ||
+ | 27 beginbfchar | ||
+ | <20> < | ||
+ | <2E> < | ||
+ | <43> < | ||
+ | <44> < | ||
+ | <45> < | ||
+ | %... | ||
+ | </ | ||
- | Sometimes CMaps define | + | Here are single byte mappings |
- | ==== Wrong PostScript ==== | + | This can be seen often. These illegal mappings are collected into the ''# |
- | using /find instead | + | === Mappings outside the codespace === |
+ | |||
+ | <code postscript> | ||
+ | %... | ||
+ | 1 begincodespacerange | ||
+ | < | ||
+ | endcodespacerange | ||
+ | 11 beginbfchar | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | %... | ||
+ | </code> | ||
+ | |||
+ | Here, only the first mapping matches the code space. All others fall outside | ||
+ | |||
+ | ==== Wrong PostScript ==== | ||
- | See [[postscript# | + | On one occasion, I saw a CMap where the PostScript used a non-existing operator (''/ |
==== Prevent copying ==== | ==== Prevent copying ==== | ||
Line 184: | Line 216: | ||
</ | </ | ||
- | It looks as if two codes (<24> and <50>) are mapped to a string of 2-byte characters. | + | Two codes (<24> and <50>) are mapped to a string of 2-byte characters. |
+ | |||
+ | Seen in a PDF with the '' |