#!/usr/bin/fontforge
# Quick and dirty hack: converts a font to Postscript Type one (.pfb)
i=1
while ( i<$argc )
Print("Opening : " +$argv[i]);
if($argv[i]:e != "otf")
Print( "Skipping ... Expecting an OpenType font [.otf]" )
else
Open($argv[i])
Print("Saving : " +$argv[i]:r+".pfb");
# If the font is a cid keyed font, you may want to flatten the cid map
# To do this, uncomment the command below :
# CIDFlatten()
SetFontOrder(3)
SelectAll()
Simplify(128+32+8,1.5)
ScaleToEm(1000)
DontAutoHint()
Generate($argv[i]:r + ".pfb")
endif
i = i+1
endloop
Save this script as otf2pfb.sh and set the executable bit ( chmod +x otf2pfb.sh ). To launch this script, just do : ./otf2pfb.sh *.otf
or make otf2pfb
#!/bin/bash
for i in $@; do
fontforge -script /usr/bin/otf2pfb.sh $i
done
and make this executable
and go in terminal to font folder and type:
otf2pfb fontname.otf
For all fiels in a folder do:
otf2pfb *.otf otf
Now the only thing remaining to do is installing the Type1 fonts in the system. For this Mandriva users can use drakfont, others can use type1inst after having copyed the files in /usr/share/fonts/Type1/.
http://linux-wizard.net/index.php?id_blog=142
No comments:
Post a Comment