[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 04/05: [man]: Handle \*[HF] with embedded font family.
From: |
G. Branden Robinson |
Subject: |
[groff] 04/05: [man]: Handle \*[HF] with embedded font family. |
Date: |
Fri, 7 May 2021 22:27:40 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit d576e17aa9f4a312623e5b82a90dc89702a1cd81
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 8 12:05:44 2021 +1000
[man]: Handle \*[HF] with embedded font family.
Handle HF strings with an embedded font family when applying
bold-to-bold-italic remapping; the feature now works on troff devices as
well.
* tmac/an-old.tmac (initialization): Do more validity checking. Store
heading family in new string \*[an-heading-family]. Clean up after
self.
(SH, SS): Include the heading family in the remapping target.
* tmac/groff_man.7.man.in (Description/Document structure macros) <.SH,
.SS>: Document it.
Try it!
./build/test-groff -t -man -dHF=HB ./build/man/roff.7 >| roff.7.ps
---
ChangeLog | 14 ++++++++++++++
tmac/an-old.tmac | 18 ++++++++++++++----
tmac/groff_man.7.man.in | 8 ++++++++
3 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0fc8303..00858e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2021-05-08 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [man]: Handle HF strings with an embedded font family when
+ applying bold-to-bold-italic remapping; the feature now works
+ on troff devices as well.
+
+ * tmac/an-old.tmac (initialization): Do more validity checking.
+ Store heading family in new string \*[an-heading-family]. Clean
+ up after self.
+ (SH, SS): Include the heading family in the remapping target.
+
+ * tmac/groff_man.7.man.in (Description/Document structure
+ macros) <.SH, .SS>: Document it.
+
2021-05-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff_char.7.man (Glyph tables/Mathematical symbols): Fix
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index e6594b5..b401ce9 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -323,7 +323,7 @@
. nr an-break-flag 1
. ps \\n[PS-SH]u
. ft \\*[HF]
-. if \\n[an-HF-remap-I-style] .ftr I BI
+. if \\n[an-HF-remap-I-style] .ftr I \\*[an-heading-family]BI
. ne (2v + 1u)
. if \\n[.$] \{\
. ds an-section-heading \\$*\"
@@ -346,7 +346,7 @@
. nr an-break-flag 1
. ps \\n[PS-SS]u
. ft \\*[HF]
-. if \\n[an-HF-remap-I-style] .ftr I BI
+. if \\n[an-HF-remap-I-style] .ftr I \\*[an-heading-family]BI
. ne (2v + 1u)
. if \\n[.$] \&\\$*
. if \\n[an-HF-remap-I-style] .ftr I I
@@ -831,9 +831,19 @@
. ds HF B\"
.
.\" If HF is a bold style, use bold italics for italics in headings.
-.ds an-heading-style \*[HF]
+.ds an-heading-style \*[HF]\"
.substring an-heading-style -1 -1
-.if '\*[an-heading-style]'B' .nr an-HF-remap-I-style 1
+.ds an-heading-family \" empty
+.length an-HF-length \*[HF]
+.if (\n[an-HF-length] > 1) \{
+. as an-heading-family \*[HF]\"
+. substring an-heading-family 0 -2
+.\}
+.if '\*[an-heading-style]'B' \
+. if F \*[an-heading-family]BI \
+. nr an-HF-remap-I-style 1
+.rr an-HF-length
+.rm an-heading-style
.
.if \n[cR] \
. an-set-up-continuous-rendering
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 1fc996e..0303562 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -463,6 +463,10 @@ and,
on typesetter devices,
slightly larger than the base point size.
.
+Use of an italic style in
+.I heading-text
+is mapped to the bold-italic style if available in the font family.
+.
Additionally,
the left margin and indentation affecting subsequent text are reset to
their default values.
@@ -526,6 +530,10 @@ is set in bold
(or the font specified by the string
.BR HF ).
.
+Use of an italic style in
+.I heading-text
+is mapped to the bold-italic style if available in the font family.
+.
Additionally,
the left margin and indentation affecting subsequent text are reset to
their default values.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 04/05: [man]: Handle \*[HF] with embedded font family.,
G. Branden Robinson <=