mg@ukc.UUCP (M.W.Guy) (01/10/86)
Indeed it is possible to use a proportionally spaced font correctly in nroff. For each device which nroff knows about (-T switch) there is a file in /usr/lib/term describing its characteristics and escape codes. This is generated by compiling a .c file containing one structure. (Nroff gollops it on top of its own data space - my stomach floweth over!) One of the items in this structure is an integer which is normally the printing pitch of a character in 240ths of an inch. (often 1/10th of an inch or 1/12th). There is also an array of strings, one for each nroff character, whose first character contains in coded form the width of the output glyph in character widths, and the rest of the string is the rune you have to chant at the device to draw the character on it. For the straight alphabet, this string looks like "\201A" (the top bit tells nroff whether it can be underlined). For characters such as the quarter character, it might be "\0031/4". To do proportional spacing, you need to set the nominal character width to something tiny (say 1/240th of an inch) and then express all character widths as a multiple of this. HOWEVER, nroff assumes that a '\b' moves you backwards by the stated unit character width, so italicising by underlining and boldening by overstriking will not work. If you need to craft a table for a proportional font (or indeed for a fixed-width one), I can send you a skeleton structure with comments as to the purpose of each item. Martin Guy