bugGNU roff - Bugs: bug #63067, [PATCH] [mm] cover page title can...

 
 

bug #63067: [PATCH] [mm] cover page title can use wrong font family

Submitter:  Nikita Ivanov <nikitaivanov>
Submitted:  Fri 16 Sep 2022 01:57:21 PM UTC
   
 
Category:  Macro mm Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 16 Sep 2022 05:22:18 PM UTC, comment #4: 


commit 1865c9c06f8bc978a1a7ce1fc95479d68423bf9a
Author: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date:   Fri Sep 16 13:57:21 2022 +0000

    [mm]: Fix Savannah #63067.

    * contrib/mm/m.tmac (misc@ev-keep): Select configured default font
      family, as with `.fam H` at the top of the document, for example, when
      switching to new environment.

    Fixes <https://savannah.gnu.org/bugs/?63067>.


G. Branden Robinson <gbranden>
Group administrator
Fri 16 Sep 2022 04:40:01 PM UTC, comment #3: 

It's worth considering the possible side effects of this change.  Could it cause the font family to change in an undesirable way for things that aren't the document title on the cover page?

What calls the `misc@ev-keep` macro?

1. VERBON does.  However it takes over font selection, so this change would seem to have no effect.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n725

2. BS, the "start bottom block" macro.  It makes sense to me for such a bottom block to use the document's configured default font family.  One can always change fonts inside a BS/BE region if desired.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n1453

3. DF, which starts a floating display.  The font mounting position is saved prior to calling `misc@ev-keep` and then copied into the new environment afterward.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n1862

4. The `df@eot-print` macro, which appears to flush any pending floating displays if the end of the document is reached.  This seems reasonable and harmless, any display diversion that needs its font family changed can do so at the time it is populated.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n1896

5. DS, display start, work similarly to DF (#3 above) and the same analysis applies.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n2099

6. lix@print-text.  This internal macro is pretty deep in the call stack but it appears to be used for formatting captions below figures, tables, equations, examples, and so forth.  Font position 3 is used for this, so it would appear to be customizable via explicit use of the `fp` request.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n2639

7. lix@embedded-text.  This case seems similar to #6.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n2663

8. ref@eot-print.  This case seems similar to #4, but it is for flushing bibliographic references instead of displays.  In fact, this macro doesn't format any text.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n2888

9. ref@print-refs.  This is called by ref@eot-print and by `RP`.   This actually formats the references by calling the `ref*mac` macro to which `RS` appends.

https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/mm/m.tmac?id=5a1d89a4b59cc8b91d6b98f699258bf9a14041f5#n2903

So I can't see any harm arising here.

G. Branden Robinson <gbranden>
Group administrator
Fri 16 Sep 2022 03:02:51 PM UTC, comment #2: 

Hi Nikita,

I can confirm this defect without having to use a Cyrillic font, simply by choosing (say) Helvetia as the default family.


$ cat EXPERIMENTS/novel.mm
.\" groff -mm
.fam H
.COVER
.TL
The Great American Novel
.AU "Erasmus B.\& Dragon"
.COVEND
.P
It was a dark and stormy night.


As a workaround, you can set the default family at the command line using the `-f` option.


$ groff -mm -fH EXPERIMENTS/novel.mm >| novel.ps


This causes the default environment's font family to be Helvetica, so when new environments are created later, they copy this setting instead of Times, to which troff defaults at startup.

However, your fix is more robust.

Regards,
Branden

G. Branden Robinson <gbranden>
Group administrator
Fri 16 Sep 2022 02:07:18 PM UTC, comment #1: 

original submission:

> I've noticed a similar problem in mom as well but I think it would be better to send a patch to Peter Schaffter directly via email?


You could do that, but it is also okay to file Savannah tickets against mom(7).  Peter is a diligent watcher of the ticket tracker when it comes to such reports, and even if he weren't there a couple of groff mavens who would help bring such things to his notice.  :)

G. Branden Robinson <gbranden>
Group administrator
Fri 16 Sep 2022 01:57:21 PM UTC, original submission:  

I write in Russian and, since standard groff fonts do not support Cyrillic symbols, I have to use a third-party font family. The text is rendered correctly but titles are not. It turns out that, in the TL macro, before a diversion starts, the environment is changed, which sets \n[.fam] to the standard value, which breaks rendering for Cyrillic symbols.

I've included a patch that fixes this for the mm macro set.
I've noticed a similar problem in mom as well but I think it would be better to send a patch to Peter Schaffter directly via email?

Nikita Ivanov <nikitaivanov>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #53697:  mm-fix-tl-fam.patch added by nikitaivanov (362B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by nikitaivanov (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.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-16 gbranden StatusConfirmed Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2022-09-16 gbranden Summary[PATCH] document title that contains symbols that are not available in the standard fonts are not rendered correctly [PATCH] [mm] cover page title can use wrong font family
    2022-09-16 gbranden StatusNone Confirmed
    2022-09-16 nikitaivanov Attached File- Added mm-fix-tl-fam.patch, #53697

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code