4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
46 * n6.c -- width functions, sizes and fonts
49 int bdtab
[NFONT
+1] ={ 0, 0, 0, 3, 3, 0, };
51 int fontlab
[NFONT
+1] = { 0, 'R', 'I', 'B', PAIR('B','I'), 'S', 0 };
77 else if (iscontrol(i
))
85 if ((j
& MBMASK
) || (j
& CSMASK
)) {
89 k
= t
.Char
* csi_width
[cs(j
)];
105 k
= t
.width
[i
] * t
.Char
;
118 if ((*s
++ = getach()) == 0 || (*s
++ = getach()) == 0)
121 if ((j
= findch(temp
)) > 0)
127 tchar
setabs() /* set absolute char from \C'...' */
128 { /* for now, a no-op */
137 return n
+ nchtab
+ _SPECCHAR_ST
;
146 if ((k
= i
- '0') >= 0 && k
<= nfonts
&& k
< smnt
)
148 for (k
= 0; fontlab
[k
] != i
; k
++)
164 setfbits(chbits
, font
);
165 sps
= width(' ' | chbits
);
177 if (ischar(i
) && isdigit(i
)) { /* \sd or \sdd */
179 if (i
== 0) /* \s0 */
181 else if (i
<= 3 && ischar(j
= cbits(ch
= getch())) &&
182 isdigit(j
)) { /* \sdd */
185 } else if (i
== '(') { /* \s(dd */
188 } else if (i
== '+' || i
== '-') { /* \s+, \s- */
190 if (ischar(j
) && isdigit(j
)) { /* \s+d, \s-d */
192 } else if (j
== '(') { /* \s+(dd, \s-(dd */
202 tchar
setht() /* set character height from \H'...' */
214 tchar
setslant() /* set slant from \S'...' */
247 if (!i
|| i
== 'P') {
251 if (i
== 'S' || i
== '0')
253 if ((j
= findft(i
, fontlab
)) == -1)
270 int savhp
, savapts
, savapts1
, savfont
, savfont1
, savpts
, savpts1
;
272 base
= numtab
[ST
].val
= wid
= numtab
[CT
].val
= 0;
273 if (ismot(i
= getch()))
276 savhp
= numtab
[HP
].val
;
285 while (cbits(i
= getch()) != delim
&& !nlflg
) {
290 emsz
= (INCH
* pts
+ 36) / 72;
291 } else if (isvmot(i
)) {
299 if (base
< numtab
[SB
].val
)
300 numtab
[SB
].val
= base
;
301 if ((k
= base
+ emsz
) > numtab
[ST
].val
)
304 setn1(wid
, 0, (tchar
) 0);
305 numtab
[HP
].val
= savhp
;
340 getch(); /*eat delim*/
344 i
= makem(quant(n
, j
));
408 if ((i
= cbits(getch()) - '0') < 0 || i
> nfonts
)
410 if (skip() || !(j
= getrq()))
432 if (skip() || !(i
= getrq()) || (j
= findft(i
)) == -1) {
463 dfact
= INCH
; /*default scaling is points!*/
470 i
= VERT
; /* was VERT */
488 /* stores \x'...' into
489 * two successive tchars.
490 * the first contains HX, the second the value,
491 * encoded as a vertical motion.
492 * decoding is done in n2.c by pchar().
498 i
= quant(atoi(), VERT
);
502 *pbp
++ = MOT
| VMOT
| i
;
504 *pbp
++ = MOT
| VMOT
| NMOT
| -i
;