2 # Small bashscript to convert a font to another encoding.
4 # convertfontto fontname outputfontname encoding destination
5 # place the destination into your .enscriptrc file or enscript.cfg
6 # Defaults are : encoding - Latin9
7 # outputfontname: fontname-encoding.afm
8 # destination: $HOME/.config/enscript/afm
11 font=${1?Please give a font};
12 encoding=${3:-iso8859-15};
13 outputfile=${2:-"${font%.*}-$encoding"}
14 destination=${4:-~/.config/enscript/afm};
15 fontforge -lang=ff -c "Open(\"$font\");Reencode(\"$encoding\");Generate(\"$outputfile.pfa\")";
17 cp "$outputfile.pfa" "$destination/"
18 cp "$outputfile.afm" "$destination/"