Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!terry%owl@rand-unix.ARPA From: terry%owl@rand-unix.ARPA (Terry West) Newsgroups: net.unix-wizards Subject: Re: getting the wrong font in ti-troff Message-ID: <2116@brl-tgr.ARPA> Date: Mon, 14-Oct-85 05:08:45 EDT Article-I.D.: brl-tgr.2116 Posted: Mon Oct 14 05:08:45 1985 Date-Received: Tue, 15-Oct-85 07:33:45 EDT Sender: news@brl-tgr.ARPA Lines: 69 I am having a problem with Typesetter Independent Troff. It is set up with a DESC file that describes 26 different fonts. The problem comes when I ask for font "B" and I get font "LB". Looking at the intermediate output of Troff, font "B" gets mapped into 18 which is the number for "LB" rather than the correct number: 3. When I ask for font 3 explicitly, (like with a \f3) things work correctly. Anybody have an clues? Below is out DESC file: The problem lies in findft() in t6.c. Here's my fix: ----------------------- #ifdef ORIGCODE findft(i) register int i; { register k; if ((k = i - '0') >= 0 && k <= nfonts && k < smnt) return(k); for (k = 0; fontlab[k] != i; k++) if (k > nfonts) return(-1); return(k); } #endif ORIGCODE /* * Old code has a problem if 'k' is a nondigit and is <= nfonts */ findft(i) register int i; { register int k; register int b0, b1; /* * If ft name is digits, then set specified position; otherwise * lookup the "name". */ b0 = i&0177; b1 = i>>BYTE; if ((isdigit(b0) && isdigit(b1)) || (b1 == 0 && isdigit(b0))) { if (b1) k = 10 * (b0 - '0') + b1 - '0'; else k = b0 - '0'; if (k <= nfonts) return(k); fprintf(stderr, "troff: bad font pos: %d\n", k); return(-1); } for (k = 0; fontlab[k] != i; k++) { if (k > nfonts) return(-1); } return(k); } ------------------------ Terry West