3 # to test POSIX-correctness, change hash-bang to /bin/bash and uncomment
8 # Very simple configuration script for t1lib. Checks system font
9 # directory and adds anything ending in .pfa or pfb to the font
10 # database. A few things borrowed from paperconfig, (C) 1996, Yves
11 # Arrouye <arrouye@debian.org>
13 # Based on script written by David Huggins-Daines <dhd@debian.org>
18 Usage: `basename $0` [ -v, --version ] [ -h, --help ] [ --force ]
21 Options: -v, --version print version information and exit
22 -h, --help print this help and exit
23 --force force configuration
30 conffile=$confdir/t1lib.config
31 dbase=$confdir/FontDatabase
32 temp=$confdir/FontDatabase.tmp
34 fontdirs="/usr/share/fonts/Type1"
40 echo "`basename $0` version $version"
51 if ! grep -q -x $pat <<EOF 2>/dev/null
55 fontdirs="$fontdirs $1"
62 # We presume that if the database exists, then so does the
63 # configuration file. Hopefully this won't break anything.
65 if [ $force -ne 1 ] && [ -e $dbase ]; then
66 echo "Configuration and font database files already exist."
67 echo "Run $0 --force to rebuild them."
73 mkdir -p $confdir || true
74 echo -n "Searching for Type 1 fonts and AFM files..."
78 if [ ! -d $i ] || [ "`echo $i/*.pf[ab]`" = "$i/*.pf[ab]" ]; then
81 fontpath="$fontpath$i:"
83 for j in `find $i -mindepth 1 -maxdepth 2 -name "*.afm" -type f -printf "%h\n" | sort | uniq`; do
87 # get a listing of all the fonts in each dir
88 find $i -maxdepth 1 -name "*.pf[ab]" -type f -printf '%f\n' >> $temp
90 fontpath=${fontpath%:}
93 if [ -z "$fontpath" ]; then
97 No Type 1 fonts were found in the expected locations.
98 If you want t1lib to be aware of your fonts, you should run
99 $0 with the names of your local font directories as
100 arguments, or you should edit the $dbase file manually.
101 See the FontDatabase(5) manual page for more information.
107 echo -n "Building font database..."
108 fontcount=`cat $temp | wc -l || true`
109 echo $fontcount > $dbase
115 # now set the paths in the config file
117 t1lib.config - global configuration file for t1lib.
118 It was created automatically on `date`
119 by the t1libconfig script.
121 Run $0 --force to rebuild it.
123 ENCODING=$confdir/enc