xref: /titanic_44/usr/src/cmd/eqn/font.c (revision b7f45089ccbe01bab3d7c7377b49d80d2ae18a69)
1 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2 /*	  All Rights Reserved  	*/
3 
4 
5 /*
6  * Copyright (c) 1980 Regents of the University of California.
7  * All rights reserved. The Berkeley software License Agreement
8  * specifies the terms and conditions for redistribution.
9  */
10 
11 /*
12  * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
13  * All Rights Reserved.
14  */
15 
16 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
17 
18 # include "e.h"
19 
20 setfont(ch1) char ch1; {
21 	/* use number '1', '2', '3' for roman, italic, bold */
22 	yyval = ft;
23 	if (ch1 == 'r' || ch1 == 'R')
24 		ft = ROM;
25 	else if (ch1 == 'i' || ch1 == 'I')
26 		ft = ITAL;
27 	else if (ch1 == 'b' || ch1 == 'B')
28 		ft = BLD;
29 	else
30 		ft = ch1;
31 	printf(".ft %c\n", ft);
32 #ifndef NEQN
33 	if(dbg)printf(".\tsetfont %c %c\n", ch1, ft);
34 #else NEQN
35 	if(dbg)printf(".\tsetfont %c\n", ft);
36 #endif NEQN
37 }
38 
39 font(p1, p2) int p1, p2; {
40 		/* old font in p1, new in ft */
41 	yyval = p2;
42 	lfont[yyval] = rfont[yyval] = ft==ITAL ? ITAL : ROM;
43 	if(dbg)printf(".\tb:fb: S%d <- \\f%c S%d \\f%c b=%d,h=%d,lf=%c,rf=%c\n",
44 		yyval, ft, p2, p1, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]);
45 	printf(".ds %d \\f%c\\*(%d\\f%c\n",
46 		yyval, ft, p2, p1);
47 	ft = p1;
48 	printf(".ft %c\n", ft);
49 }
50 
51 fatbox(p) int p; {
52 	int sh;
53 
54 	yyval = p;
55 	sh = ps / 4;
56 	nrwid(p, ps, p);
57 	printf(".ds %d \\*(%d\\h'-\\n(%du+0.05m'\\*(%d\n", p, p, p, p);
58 	if(dbg)printf(".\tfat %d, sh=0.05m\n", p);
59 }
60 
61 globfont() {
62 	char temp[20];
63 
64 	getstr(temp, 20);
65 	yyval = eqnreg = 0;
66 	gfont = temp[0];
67 	switch (gfont) {
68 	case 'r': case 'R':
69 		gfont = '1';
70 		break;
71 	case 'i': case 'I':
72 		gfont = '2';
73 		break;
74 	case 'b': case 'B':
75 		gfont = '3';
76 		break;
77 	}
78 	printf(".ft %c\n", gfont);
79 	ft = gfont;
80 }
81