itext-java
itext-java copied to clipboard
Add support for platform 0, platform encoding 3 in TTF/OTF 'cmap' table
This is one of the ways to represent the Unicode BMP, and for our purposes can be handled in approximately the same way as (3, 1). It's used (among other places) in some of the fonts that ship with macOS.
The test font files included in this commit were generated from this file: https://github.com/RazrFalcon/ttf-parser/blob/337e7d1c08b06478a84c4345f4f289fc2cb9210c/tests/fonts-src/glyphs.ttx. I applied a few minor modifications to allow iText to open the font (required re-adding the name table) and to increase test coverage (by creating a version using a format 6 cmap subtable as well). The content in the linked repo is dual-licensed under MIT and Apache 2, so that should be OK.