March 31, 2020 | 2:34 pm
You are here:  / First Time / HOWTO / [HOWTO] Extract Fonts from a PDF File

[HOWTO] Extract Fonts from a PDF File

As it turns out, it is very simple to extract a font from a PDF file.

In my line of work, I occasionally get PDF files from other companies with specs, dimensions, and descriptions in them and need to be able to display or print them.  The problem is, my workstation is running an English OS and most of the PDFs I get are in Japanese.

Under Linux (I use Ubuntu, a Debian derivative) this process is very simple:

Install FontForge

$ sudo apt-get install fontforge

Once FontForge is installed, start it

$ fontforge

On the “Open Font” screen, go down to where it says “Filter” and change it to “Extract from PDF”.
Select your PDF and a “Pick a font” window will open.
Select the font you want to extract and click OK.

A window with a display of the font will show up.  It’s not quite ready to turn into a TTF yet.  Here’s how to prepare it:

Go to the Encoding menu and select “Compact”.  This will cause FontForge to remove all characters that are not defined in the embedded font.  Beware though, sometimes when a font is embedded into a PDF it will only contain characters used.  So, if the PDF file that you are trying to extract from does not contain the letter “P”, then that letter will not show up in FontForge.  Check to make sure all the characters you need are displayed and then head over to the Element menu.

Click on  Font Info.
You can update the Fontname, Family Name, and most importantly, “Name for Humans”.  This field is what the font will display as in your editing program. The font name is usually a little garbled when you extract it, so just make it something readable.    If there is a copyright notice displayed at the bottom, you should probablly stop what you are doing since that usually means the font should be purchased.

If there’s no copyright, click on “OK”.  Then go to File > Generate Fonts.

Select the type of font you want to save as (Usually TrueType is best), and click on Save.   You may encounter some messages about Non-standard Em size and Bad Private Dictionary errors.  Just click on Save and you should be OK.

Then, find your font file and open it up to make sure that it displays properly.

If it does, then all is well.  Close FontForge and enjoy your properly displayed font.