* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)vwidth.c 5.1 (Berkeley) 5/15/85";
* Creates a width table for troff from a versatec font for a
* Usage: width font [ point_size ]
* where font is the file name of the versatec font and
* point_size is it point size.
* If the point size is omitted it is taken from the suffix of
* the font name, as bocklin.14 => 14 point.
* It is better to use as large a point size font as possible
'\206', "narrow space\7f",
'\200', "section (unimplem)",
'\200', "acute acc (unimplem)",
'\200', "grave acc (unimplem)",
'\200', "underrule (unimplem)",
'\200', "slash (unimplem)",
'\203', "half narrow space",
if (argc
!= 3 && argc
!= 2) {
printf("Usage: vwidth font [pointsize] > font.c\n");
for (p
= argv
[1]; *p
&& *p
!= '.'; p
++)
fprintf(stderr
, "Assuming %d point\n", psize
);
read(fd
, desc
, sizeof desc
);
printf("char XXw[256-32] = {\n");
for (i
= 0; wtable
[i
].charloc
!= 0; i
++) {
cl
= wtable
[i
].charloc
& 0377;
w
= desc
[cl
].width
*(54./25.)*(6./psize
)+.5;
if ((cl
>= '0' && cl
<= '9') || (cl
>= 'A' && cl
<= 'Z') ||
(cl
>= 'a' && cl
<= 'z')) {
printf("%d+0%o,\t/* %s */\n", w
, esc
, wtable
[i
].name
);
printf("%d,\t\t/* %s */\n", w
, wtable
[i
].name
);