summaryrefslogtreecommitdiff
path: root/fonts/utilities/mff-29/testfont
blob: 3dfd26c10576dd6b9e6caa1322cefbc814449254 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#! /bin/sh
########################################################################
#  testfont - test a font (with a name like testfont, what do you exect?)
#  Damian Cugley <pdc@oxford.prg> 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