#!/bin/sh -e # to test POSIX-correctness, change hash-bang to /bin/bash and uncomment # the following line: # set -o posix # Very simple configuration script for t1lib. Checks system font # directory and adds anything ending in .pfa or pfb to the font # database. A few things borrowed from paperconfig, (C) 1996, Yves # Arrouye # Based on script written by David Huggins-Daines usage() { cat </dev/null $fontdirs EOF then fontdirs="$fontdirs $1" fi ;; esac shift done # We presume that if the database exists, then so does the # configuration file. Hopefully this won't break anything. if [ $force -ne 1 ] && [ -e $dbase ]; then echo "Configuration and font database files already exist." echo "Run $0 --force to rebuild them." exit 0 fi fontpath="" afmpath="" mkdir -p $confdir || true echo -n "Searching for Type 1 fonts and AFM files..." for i in $fontdirs do if [ ! -d $i ] || [ "`echo $i/*.pf[ab]`" = "$i/*.pf[ab]" ]; then continue fi fontpath="$fontpath$i:" for j in `find $i -mindepth 1 -maxdepth 2 -name "*.afm" -type f -printf "%h\n" | sort | uniq`; do afmpath="$afmpath$j:" done # get a listing of all the fonts in each dir find $i -maxdepth 1 -name "*.pf[ab]" -type f -printf '%f\n' >> $temp done fontpath=${fontpath%:} afmpath=${afmpath%:} if [ -z "$fontpath" ]; then cat < $dbase cat $temp >> $dbase rm -f $temp echo " done." fi # now set the paths in the config file cat <$conffile t1lib.config - global configuration file for t1lib. It was created automatically on `date` by the t1libconfig script. Run $0 --force to rebuild it. ENCODING=$confdir/enc AFM=$afmpath TYPE1=$fontpath FONTDATABASE=$dbase EOF exit 0