Menu

Chromium turned my CFF OpenType font into Type 3 at every fsType value I tried
📰

Chromium turned my CFF OpenType font into Type 3 at every fsType value I tried

DEV Community: javascript·hao jia·about 3 hours ago
#NZdJB8ay
#devtojavascript#devto#dev#font#fonts
Reading 0:00
15s threshold

Which fonts survive "print to PDF" as real fonts, and which ones turn into drawing instructions? That decides what a PDF-to-HTML converter can later hand back to a browser as a web font. The fsType flag in the font's OS/2 table is the obvious suspect. In the one test below, it explained two of three fonts and nothing for the third.

Three fonts, six fsType values each

The test is small. I took Pacifico and Liberation Sans (both TrueType outlines) and Noto Serif SC (CFF outlines in an .otf ), all open-licensed. For each one I made six local copies with fsType set to 0, 2, 4, 8, 256 and 512, and printed one page of mixed English and Chinese text to PDF with Chromium 149. Then I read the font objects out of each PDF. The modified copies never left my machine.

For the TrueType fonts the flag mattered. Values 4 and 8 gave a normal embedded subset. Values 2 and 512 gave no embedded font at all, and the glyphs were written as Type 3 outlines instead.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.