bugGNU roff - Bugs: bug #60916, [mm] ms.cov asks for fonts by...

 
 

bug #60916: [mm] ms.cov asks for fonts by name, making man page dubious

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Wed 14 Jul 2021 11:51:40 AM UTC
   
 
Category:  Macro mm Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  None
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 17 Jul 2021 02:14:17 AM UTC, comment #2: 


comment #1:

>
> original submission:
> > Rather than porting ms.cov to use the antiquated feature of font positions, I propose to move the rest of mm back to the named font mechanism, adapting HF as conceived above.  People can use the `ftr` request to replace font (styles) instead of `fp` (indeed the former feature was already in groff in 2006).
>
> Does this mean that you won't be able to specify the font positions numbers in HF?  This would break existing documents.


Hi Kurt!

No, I just had in mind changing the HF string default to use the style names instead of the positions.  Nothing deeper.

Near as I can tell, that shouldn't break anything.  HF is not tangled up with much in mm.  It's defined in one place and dereferenced in one place.


  89 .\"     header format
  90 .ds HF 2 2 2 2 2 2 2 2 2 2 2 2 2 2

1054 .\" size and font calculations
1055 .hd@split hd*font \\n[hd*level] HF \\*[HF]\"    get font for this level
1056 .ft \\*[hd*font]\"                      set new font


(hd@split is basically an array element extractor.)

But I'm only now learning mm by hacking on it.  If you can think of something I'm missing, please tell me.

G. Branden Robinson <gbranden>
Group administrator
Sat 17 Jul 2021 01:29:41 AM UTC, comment #1: 


original submission:

> Rather than porting ms.cov to use the antiquated feature of font positions, I propose to move the rest of mm back to the named font mechanism, adapting HF as conceived above.  People can use the `ftr` request to replace font (styles) instead of `fp` (indeed the former feature was already in groff in 2006).


Does this mean that you won't be able to specify the font positions numbers in HF?  This would break existing documents.

T. Kurt Bond <tkurtbond>
Wed 14 Jul 2021 11:51:40 AM UTC, original submission:  

Back in 2006, this change was made:


commit ba68c86474175c67c2b810960b9f39dc60fd575b
Author: Werner LEMBERG <wl@gnu.org>
Date:   Tue Mar 28 12:32:04 2006 +0000

    . Hardwire first four font positions with R, I, B, and BI -- the
      documentation explicitly refers to this feature (cf. the `HF'
      string register).
[...]
    Patches for both problems have been contributed by Nick Stoughton
    <nick@usenix.org>.


The man page says this:


   Fonts
       In mm, the fonts (or rather, font styles) R (normal), I (italic), and
       B (bold) are hardwired to font positions 1, 2, and 3, respectively.
       Internally, font positions are used for backwards compatibility.  From
       a practical point of view it doesn’t make a big difference—a different
       font family can still be selected by invoking groff’s fam request or
       using its -f command-line option.  On the other hand, if you want to
       replace just, for example, font I with Zapf Chancery medium italic, you
       have to use the fp request, as in you have to replace the font at posi‐
       tion 2 (with a call to “.fp 2 ...”).


However, not everything was tested because this happens:

Input:


.fp 2 ZCMI
.COVER
.TL
Manifesto
.AU "Beau L. Krapp"
.COVEND
.P
This is my
.I important
document.


Output:


troff: backtrace: '/home/branden/src/GIT/groff/build/../contrib/mm/mm/ms.cov':53: while loop
troff: backtrace: '/home/branden/src/GIT/groff/build/../contrib/mm/mm/ms.cov':61: macro 'cov@print-authors'
troff: backtrace: '/home/branden/src/GIT/groff/build/../contrib/mm/mm/ms.cov':104: macro 'COVEND'
troff: backtrace: file 'EXPERIMENTS/fp.mm':6
troff: EXPERIMENTS/fp.mm:6: warning: can't find font 'I'


In the foregoing example, the document does render the word "important" in ZCMI, but the author name, which should be in italics, is in roman instead, hence the diagnostics.

The man page also says:


              Font control of the heading

                     The font of each heading level is controlled by string
                     HF.  It contains a font number or font name for each
                     level.  Default value is

                            2 2 2 2 2 2 2 2 2 2 2 2 2 2

                     (all headings in italic).  This could also be written as

                            I I I I I I I I I I I I I I

                     Note that some other implementations use 3 3 2 2 2 2 2 as
                     the default value.  All omitted values are presumed to
                     have value 1.


Rather than porting ms.cov to use the antiquated feature of font positions, I propose to move the rest of mm back to the named font mechanism, adapting HF as conceived above.  People can use the `ftr` request to replace font (styles) instead of `fp` (indeed the former feature was already in groff in 2006).

It appears that there are only a handful of places in m.tmac that need to change to achieve this.

I'll try this out and see what happens.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tkurtbond (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-05-31 gbranden StatusIn Progress None

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code