groff-commit
[Top][All Lists]
Advanced

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

[groff] 10/14: [mdoc]: Narrow scope of font remappings.


From: G. Branden Robinson
Subject: [groff] 10/14: [mdoc]: Narrow scope of font remappings.
Date: Fri, 6 Jan 2023 16:20:13 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 60dd8ae0dc3431c98ef0e91a853d110450954830
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jan 4 09:29:39 2023 -0600

    [mdoc]: Narrow scope of font remappings.
    
    * tmac/mdoc/doc-common (Sh, Ss): Narrow scope of font remappings
      lexically and restrict remapping to the heading font family (if any)
      to avoid undesired remapping of fonts in page headers if, say, a
      (sub)section heading begins just prior to a page break--which is ugly
      anyway and should be avoided, but the package has no keep macros and
      solving that problem in an automatic way promises to be complex.
---
 ChangeLog            | 10 ++++++++++
 tmac/mdoc/doc-common | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 459bcee46..ae031a3cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-01-03  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/mdoc/doc-common (Sh, Ss): Narrow scope of font remappings
+       lexically and restrict remapping to the heading font family (if
+       any) to avoid undesired remapping of fonts in page headers if,
+       say, a (sub)section heading begins just prior to a page
+       break--which is ugly anyway and should be avoided, but the
+       package has no keep macros and solving that problem in an
+       automatic way promises to be complex.
+
 2023-01-03  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/an.tmac (MT, UR): Throw style warning if macro called
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index e059c491e..53a25659f 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -1382,9 +1382,6 @@
 .  el \
 .    nr doc-in-name-section 0
 .
-.  if \n[doc-remap-I-style-in-headings] \
-.    ftr I \*[doc-heading-family]BI
-.
 .  ie \n[doc-arg-count] \{\
 .    \" we only allow 'Sh' within 'Sh'; it will change the font back to
 .    \" 'doc-Sh-font'
@@ -1474,6 +1471,9 @@
 .      ss (\n[.ss] * 5 / 3) (\n[.sss] * 5 / 3)
 .    \}
 .
+.  if \n[doc-remap-I-style-in-headings] \
+.    ftr \*[doc-heading-family]I \*[doc-heading-family]BI
+.
 .    nr doc-arg-ptr +1
 .    nr doc-curr-font \n[.f]
 .    nop \*[doc-Sh-font]\c
@@ -1486,10 +1486,10 @@
 .    ns
 .
 .    doc-check-depth
+.  if \n[doc-remap-I-style-in-headings] \
+.    ftr \*[doc-heading-family]I \*[doc-heading-family]I
 .  \}
 .
-.  if \n[doc-remap-I-style-in-headings] \
-.    ftr I I
 .
 .  \" Don't let doc-print-recursive force caps on anything else.
 .  nr doc-do-capitalize 0
@@ -1511,9 +1511,6 @@
 .
 .eo
 .de Ss
-.  if \n[doc-remap-I-style-in-headings] \
-.    ftr I \*[doc-heading-family]BI
-.
 .  ie \n[doc-arg-count] \{\
 .    \" we only allow 'Ss' within 'Ss'; it will change the font back to
 .    \" 'doc-Sh-font'
@@ -1555,6 +1552,9 @@
 .    nr doc-reg-Ss1 \n[.sss]
 .    ss (\n[.ss] * 5 / 4) (\n[.sss] * 5 / 4)
 .
+.  if \n[doc-remap-I-style-in-headings] \
+.    ftr \*[doc-heading-family]I \*[doc-heading-family]BI
+.
 .    nr doc-arg-ptr +1
 .    nr doc-curr-font \n[.f]
 .    nop \*[doc-Sh-font]\c
@@ -1570,10 +1570,10 @@
 .    ns
 .
 .    doc-check-depth
+.  if \n[doc-remap-I-style-in-headings] \
+.    ftr \*[doc-heading-family]I \*[doc-heading-family]I
 .  \}
 .
-.  if \n[doc-remap-I-style-in-headings] \
-.    ftr I I
 ..
 .ec
 .



reply via email to

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