1: # include "e.h"
2:
3: setfont(ch1) char ch1; {
4: /* use number '1', '2', '3' for roman, italic, bold */
5: yyval = ft;
6: if (ch1 == 'r' || ch1 == 'R')
7: ft = ROM;
8: else if (ch1 == 'i' || ch1 == 'I')
9: ft = ITAL;
10: else if (ch1 == 'b' || ch1 == 'B')
11: ft = BLD;
12: else
13: ft = ch1;
14: printf(".ft %c\n", ft);
15: if(dbg)printf(".\tsetfont %c %c\n", ch1, ft);
16: }
17:
18: font(p1, p2) int p1, p2; {
19: /* old font in p1, new in ft */
20: yyval = p2;
21: lfont[yyval] = rfont[yyval] = ft==ITAL ? ITAL : ROM;
22: if(dbg)printf(".\tb:fb: S%d <- \\f%c S%d \\f%c b=%d,h=%d,lf=%c,rf=%c\n",
23: yyval, ft, p2, p1, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]);
24: printf(".ds %d \\f%c\\*(%d\\f%c\n",
25: yyval, ft, p2, p1);
26: ft = p1;
27: printf(".ft %c\n", ft);
28: }
29:
30: fatbox(p) int p; {
31: int sh;
32:
33: yyval = p;
34: sh = ps / 4;
35: nrwid(p, ps, p);
36: printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p);
37: if(dbg)printf(".\tfat %d, sh=%d\n", p, sh);
38: }
39:
40: globfont() {
41: char temp[20];
42:
43: getstr(temp, 20);
44: yyval = eqnreg = 0;
45: gfont = temp[0];
46: switch (gfont) {
47: case 'r': case 'R':
48: gfont = '1';
49: break;
50: case 'i': case 'I':
51: gfont = '2';
52: break;
53: case 'b': case 'B':
54: gfont = '3';
55: break;
56: }
57: printf(".ft %c\n", gfont);
58: ft = gfont;
59: }
Defined functions
font
defined in line
18; used 1 times