PDF Font Technologies
The thing which makes PDF fonts so confusing for many people is the number of different font technologies which can be used in a PDF file. The PDF file specification has been around for 16 years and in that time a number of different font technologies have appeared (as much for ‘business’ as technological reasons). So this article will briefly explain some of the main font technologies you can use with PDF files.
Adobe was one of the pioneers of producing high quality fonts for electronic publishing. Until they invented Postscript, most fonts were bit mapped images which had to be specially created for different font sizes. With Postscript, Fonts could be defined as graceful lines and curves with detailed instructions about how to behave as certain sizes (so if you drew the letters at a tiny size, thin lines which made up critical parts of the letter would not disappear).
Adobe had two original font types – Type 3 and Type 1 fonts. Type 3 does not have all the clever features of Type 1 and generally produces less than perfect results, but Type 1 works very well and was very successful. Type 1 fonts work with Adobe Font manager and usually have .afb or .afm endings. There is also a variation of Type1 called CFF (Compact Font Format).
When Microsoft decided to add proper font support to Windows, they did not want to adopt this solution (possibly to avoid paying royalties to Adobe), so they developed another font technology with Apple called TrueType. This used the same idea of defining fonts as a set of shapes, but is totally incompatible with Type1. These fonts are what you generally find in the fonts directory if you use Windows (they had the ending .ttf).
TrueType and Type1 are comparable – they do essentially the same thing in different ways and both have advantages and disadvantages – Type1 arguably uses a superior method for defining curves while Truetype offers better CMAP capabilities – but either of them work fine for most users. Indeed the latest file format (OpenType) takes features from both TypeType and Type1 and is a result of improved relations with Adobe and Microsoft.
Because the PDF file format is backward compatible it supports all of these types of fonts. So font advice should be to avoid Type3 and stick to Type1, TrueType or OpenType, depending on what fonts you have access to. You just need to understand that they are all different, incompatible implementations of the same idea of defining characters as a set of shapes with rules to ensure good quality at all sizes.
If you embed the fonts, you can generally ignore the font types and leave the PDF viewer to handle them.
This post is part of our “Understanding the PDF File Format” series. In each article, we aim to take a specific PDF feature and explain it in simple terms. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!
Latest posts by Mark Stephens (see all)
- Is attending JavaOne still worth the hassle? - June 21, 2017
- Is it still worth attending software conferences in 2017? - June 1, 2017
- What should be in Java10? - May 31, 2017
- What are NetBeans Days? - April 4, 2017
- NetBeans Day UK announced for Tuesday 25th April 2017 - February 1, 2017