Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Introductory PDF font tutorial

1 min read

PDF Font Tutorial

PDF fonts is a tricky subject and one we frequently get asked about. So I will be writing a set of articles to try and make some sense of 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 lets start at the beginning….

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.

So that is the basic principle. What can make it confusing is that PDF files can use several different types of font technology. And that is what we will cover next.

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!

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Enabling SVG Gzip Compression on Apache and NGINX

Gzip compression is a widely supported method of reducing the size of the content sent from a web server in order to improve the...
Leon Atherton
47 sec read

2 Replies to “Introductory PDF font tutorial”

  1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.