One of the most important visual elements of any document is the fonts. The PDF format has great support for fonts, allowing you to embed Type 1, CFF, TrueType, OpenType, and many more kinds of fonts.
One of the problems we’ve faced when writing our PDF2HTML converter is that Web browsers have much more limited font support – TrueType and OpenType are supported in most modern browsers, but Type 1 and CFF support is nowhere to be found.
As a result of this, we’ve been working on a lot of code for converting various types of fonts into OpenType to get the maximum level of support across browsers. For some, this is easy – for instance, it is possible to create an OpenType font by wrapping up a CFF font and adding a number of additional tables. (Although even this is not without complications…)
Our most recent release included a lot of code for dealing with CID Identity fonts, which are often used due to a bug in Adobe’s Creative Suite. By default these files contain no mapping from characters (the concept of a letter – ‘A’ or ‘B’) to glyphs (A specific letter – the ‘A’ of Times New Roman, for instance), which means it is impossible to extract meaningful text data from them. Thanks to our new code, they will at least display properly in browsers.
Upcoming enhancements include support for CID fonts with ToUnicode arrays attached, support for converting Type 1 fonts to OpenType, and we have also just started on allowing TrueType to OpenType conversion, too.
What would you most like to see in terms of font development?
This post is part of our “Fonts Articles Index” in these articles we explore Fonts.
IDRsolutions develop a Java PDF library, a PDF forms to HTML5 converter, a PDF to HTML5 or SVG converter and a Java Image Library that doubles as an ImageIO replacement. On the blog our team post about anything interesting they learn about.