n-t-roff / heirloom-doctools

The Heirloom Documentation Tools: troff, nroff, and related utilities
http://n-t-roff.github.io/heirloom/doctools.html
Other
127 stars 23 forks source link

eqn truncates gfont name to one character #77

Open nbuwe opened 5 years ago

nbuwe commented 5 years ago

gfont directive in eqn emits roff command with printf(".ft %c\n", gfont); that truncates the font name to the first char only.

test/eqn/eqn.roff uses gfont CWnear the end and it gets truncated to .ft C

I haven't checked why and how dpost can handle it (there's no font "C"), but it does emit

x font 11 C /home/uwe/opt/heirloom/lib/doctools/font/devps/CW.afm 4

for that.

n-t-roff commented 5 years ago

This is actually a documentation gap. The argument to gfont (or option -f) can be the letters R, I, B and the digits 1 ... 9 for the first 9 font positions. So you may mount a different font to any of these positions and then use the position number as argument.

Interestingly DWB does support two character font names, but heirloom eqn (i.e. traditional AT&T eqn) does not (yet).

It may be addressed in the long term.

nbuwe commented 5 years ago

Do you know off-hand how troff manages to emit that x font, connecting C and CW.afm? I'm curious. (I've stumbled into this testing my toy dpdf prototype).

I've also wondered in passing if there's any connection why html backend has both CW and C that differ in name only :).

n-t-roff commented 5 years ago

Since the courier font is named C on some installations and CW on others, there is a font name mapping (in the file FONTMAP) introduced in commit da18d588 which maps e.g. C and CR to CW.

The same applies to HTML, C and CW is treated as the same fixed with font.