Convert PFB/PFM font to OTF on Ubuntu

  • install fontforge with Synaptic
  • create pfb2otf
#!/usr/bin/fontforge
Open($1);
Reencode("unicode");
Generate($fontname+".otf");
Quit(0);
  • create convert
#!/bin/bash

PATH=/usr/local/bin:$PATH
FONTFORGE_LANGUAGE=ff
export PATH FONTFORGE_LANGUAGE

if (test -f $1); then ./pfb2otf $1; fi
  • make them executable:
chmod 755 pfb2otf convert
  • place them in the same folder as your PFB and PFM font files
  • launch the conversion
for i in *.[pP][fF][bB]; do ./convert $i; done

Reference

 

Feedback

is doable in OS X ?
le fleuff
October 24, 2009
#1
Wonderful, thank you very much!
Marci
August 15, 2010
#2
de la balle !
hubombing
October 28, 2010
#3
Excellent !!!
Khi2
May 5, 2011
#4
Thank you!
Theo
May 12, 2011
#5
>is doable in OS X ?
lol no, of course nothing works in baby's first operating system

June 21, 2011
#6
Hi le fleuff,

Although I only found this page 2 years later, I thought I'd just mention that yes, despite #6's cowardly, anonymous, and ignorant attempt at an insult, he's wrong, of course it works on an adult, POSIX-compliant operating system such as OSX :-)

Rather than use Synaptic to install fontforge, use port, i.e., at the command line, type,

sudo port install fontforge

And then change the first line of the pfb2otf script to

#!/sw/bin/fontforge
Gareth R. White
September 19, 2011
#7
I used MacPorts to install Fontforge on OSX, and I have a somewhat more complex script based on the one given in Fontforge's scripting tutorial at
http://fontforge.sourceforge.net/scripting.html
FontForge is installed in /opt/local/bin for me, and the first line of the script hence reads
#!/opt/local/bin/fontforge

The script I use is too long to post here.

I'm not gonna bother with the troll comment, jealousy is never pretty.
Martin
January 30, 2012
#8