pdf-raku / PDF-Font-Loader-raku

Font loader for the PDF tool-chain
Artistic License 2.0
1 stars 3 forks source link

Encode new CMaps as UTF8 #10

Closed dwarring closed 3 years ago

dwarring commented 3 years ago

Rework PDF::Font::Loader::Enc to directly write utf-8 variable encoding for new CMaps.

Codespace range for UTF-8 encoding is, from https://adobe-type-tools.github.io/font-tech-notes/pdfs/5099.CMapResources.pdf:

4 begincodespacerange
  <00>       <7F>
  <C080>     <DFBF>
  <E08080>   <EFBFBF>
  <F0808080> <F7BFBFBF
endcodespacerange
dwarring commented 3 years ago

PDF::Font::Loader v0.5.9 release includes utf8, utf16 and utf32 encoding and decoding.

I've held off setting it as default encoding. utf-8 font encoding in PDF's seems to be fairly rare. Not mentioned in ISO-32000 (utf16 and 32 are). I haven't found example yet.

For now will identity-h as default 'wide' encoder and mark this a experimental.