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
Oct 24, 2009
#1
Wonderful, thank you very much!
Marci
Aug 15, 2010
#2
de la balle !
hubombing
Oct 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

Jun 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
Sep 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
Jan 30, 2012
#8
This method worked a treat on Ubuntu 11.10 (which is good, because the current version of FontForge's GUI seems to have issues). Thanks.
JJ
Mar 16, 2012
#9
Great work. I used it in Ubuntu 12.04 without problems.
Huey_Lewis
May 16, 2012
#10
Very useful, thank you.
PaoloB
Nov 20, 2012
#11
works!
Pedro Carvalho
Nov 26, 2013
#12
10x :)
Ddragon
Jul 16, 2015
#13
Works great! If you use Homebrew to install fontforge, just note that it will install to /usr/local/bin, so pfb2otf should get #!/usr/bin/fontforge.
GGDN
Apr 20, 2016
#14
err... pfb2otf should get #!/usr/local/bin/fontforge
GGDN
Apr 20, 2016
#15