bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61915] grohtml: .EX/.EE is not monospaced


From: G. Branden Robinson
Subject: [bug #61915] grohtml: .EX/.EE is not monospaced
Date: Thu, 8 Sep 2022 02:19:04 -0400 (EDT)

Update of bug #61915 (project groff):

                  Status:                    None => In Progress            

    _______________________________________________________

Follow-up Comment #2:


[comment #1 comment #1:]
> I think I found the cause of this.  It's some code I added to an.tmac.

This isn't quite true.  Font remappings like that have been present since
2007.  They formerly resided in the an-ext.tmac file.

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=259929625b21595951ed3ef5dba9aaaea359b464

Consider the following simple reproducer.


$ cat EXPERIMENTS/courier-in-table.man 
.TH foo 1 2022-09-08 "groff test suite"
.TS
Lf(CR).
baz
.TE


The puzzling bit is that you could still get the Courier family in tbl(1)
tables anyway up through groff 1.22.4; the above example _works_ in released
groff.  It is only since then that that regressed--almost surely my fault, but
it's hard for me to reason out why.  It's fairly well-known that groff's html
output devices transform tbl tables and (sometimes) eqn equations into
PostScript (using groff again) and then convert that output to image files
which are then linked from the HTML output.

But since 'ps' is not an nroff device (it's troff), the font remappings would
not have taken place.  This explains why Courier shows up in the table.  But I
haven't hacked on grops much, and if I'd broken its ability to change font
families I'd have noticed long before now.

Weirder still, the following fix _works_.


diff --git a/tmac/an.tmac b/tmac/an.tmac
index 90ccb67fc..f4f9d28a3 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1158,8 +1158,9 @@ contains unsupported escape sequence
 .ds an*body-family T \" Times
 .ds an*example-family C \" Courier
 .
-.\" Map monospaced fonts to standard styles for groff's nroff devices.
-.if n \{\
+.\" Map monospaced fonts to standard styles for groff's nroff devices,
+.\" except HTML, which _can_ change font families.
+.if !\n[an-is-output-html] .if n \{\
 .  ftr CR R
 .  ftr CI I
 .  ftr CB B


But given my analysis above, this should not have fixed the bug at all--the
missing conditional has been missing since groff 1.20.  And yet it does.

Very mysterious.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61915>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]