summaryrefslogtreecommitdiff
path: root/info/maketexwork/ex-05-03
blob: 89f65e1c984879ebb21ea3bfed9e537e747c421c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/local/bin/bash
#
#   This script file makes a new TeX font from a PS outline.  
#
#   Parameters are:
#
#   name dpi bdpi [mag mode destdir]
#
#   `name' is the name of the font, such as `ptmr'.  `dpi' 
#   is the resolution the font is needed at.  `bdpi' is 
#   the base resolution.
#
#   This script ignores the remaining parameters.  They are 
#   left here to document the fact that the caller may provide 
#   them.  They may be provided because the caller thinks 
#   MetaFont is going to do the work...
#
#   Of course, this needs to be set up for your site.
#
# TEMPDIR needs to be unique for each process because of the 
# possibility of simultaneous processes running this script.

TEMPDIR=/tmp/temp-tex-PS.$$
NAME=$1
DPI=$2
BDPI=$3

LOCALDIR=/usr/local/lib/mf/fonts
DESTDIR=$LOCALDIR/pk

BASENAME=$NAME.$DPI
PFADIR=/usr/local/lib/tex/ps/outlines

# Clean up on normal or abnormal exit
trap "cd /; rm -rf $TEMPDIR" 0 1 2 15

mkdir $TEMPDIR
cd $TEMPDIR

# We proceed by making a 10pt font at the resolution 
# requested...
echo Making ${DPI}dpi version of $NAME.
ps2pk -X$DPI -P10 -a$PFADIR/$NAME.afm \
    $PFADIR/$NAME.pfa ${BASENAME}pk

mv ${BASENAME}pk $DESTDIR

exit 0