2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
21 void brack(int, char *, char *, char *);
24 paren(int leftc
, int p1
, int rightc
)
26 int n
, m
, h1
, j
, b1
, v
;
27 h1
= eht
[p1
]; b1
= ebase
[p1
];
30 lfont
[yyval
] = rfont
[yyval
] = 0;
31 n
= (h1
+ EM(1.0, EFFPS(ps
)) - 1) / EM(1.0, EFFPS(ps
));
33 n
= max(b1
+VERT(1), h1
-b1
-VERT(1)) / VERT(1);
37 if (leftc
== '{' || rightc
== '}') {
45 eht
[yyval
] = VERT(EM(n
, ps
));
46 ebase
[yyval
] = b1
+ (eht
[yyval
]-h1
)/2;
47 v
= b1
- h1
/2 + VERT(EM(0.4, ps
));
49 eht
[yyval
] = VERT(2 * n
);
50 ebase
[yyval
] = (n
)/2 * VERT(2);
52 ebase
[yyval
] -= VERT(1);
53 v
= b1
- h1
/2 + VERT(1);
55 printf(".ds %d \\|\\v'%du'", yyval
, v
);
57 case 'n': /* nothing */
64 brack(m
, "\\(bv", "\\(bv", "\\(lf");
66 case 'c': /* ceiling */
70 brack(m
, "\\(lc", "\\(bv", "\\(bv");
74 for (j
= 0; j
< m
; j
+= 2) printf("\\(bv");
76 for (j
= 0; j
< m
; j
+= 2) printf("\\(bv");
80 brack(m
, "\\(lt", "\\(bv", "\\(lb");
83 brack(m
, "\\(lc", "\\(bv", "\\(lf");
86 brack(m
, "\\(bv", "\\(bv", "\\(bv");
89 brack(m
, (char *)&leftc
, (char *)&leftc
,
93 printf("\\v'%du'\\*(%d", -v
, p1
);
95 printf("\\|\\v'%du'", v
);
101 brack(m
, "\\(bv", "\\(bv", "\\(rf");
103 case 'c': /* ceiling */
107 brack(m
, "\\(rc", "\\(bv", "\\(bv");
111 for (j
= 0; j
< m
; j
+= 2) printf("\\(bv");
113 for (j
= 0; j
< m
; j
+= 2) printf("\\(bv");
117 brack(m
, "\\(rc", "\\(bv", "\\(rf");
120 brack(m
, "\\(rt", "\\(bv", "\\(rb");
123 brack(m
, "\\(bv", "\\(bv", "\\(bv");
126 brack(m
, (char *)&rightc
, (char *)&rightc
,
130 printf("\\v'%du'", -v
);
134 printf(".\tcurly: h=%d b=%d n=%d v=%d l=%c, r=%c\n",
135 eht
[yyval
], ebase
[yyval
], n
, v
, leftc
, rightc
);
139 brack(int m
, char *t
, char *c
, char *b
)
143 for (j
= 0; j
< m
; j
++)