Get Firefox
Get Firefox

Archive for January, 2009

You are currently browsing the weblog archives for January, 2009.

Extract fonts from PDF files using FontForge

Monday, January 26th, 2009 02:16:20 by Håvar Henriksen

FontForge showing an font extracted from a PDF fileI have many times tried to find a way of extracting fonts used in different PDF files, but the solution I’ve found before always involves first converting the PDF file to a PS (PostScript) file, and then manually extracting those fonts and making them into PostScript font (.pfb and .pfa) files, this was a cumbersome process that I never got to work. But yesterday I found a much easier way to extract the fonts using FontForge’s built in “Extract from PDF” feature, wich I read about in this article: [HOWTO] Extract Fonts from a PDF File.
FontForge showing the Open Font dialog
Basically you just need to select “Extract from PDF” in the filter section of the “Open Font” dialogbox used when opening files. When you have selected your PDF file, a “Pick a font” dialogbox will open where you could select wich font to open. Then you’ll just need to compact the font using the “Encoding” menu and selecting “Compact”. This will remove all non-used glyphs in the font. Then you would have to edit the Font Info, and save the font as a font file (usally TrueType is best). Quote from the article: “Beware though, sometimes when a font is embedded into a PDF it will only contain [glyphs for] characters used. So, if the PDF file that you are trying to extract from does not contain the letter “P” [glyph], then that letter will not show up in FontForge.” (You could see an example of this in the image above, the PDF file the font was extracted from did not contain glyphs for all the letters in the english alphabet).