Search code examples
pdffontspostscript

Ranges in CMap files


In a CMap file (for use in PostScript or PDF documents), is it allowed to have CID ranges where the start end end codes differ in more than the last byte? For example, would the following be valid?

1 begincodespacerange
<3030> <3232>
endcodespacerange

1 begincidrange
<3030> <3232> 34
endcidrange

If this is valid, which code would be used for CID 35? Is guess it should be code <3031>, but I didn't find any documentation which actually makes this explicit.

If checked the following references, but did not find the answers there:

Did I miss any documentation which has more detail?


Solution

  • To answer your three questions:

    1. Yes, but it is not recommended. Some CMap resource consumers may complain.
    2. Yes, but it is not recommended. Some CMap resource consumers may complain.
    3. 3031.
    4. See the first post by K J. (now removed) linked to https://ccjktype.fonts.adobe.com/2012/03/building-utf32-cmaps.html

    Note that your codespacerange definition is for a total of nine code points: 3030, 3031, 3032, 3130, 3131, 3132, 3230, 3231, and 3232.