summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2022-10-23 14:54:45 -0500
committerG. Branden Robinson <g.branden.robinson@gmail.com>2022-10-23 20:48:26 -0500
commit132182bd714a7b327bae1627831836cd1484522b (patch)
tree3c6f36de542b9acf04a1fd4b88d937a0f0c83e96
parentf35dcc992c1852802347d1758588c1862808d9b9 (diff)
downloadgroff-git-132182bd714a7b327bae1627831836cd1484522b.tar.gz
[tmac]: Fix Savannah #58930.
* tmac/fallbacks.tmac: Define fallback characters for many code points from the Unicode General Punctuation Block. This is to ease migration from other documentation formats; in many cases there are more idiomatic *roff ways of getting results that typeset better and are amenable to fine tuning. For instance, Unicode defines spaces and dashes of various discrete widths; when typesetting with *roff, you can have a space or dash (among other things) of any length achievable by the output device. * tmac/ps.tmac: Migrate non-breaking hyphen fallback character definition from here to the foregoing. Fixes <https://savannah.gnu.org/?58930>. Thanks to Dave Kemper for the report and discussion.
-rw-r--r--ChangeLog16
-rw-r--r--tmac/fallbacks.tmac43
-rw-r--r--tmac/ps.tmac3
3 files changed, 59 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 02352cfe3..ee031bc06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
2022-10-23 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * tmac/fallbacks.tmac: Define fallback characters for many code
+ points from the Unicode General Punctuation Block. This is to
+ ease migration from other documentation formats; in many cases
+ there are more idiomatic *roff ways of getting results that
+ typeset better and are amenable to fine tuning. For instance,
+ Unicode defines spaces and dashes of various discrete widths;
+ when typesetting with *roff, you can have a space or dash (among
+ other things) of any length achievable by the output device.
+ * tmac/ps.tmac: Migrate non-breaking hyphen fallback character
+ definition from here to the foregoing.
+
+ Fixes <https://savannah.gnu.org/?58930>. Thanks to Dave Kemper
+ for the report and discussion.
+
+2022-10-23 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* tmac/an.tmac:
* tmac/s.tmac: Escape newlines when opening conditional blocks.
diff --git a/tmac/fallbacks.tmac b/tmac/fallbacks.tmac
index 428aaa2b7..633dbc711 100644
--- a/tmac/fallbacks.tmac
+++ b/tmac/fallbacks.tmac
@@ -142,6 +142,49 @@
.fchar \[oe] oe
.fchar \[:Y] \z\[ad]Y
.
+.fchar \[u2000] \[u2002]\" en quad
+.fchar \[u2001] \[u2003]\" em quad
+.fchar \[u2002] \h'1/2u'\" en space
+.fchar \[u2003] \h'1'\" em space
+.fchar \[u2004] \h'1/3u'\" three-per-em space
+.fchar \[u2005] \h'1/4u'\" four-per-em space
+.fchar \[u2006] \h'1/6u'\" six-per-em space
+.fchar \[u2007] \0\" figure space
+.fchar \[u2008] \^\" puncutation space
+.fchar \[u2009] \|\" thin space
+.fchar \[u200A] \^\" hair space
+.fchar \[u200B] \h'0'\" zero-width space
+.fchar \[u2010] -\:\" hyphen
+.fchar \[u2011] -\" non-breaking hyphen (won't break w/o .hcode or \:)
+.ie t .fchar \[u2012] \v'-.3m'\l'\w"\0"u\[ru]'\v'+.3m'\" figure dash
+.el .fchar \[u2012] \-
+.fchar \[u2013] \[en]\" en dash
+.fchar \[u2014] \[em]\" em dash
+.fchar \[u2015] \[em]\" horizontal bar (quotation dash)
+.fchar \[u2016] ||\" double vertical line (matrix norm)
+.if t .fchar \[u2017] \Z'\[ul]'\v'+.1m'\[ul]\v'-.1m'\" double low line
+.fchar \[u2018] \[oq]\" left single quotation mark
+.fchar \[u2019] \[cq]\" right single quotation mark
+.fchar \[u201C] \[lq]\" left double quotation mark
+.fchar \[u201D] \[rq]\" right double quotation mark
+.fchar \[u2020] \[dg]\" dagger
+.fchar \[u2021] \[dd]\" double dagger
+.fchar \[u2022] \[bu]\" bullet
+.fchar \[u2024] .\" one dot leader
+.fchar \[u2025] .\|.\" two dot leader
+.fchar \[u2026] .\|.\|.\" horizontal ellipsis
+.fchar \[u2027] \[pc]\" hyphenation point
+.fchar \[u2030] \[%0]\" per mille sign
+.fchar \[u2032] \[fm]\" prime
+.fchar \[u2033] \[sd]\" double prime
+.fchar \[u2039] \[fo]\" left single chevron
+.fchar \[u203A] \[fc]\" right single chevron
+.if t .fchar \[u203D] \o'?!'\" interrobang
+.fchar \[u203E] \[rn]\" overline
+.fchar \[u2044] \[f/]\" fraction slash
+.fchar \[u2052] %\" commercial minus sign
+.fchar \[u2053] \[ti]\" swung dash
+.
.cp \n[*groff_fallbacks_tmac_C]
.do rr *groff_fallbacks_tmac_C
.
diff --git a/tmac/ps.tmac b/tmac/ps.tmac
index 0f512b42a..9e59c571b 100644
--- a/tmac/ps.tmac
+++ b/tmac/ps.tmac
@@ -28,9 +28,6 @@
.
.cflags 8 \[an]
.
-\# non-breaking hyphen
-.fchar \[u2011] -
-.
.char \[radicalex] \h'-\w'\[sr]'u'\[radicalex]\h'\w'\[sr]'u'
.fchar \[sqrtex] \[radicalex]
.char \[mo] \h'.08m'\[mo]\h'-.08m'