#! /bin/sh ######################################################################## # testfont - test a font (with a name like testfont, what do you exect?) # Damian Cugley Wed 6 Dec 1989 # Added -h (help) - pdc Sun 15 Jul 1990 # Copyright (C) 1990 Damian Cugley ######################################################################## PATH=/usr/local/bin:/usr/bin:/usr/ucb:/usr/local/bin/X11 tmp=tmp.tex trap 'rm -f $tmp' 1 2 3 6 13 14 15 23 cat > $tmp << @EOF % $tmp -- display some font samples %%Creator: $0 %%For: ${USER-$LOGNAME} %%CreationDate: `date` %%EndComments %%BeginProlog \\let\\noinit! \\input testfont %% macros %%EndProlog @EOF while [ $# -gt 0 ]; do case $1 in +m) mag= ; shift ;; +s) mag= ; shift ;; +c) cmd= ; shift ;; -m) mag="scaled \\magstep$2"; shift 2 ;; -m*) mag="scaled \\magstep`expr $1 : '-m\(.*\)'`"; shift ;; -s) mag="scaled $2"; shift 2 ;; -s*) mag="scaled `expr $1 : '-m\(.*\)'`"; shift ;; -c) cmd=$2; shift 2 ;; -c*) cmd=`expr $1 : '-c\(.*\)'`; shift ;; -v) verbose=t; shift ;; +v) verbose= ; shift ;; [+-][h?]*) echo << @EOF USAGE `basename $0` [ -v | [-c] COMMANDS | -m MAGSTEP | -s SCALE | +m|s|c|v | FONT ]... FONT is the TeX name of a font - e.g, '"cmr12"' -c COMMANDS Sets the TeX commands to be applied to each subsequent font. Default is -c '"\names"' -m MAGSTEP -s SCALED Use subsequent fonts at that magnification (MAGSTEP is either an integer from -5 to 5 or is '"half"'; SCALED is 1000*desired magnification) Default is -s 1000. -v Verbose (well, verbosish). +c, +s, +m or +v return things to default settings Options can be mixed in with FONT arguments. @EOF exit 0 ;; -* | +*) echo Don\'t understand $1, try `basename $0` -h. >&2 exit 1 ;; \\*) cmd="$cmd $1"; shift ;; *) echo >> $tmp '\def\fontname{'$1 $mag'}' \ '\startfont' ${cmd:-'\display\names'} shift esac done echo >> $tmp \\bye if [ -n "$verbose" ]; then cat $tmp; fi /usr/local/bin/tex tmp && [ $DISPLAY ] && xdvi tmp