2 # Generate a neatroff output device
4 # ghostscript fonts directory; should be in GS_FONTPATH
6 # output device directory
7 TP
="/path/to/font/devutf"
10 # pattern of ligatures to ignore
11 LIGIGN
="\(ct\|st\|sp\|Rp\)"
12 # minimum amount of kerning to include
17 echo "fonts 10 R I B BI CW H HI HB S1 S" >$TP/DESC
18 echo "res $RES" >>$TP/DESC
19 echo "hor 1" >>$TP/DESC
20 echo "ver 1" >>$TP/DESC
21 echo "unitwidth 10" >>$TP/DESC
23 # afmconv troff_name font_path extra_mktrfn_options
27 cat $2 | .
/mkfn
-a -b -r$RES -t "$1" $3 $4 $5 $6 $7 | \
28 sed "/^ligatures /s/ $LIGIGN//g" >$TP/$1
31 # ttfconv troff_name font_path extra_mktrfn_options
35 cat $2 | .
/mkfn
-b -o -r$RES -t $1 -k$MINKERN $3 $4 $5 $6 $7 | \
36 sed "/^ligatures /s/ $LIGIGN//g" >$TP/$1
39 # otfconv troff_name font_path extra_mktrfn_options
42 TTF
="/tmp/.neatmkfn.ttf"
43 # convert the OTF file to TTF using fontforge
44 echo -e "Open(\"$3\")\nGenerate(\"$TTF\")" | fontforge
>/dev
/null
2>&1
45 ttfconv
$1 $TTF $3 $4 $5 $6 $7
50 afmconv R
$FP/n021003l.afm
-pTimes-Roman
51 afmconv I
$FP/n021023l.afm
-pTimes-Italic
52 afmconv B
$FP/n021004l.afm
-pTimes-Bold
53 afmconv BI
$FP/n021024l.afm
-pTimes-BoldItalic
54 afmconv S
$FP/s050000l.afm
-pSymbol -s
55 afmconv S1
$FP/n021003l.afm
-pTimes-Roman -s
56 afmconv AR
$FP/a010013l.afm
-pAvantGarde-Book
57 afmconv AI
$FP/a010033l.afm
-pAvantGarde-BookOblique
58 afmconv AB
$FP/a010015l.afm
-pAvantGarde-Demi
59 afmconv AX
$FP/a010035l.afm
-pAvantGarde-DemiOblique
60 afmconv H
$FP/n019003l.afm
-pHelvetica
61 afmconv HI
$FP/n019023l.afm
-pHelvetica-Oblique
62 afmconv HB
$FP/n019004l.afm
-pHelvetica-Bold
63 afmconv HX
$FP/n019024l.afm
-pHelvetica-BoldOblique
64 afmconv Hr
$FP/n019043l.afm
-pHelvetica-Narrow
65 afmconv Hi
$FP/n019063l.afm
-pHelvetica-Narrow-Oblique
66 afmconv Hb
$FP/n019044l.afm
-pHelvetica-Narrow-Bold
67 afmconv Hx
$FP/n019064l.afm
-pHelvetica-Narrow-BoldOblique
68 afmconv KR
$FP/b018012l.afm
-pBookman-Light
69 afmconv KI
$FP/b018032l.afm
-pBookman-LightItalic
70 afmconv KB
$FP/b018015l.afm
-pBookman-Demi
71 afmconv KX
$FP/b018035l.afm
-pBookman-DemiItalic
72 afmconv NR
$FP/c059013l.afm
-pNewCenturySchlbk-Roman
73 afmconv NI
$FP/c059033l.afm
-pNewCenturySchlbk-Italic
74 afmconv NB
$FP/c059016l.afm
-pNewCenturySchlbk-Bold
75 afmconv NX
$FP/c059036l.afm
-pNewCenturySchlbk-BoldItalic
76 afmconv PA
$FP/p052003l.afm
-pPalatino-Roman
77 afmconv PR
$FP/p052003l.afm
-pPalatino-Roman
78 afmconv PI
$FP/p052023l.afm
-pPalatino-Italic
79 afmconv PB
$FP/p052004l.afm
-pPalatino-Bold
80 afmconv PX
$FP/p052024l.afm
-pPalatino-BoldItalic
81 afmconv C
$FP/n022003l.afm
-pCourier
82 afmconv CO
$FP/n022003l.afm
-pCourier
83 afmconv CW
$FP/n022003l.afm
-pCourier
84 afmconv CI
$FP/n022023l.afm
-pCourier-Oblique
85 afmconv CB
$FP/n022004l.afm
-pCourier-Bold
86 afmconv CX
$FP/n022024l.afm
-pCourier-BoldOblique
87 afmconv ZI
$FP/z003034l.afm
-pZapfChancery-MediumItalic
88 afmconv ZD
$FP/d050000l.afm
-pZapfDingbats
90 # The first argument of afmconv, ttfconv, and otfconv is the troff
91 # name of the font and their second argument is its path. Any other
92 # argument is passed to mkfn directly. The postscript names of the
93 # fonts are inferred from the fonts themselves To change that, you
94 # can specify their names via the -p argument of *conv functions.
96 find $FP/ -name '*.afm' |
while read FN
98 afmconv
`basename $FN .afm` $FN
101 find $FP/ -name '*.ttf' |
while read FN
103 ttfconv
`basename $FN .ttf` $FN
106 find $FP/ -name '*.otf' |
while read FN
108 otfconv
`basename $FN .otf` $FN