groff-commit
[Top][All Lists]
Advanced

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

[groff] 12/45: Simplify Unicode character mapping process.


From: G. Branden Robinson
Subject: [groff] 12/45: Simplify Unicode character mapping process.
Date: Thu, 20 Jan 2022 10:17:48 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit a246806d81351996ac2fa4a8f0826915e576bc0f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jan 15 12:13:45 2022 +1100

    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.
---
 ChangeLog            | 36 ++++++++++++++++++++++++++++++++++++
 font/devhtml/R.proto | 11 +++++++++--
 font/devutf8/NOTES   |  6 ------
 font/devutf8/R.proto |  5 +++++
 tmac/html.tmac       |  2 --
 tmac/tmac.am         |  1 -
 tmac/tty.tmac        |  3 ---
 tmac/unicode.tmac    | 15 ---------------
 8 files changed, 50 insertions(+), 29 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3320f3a5..0fb1b009 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+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
diff --git a/font/devhtml/R.proto b/font/devhtml/R.proto
index 357052fb..bfe06e75 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 e8fe2515..0906b8ad 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 a8e81a99..3233af87 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 8ed03b4a..887b2882 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 7c8a93e4..5e276368 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 2e9abded..35a527c3 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 46cf74b0..00000000
--- 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:



reply via email to

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