One of the issues we get a lot with PDFs is the issue of non-embedded fonts. There are types of fonts in a PDF file:-
1. Fonts belonging to the 8 defined families (Arial, Helvetica,etc) defined as being in a PDF Viewer.
2. Embedded fonts – all the font data is included in the PDF so we can draw the fonts.
3. Non-embedded fonts. Because Adobe does not enforce the first 2 cases, it is perfectly possible to have a font where we only have the name (ie Frigate). The PDF Creator is relying on the user having a local copy of a font called Frigate which the viewer will then use. This also assumes my version of Frigate is the same as yours.
This makes like very hard for a PDF viewer (especially if you want to be cross platform or run on a virtual machine). So this is how we deal with such fonts:-
A. If there is a local font of the same name available use that.
B. If there seems to be an obvious match (Arial Bold would seem a good match for ArialMT and ArialNarrow while we can use TimesNewRoman is TimesNewRomanPS). We do this through a mix of pattern matching and our lookup table in FontMappings class.
This works very well but it is not perfect. So what do we do about Frigate?
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.