How can I extract fonts from a PDF file?

15

4

Is there a way to extract fonts from PDF files?

I know that usually embedded fonts in PDF files are only subsets of the fonts. Anyway, is there a way to do this?

Joey

Posted 2009-01-07T05:39:21.160

Reputation:

Though bear in mind: Some documents with custom fonts are made as PDFs just for the purpose that those fonts should not be available to everybody. Meaning they are copyrighted to their respective owner. Which in turn means if you plan to use said copyrighted font you can get in a lot of trouble. Yes, not every font is free. There are fonts that cost hundreds of buck too. – Grumpy ol' Bear – 2009-11-26T21:33:39.830

1

Uhm...there is an identical question on Stackoverflow that provides a number of solutions. In addition, there appear to be free online services that do this.

– simlev – 2017-07-14T13:22:55.490

@simlev you appear to have the answer. Why don't you promote your comment to an answer by choosing the best option? – HackSlash – 2017-07-21T21:21:35.753

Answers

1

I would use Font Forge because it is a free, open-source, and cross-platform, solution that can extract font data from PDF files.

https://fontforge.github.io/en-US/

Use the File > Open menu item.

FROM THE DOCUMENTATION:

FontForge can also read (many) fonts out of a pdf file. FontForge usually does not list pdf files (because they aren't really designed as mechanisms for transporting fonts and most such fonts will be incomplete due to subsetting and other optimizations), but you can always type in the name of one directly (or use the [Filter] button to define a filter for pdf files).

https://fontforge.github.io/filemenu.html

HackSlash

Posted 2009-01-07T05:39:21.160

Reputation: 3 174

1

Here I'm promoting my earlier comment to an answer, as per HackSlash's suggestion.

There is an identical question on Stackoverflow that already has an excellent and highly upvoted accepted answer.

It illustrated several methods, which I'll only list briefly:

  1. pdftops
  2. fontforge
  3. mupdf
  4. a ghostscript script
  5. pdf-parser.py

In addition, I'd like to point out that there are several free online services that offer to do just that.

Comment: I am not going to "choose the best option" since best is often subjective and really dependent on the specific situation. Easiest of all would be to use an online service, but that would not be a viable option if the material was to remain private. FontForge looks really good especially for those who might already be using it for font creation or editing. If no desktop environment is available then pdftops (and the other command-line options), would be a good choice also good for automation.

simlev

Posted 2009-01-07T05:39:21.160

Reputation: 3 184

0

Note that depending on the source program and author they may have chosen to "convert fonts to outlines" in which case the actual live font data isn't embedded. This was often necessary back in the days of Postscript output and the practice is still held over today even though it's not really necessary.

cf. https://graphicdesign.stackexchange.com/questions/55780/is-it-necessary-to-outline-fonts-convert-text-to-curves-before-sending-them-to

Bill McGonigle

Posted 2009-01-07T05:39:21.160

Reputation: 121