#include #include #include int didname; int didfontname; int offset; void run(char*, int); Biobuf bout; void usage(void) { fprint(2, "usage: afm2troff [-h] [-o offset] [file...]\n"); exits("usage"); } void main(int argc, char **argv) { int i, fd; ARGBEGIN{ case 'h': didname = 1; didfontname = 1; break; case 'o': offset = atoi(EARGF(usage())); break; default: usage(); }ARGEND Binit(&bout, 1, OWRITE); if(argc == 0) run("", 0); else{ for(i=0; i 600) ad |= 2; if(nf >= 7 && strcmp(f[5], "N") == 0 && strcmp(f[6], "space") == 0) code = ' '; if(code == ' ') Bprint(&bout, "spacewidth %d\ncharset\n", wid); else fmtprint(&fmt, "%C\t%d\t%d\t%d %04x\n", code, wid, ad, code, code); } } Bprint(&bout, "%s", fmtstrflush(&fmt)); }