bug-groff
[Top][All Lists]
Advanced

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

[bug #63112] [grotty] incomplete support for Latin-2, Latin-5, Latin-9


From: G. Branden Robinson
Subject: [bug #63112] [grotty] incomplete support for Latin-2, Latin-5, Latin-9
Date: Mon, 26 Sep 2022 20:56:02 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?63112>

                 Summary: [grotty] incomplete support for Latin-2, Latin-5,
Latin-9
                 Project: GNU troff
               Submitter: gbranden
               Submitted: Tue 27 Sep 2022 12:56:00 AM UTC
                Category: Device - others/general
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 27 Sep 2022 12:56:00 AM UTC By: G. Branden Robinson <gbranden>
The macro files that map eight-bit input characters to appropriate groff
special character escape sequences are well and good but they don't completely
handle the question of output.

Consider.


$ printf '\\[Eu]\\[vS]\\[vs]\\[vZ]\\[vz]\\[OE]\\[oe]\\[:Y]\n' | groff -Tlatin1
-mlatin9 -Z 
x T latin1
x res 240 24 40
x init
p1
troff: <standard input>:1: warning: can't find special character 'vS'
troff: <standard input>:1: warning: can't find special character 'vs'
troff: <standard input>:1: warning: can't find special character 'vZ'
troff: <standard input>:1: warning: can't find special character 'vz'
troff: <standard input>:1: warning: can't find special character ':Y'
x font 1 R
f1
s10
V40
H0
md
DFd
tEUROEoe
n40 0
x trailer
V2640
x stop


This clearly won't do.  Fallbacks are being used for the Euro sign and both
cases of the OE ligature, and rendering of five other glyphs isn't attempted
at all--and yet these are the very characters that distinguish Latin-9 from
Latin-1!

Worse, none of the font description files for the grotty devices even define
these glyphs.

However, since these font descriptions are for terminals, not typesetters,
little in the way of glyph descriptions is needed.  (Traditionally, all glyphs
are the standard width for the output device and the character type is always
zero.)  So all we really need is a way to get from the special character
identifier to an index in the "font", which is defined as its code point in
the encoding.

Thus, like Hans Niemann, we find we can cheat our way to victory.


$ git di tmac
diff --git a/tmac/latin9.tmac b/tmac/latin9.tmac
index 7a9b67979..bc805e8fa 100644
--- a/tmac/latin9.tmac
+++ b/tmac/latin9.tmac
@@ -2,6 +2,26 @@
 .\"
 .do nr *groff_latin9_tmac_C \n[.cp]
 .cp 0
+.\" Replace characters that ISO Latin-1 has but Latin-9 doesn't.
+.char \[Cs] \ \" space
+.char \[bb] \ \" space
+.char \[ad] \ \" space
+.char \[aa] \ \" space
+.char \[ac] \ \" space
+.char \[12] 1/2
+.char \[14] 1/4
+.char \[34] 3/4
+.\" Map characters that ISO Latin-9 has and Latin-1 doesn't to their
+.\" numeric code points.
+.char \[Eu] \N'164'
+.char \[vS] \N'166'
+.char \[vs] \N'168'
+.char \[vZ] \N'180'
+.char \[vz] \N'184'
+.char \[OE] \N'188'
+.char \[oe] \N'189'
+.char \[:Y] \N'190'
+.\" Translate eight-bit input characters.
 .\" 0xA0
 .\" char160 (no-break space) is translated on input
 .trin \[char161]\[r!]


For the result, see the attachment.

Splendid.

The same needs to be done for latin2.tmac and latin5.tmac and finally this
feature will work as advertised.






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Tue 27 Sep 2022 12:56:00 AM UTC  Name: showing-off-latin-9.png  Size:
180B   By: gbranden

<http://savannah.gnu.org/bugs/download.php?file_id=53758>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63112>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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