annotate man/fixfonts @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 #!/bin/sh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 # Make links named `lcircle10' for all TFM and GF/PK files, if no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 # lcircle10 files already exist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 # Don't override definition of prefix and/or libdir if they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 # already defined in the environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 if test "z${prefix}" = "z" ; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 prefix=/usr/local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 # prefix may contain references to other variables, thanks to make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 eval prefix=\""${prefix}"\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 if test "z${libdir}" = "z" ; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 libdir="${prefix}/lib/tex"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 # libdir may contain references to other variables, thanks to make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 eval libdir=\""${libdir}"\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 texlibdir="${libdir}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 texfontdir="${texlibdir}/fonts"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 # Directories for the different font formats, in case they're not all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 # stored in one place.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 textfmdir="${textfmdir-${texfontdir}}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 texpkdir="${texpkdir-${texfontdir}}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 texgfdir="${texgfdir-${texfontdir}}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 test "z${TMPDIR}" = "z" && TMPDIR="/tmp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 tempfile="${TMPDIR}/circ$$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 tempfile2="${TMPDIR}/circ2$$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 # EXIT SIGHUP SIGINT SIGQUIT SIGTERM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #trap 'rm -f "${tempfile}" "${tempfile2}"' 0 1 2 3 15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 # Find all the fonts with names that include `circle'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (cd "${texfontdir}"; find . -name '*circle*' -print > "${tempfile}")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 # If they have lcircle10.tfm, assume everything is there, and quit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 if grep 'lcircle10\.tfm' "${tempfile}" > /dev/null 2>&1 ; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 echo "Found lcircle10.tfm."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 exit 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 # No TFM file for lcircle. Make a link to circle10.tfm if it exists,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 # and then make a link to the bitmap files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 grep 'circle10\.tfm' "${tempfile}" > "${tempfile2}" \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 || {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 echo "I can't find any circle fonts in ${texfontdir}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 If it isn't installed somewhere else, you need to get the Metafont sources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 from somewhere, e.g., labrea.stanford.edu:pub/tex/latex/circle10.mf, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 run Metafont on them."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 exit 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 # We have circle10.tfm. (If we have it more than once, take the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 # one.) Make the link.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 tempfile2_line1="`sed -ne '1p;q' \"${tempfile2}\"`"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ln "${tempfile2_line1}" "${textfmdir}/lcircle10.tfm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 echo "Linked to ${tempfile2_line1}."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 # Now make a link for the PK files, if any.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (cd "${texpkdir}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 for f in `grep 'circle10.*pk' "${tempfile}"` ; do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 set - `echo "$f" \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 | sed -ne '/\//!s/^/.\//;s/\(.*\)\/\([^\/][^\/]*\)$/\1 \2/;p'`
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ln "$f" "${1}/l${2}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 echo "Linked to $f."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 # And finally for the GF files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (cd "${texgfdir}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 for f in `grep 'circle10.*gf' "${tempfile}"` ; do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 set - `echo "$f" \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 | sed -ne '/\//!s/^/.\//;s/\(.*\)\/\([^\/][^\/]*\)$/\1 \2/;p'`
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ln "$f" "${1}/l${2}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 echo "Linked to $f."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 # eof