summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2022-01-15 12:13:45 +1100
committerG. Branden Robinson <g.branden.robinson@gmail.com>2022-01-21 01:51:03 +1100
commita246806d81351996ac2fa4a8f0826915e576bc0f (patch)
tree60b5b698692635cdd5be0a9f405fb1907940460e
parent4ed40c881074b3701e097001c3cc0d2d4ce11884 (diff)
downloadgroff-git-a246806d81351996ac2fa4a8f0826915e576bc0f.tar.gz
Simplify Unicode character mapping process.
* tmac/unicode.tmac: Drop. It was originally added in 2005 to suppress horizontal spacing of glyphs in the range U+0483..9. Its purpose has wandered over the years; most recently to map the Basic Latin ("ASCII") hyphen-minus, apostrophe, and grave accent to special characters (and thus ultimately to the General Punctuation block). But this is unnecessary since the font descriptions for devices with the `unicode` property can provide this information, and anyone who wants to alter the mappings can change either font description files, output device macro files, or troffrc; or add `char` requests to their macro packages or documents (in decreasing magnitude of ambition). * tmac/html.tmac: * tmac/tty.tmac: Stop sourcing unicode.tmac. * tmac/tmac.am (TMACNORMALFILES): Stop shipping it. * font/devutf8/NOTES: Drop remarks about mapping of \[a~], \[a^], and Basic Latin circumflex accent and tilde. Not only do I disagree with the reasoning (whether these glyphs are "too small" depends on the font used by the terminal emulator, over which we have no control), but this mapping happens in a completely different part of the source tree, src/libs/libgroff/glyphuni.cpp. * font/devhtml/R.proto: * font/devutf8/R.proto: Add mappings for the five Basic Latin characters that map surprisingly (see groff_char(7)) and are not syntactically significant to troff. Three of these are ported from unicode.tmac. (html): Don't migrate the hyphen-minus--yet.
-rw-r--r--ChangeLog36
-rw-r--r--font/devhtml/R.proto11
-rw-r--r--font/devutf8/NOTES6
-rw-r--r--font/devutf8/R.proto5
-rw-r--r--tmac/html.tmac2
-rw-r--r--tmac/tmac.am1
-rw-r--r--tmac/tty.tmac3
-rw-r--r--tmac/unicode.tmac15
8 files changed, 50 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 3320f3a55..0fb1b0095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,41 @@
2022-01-15 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [font,tmac]: Simplify Unicode character mapping process.
+
+ * tmac/unicode.tmac: Drop. It was originally added in 2005 to
+ suppress horizontal spacing of glyphs in the range U+0483..9.
+ Its purpose has wandered over the years; most recently to map
+ the Basic Latin ("ASCII") hyphen-minus, apostrophe, and grave
+ accent to special characters (and thus ultimately to the General
+ Punctuation block). But this is unnecessary since the font
+ descriptions for devices with the `unicode` property can provide
+ this information, and anyone who wants to alter the mappings can
+ change either font description files, output device macro files,
+ or troffrc; or add `char` requests to their macro packages or
+ documents (in decreasing magnitude of ambition).
+
+ * tmac/html.tmac:
+ * tmac/tty.tmac: Stop sourcing unicode.tmac.
+
+ * tmac/tmac.am (TMACNORMALFILES): Stop shipping it.
+
+ * font/devutf8/NOTES: Drop remarks about mapping of \[a~],
+ \[a^], and Basic Latin circumflex accent and tilde. Not only do
+ I disagree with the reasoning (whether these glyphs are "too
+ small" depends on the font used by the terminal emulator, over
+ which we have no control), but this mapping happens in a
+ completely different part of the source tree,
+ src/libs/libgroff/glyphuni.cpp.
+
+ * font/devhtml/R.proto:
+ * font/devutf8/R.proto: Add mappings for the five Basic Latin
+ characters that map surprisingly (see groff_char(7)) and are not
+ syntactically significant to troff. Three of these are ported
+ from unicode.tmac.
+ (html): Don't migrate the hyphen-minus--yet.
+
+2022-01-15 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* tmac/tty-char.tmac: Drop redundant logic. We don't need to
source the `cp1047` or `latin1` files here; `troffrc` will
already have loaded `tty` for us, which already does so.
diff --git a/font/devhtml/R.proto b/font/devhtml/R.proto
index 357052fba..bfe06e751 100644
--- a/font/devhtml/R.proto
+++ b/font/devhtml/R.proto
@@ -1,9 +1,16 @@
name R
internalname 0
spacewidth 24
+# TODO:
+#- 24 0 0x2010
+#hy "
charset
-hy 24 0 0x002D
-- "
+' 24 0 0x2019
+- 24 0 0x002D
+hy "
+` 24 0 0x2018
+^ 24 0 0x02C6
+~ 24 0 0x02DC
la 24 0 0x2329
ra 24 0 0x232A
u0041_0300 24 0 0x00C0
diff --git a/font/devutf8/NOTES b/font/devutf8/NOTES
index e8fe25157..0906b8ade 100644
--- a/font/devutf8/NOTES
+++ b/font/devutf8/NOTES
@@ -20,12 +20,6 @@ the TeX system).
space 24 0 0x0020
-devps maps \[a~] and '~' to 'asciitilde', which is equivalent to 0x02DC, but
-this glyph is just too small. We map them to 0x007E instead.
-
-devps maps \[a^] and '^' to 'circumflex', which is equivalent to 0x02C6, but
-this glyph is just too small. We map them to 0x005E instead.
-
devps maps \[*U] to 'Upsilon1', which is equivalent to 0x03D2. We map it to
0x03A5 instead.
diff --git a/font/devutf8/R.proto b/font/devutf8/R.proto
index a8e81a99a..3233af877 100644
--- a/font/devutf8/R.proto
+++ b/font/devutf8/R.proto
@@ -2,6 +2,11 @@ name R
internalname 0
spacewidth 24
charset
+' 24 0 0x2019
+- 24 0 0x2010
+` 24 0 0x2018
+^ 24 0 0x02C6
+~ 24 0 0x02DC
u0041_0300 24 0 0x00C0
u0041_0301 24 0 0x00C1
u0041_0302 24 0 0x00C2
diff --git a/tmac/html.tmac b/tmac/html.tmac
index 8ed03b4ab..887b2882c 100644
--- a/tmac/html.tmac
+++ b/tmac/html.tmac
@@ -540,8 +540,6 @@
.el \
. mso cp1047.tmac
.
-.mso unicode.tmac
-.
.cp \n[*groff_html_tmac_C]
.do rr *groff_html_tmac_C
.
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 7c8a93e4b..5e276368e 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -62,7 +62,6 @@ TMACNORMALFILES = \
tmac/latin5.tmac \
tmac/latin9.tmac \
tmac/cp1047.tmac \
- tmac/unicode.tmac \
tmac/X.tmac \
tmac/Xps.tmac \
tmac/lj4.tmac \
diff --git a/tmac/tty.tmac b/tmac/tty.tmac
index 2e9abded4..35a527c32 100644
--- a/tmac/tty.tmac
+++ b/tmac/tty.tmac
@@ -70,9 +70,6 @@
.fchar \[radicalex] \[rn]
.fchar \[sqrtex] \[rn]
.
-.if '\*[.T]'utf8' \
-. mso unicode.tmac
-.
.\" color definitions
.defcolor black rgb #000000
.defcolor red rgb #ff0000
diff --git a/tmac/unicode.tmac b/tmac/unicode.tmac
deleted file mode 100644
index 46cf74b08..000000000
--- a/tmac/unicode.tmac
+++ /dev/null
@@ -1,15 +0,0 @@
-.\" unicode.tmac
-.\"
-.do nr *groff_unicode_tmac_C \n[.cp]
-.cp 0
-.char - \[hy]
-.char ` \[oq]
-.char ' \[cq]
-.cp \n[*groff_unicode_tmac_C]
-.do rr *groff_unicode_tmac_C
-.
-.\" Local Variables:
-.\" mode: nroff
-.\" fill-column: 72
-.\" End:
-.\" vim: set filetype=groff textwidth=72: