PDF fonts is a tricky subject and one we frequently get asked about. So we have a lot of tutorials on the subject. I hope they prove useful and if you have any specific questions, please send me a question and I will make it into an article.
So let us start at the beginning….
How do fonts work in a PDF file
PDF files can contain images, Vector graphics and text. All the text can be in any font. There are 5 standard font families which all PDF viewers must contain (Times, Helvetica, Courier, Symbol and ZapfDingbats) so these can be used in any document. You can use any other font – my daughter always uses her Malinka font because she loves the letters made from cats. In this case there are three possible approaches. These are set in the PDF creation tool:-
1. Just include the name of the font and hope it is on everyone’s machine. If it is not, it will be replaced with a Standard font.
2. Embed the font. This means include the actual font data inside the PDF. You can then guarantee that it will be on everyone’s machine because it is in the PDF file (but can only be used by the PDF containing it). The problem with this is that some fonts are very large, so it makes the PDF files much bigger.
3. Embed and subset the font. This means include just the data needed to draw any characters. So if my daughter creates a PDF containing the phrase ‘THE CAT SAT ON THE MAT’, it would embed just the font data for the letters T, H, E, C, A, S, O, N, M. This is a good compromise as it keeps the file small but guarantees the PDF file will appear as you wanted it.
Types of PDF font
What can make things confusing is that PDF files can use several different types of font technology.
This is the original and simplest font technology. Fonts generally look quite ‘crude’ and you cannot extract the text values.
These types of fonts produce much higher quality output and you can extract the text values.
This was created as an alternative to Postscript (which Adobe owned the patents on) by Microsoft and Apple. It also produces high quality output and enables text extraction. Because it was the default for Windows, there is a much wider selection of fonts but not all are well-designed.
This is a ‘merger’ of the best bits from Postscript and TrueType.
You should now have a basic grasp of how PDf fonts works in a PDF file. You might want to read the rest of our tutorials….
Are you a Developer working with PDF files?
Our developers guide contains a large number of technical posts to help you understand the PDF file Format.
Do you need to solve any of these problems?
|Display PDF documents in a Web app|
|Use PDF Forms in a web browser|
|Convert PDF Documents to an image|
|Work with PDF Documents in Java|
2 Replies to “Introductory PDF font tutorial”
This is a horrible and bland walkthrough with no examples on the inner workings of Fonts. Consider writing in more detail or not writing at all.
The title of this article is Introductory font tutorial. If you search the blog with https://blog.idrsolutions.com/?s=fonts you will find much more technical content such as https://blog.idrsolutions.com/2015/02/web-fonts-a-quick-introduction-to-wrapper-and-glyph-formats/