bugGNU roff - Bugs: bug #55215, gpinyin.1.man: Unknown characters...

 
 

bug #55215: gpinyin.1.man: Unknown characters and failed adjustment

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Wed 12 Dec 2018 10:30:00 PM UTC
   
 
Category:  Preprocessor - others/general Severity:  3 - Normal
Item Group:  Documentation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 15 Jun 2022 02:16:26 PM UTC, comment #5: 

"I propose to resolve this problem by having the page simply not render the tone table if the output device is incapable of doing so."

G. Branden Robinson <gbranden>
Group administrator
Thu 13 May 2021 09:15:46 AM UTC, comment #4: 


commit 526a7597f4fbbb3531062a48289af9cc1d3e7658
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon May 10 23:26:20 2021 +1000

    gpinyin(1): Make some page content conditional.

    * contrib/gpinyin/gpinyin.1.man: Render the tone mark table only if the
      output device might be capable.

    Fixes <https://savannah.gnu.org/bugs/index.php?55215>.


G. Branden Robinson <gbranden>
Group administrator
Mon 10 May 2021 01:17:27 PM UTC, comment #3: 

I propose to resolve this problem by having the page simply not render the tone table if the output device is incapable of doing so.

This is much simpler than the patch Bjarni suggested.


diff --git a/contrib/gpinyin/gpinyin.1.man b/contrib/gpinyin/gpinyin.1.man
index f9e14a48..94e1e4a3 100644
--- a/contrib/gpinyin/gpinyin.1.man
+++ b/contrib/gpinyin/gpinyin.1.man
@@ -213,10 +213,10 @@ The tone numbers 0 and 5 are synonymous.
 .
 .
 .P
-The following table summarizes the tones.
-.
-Some output devices will not be able to render every output example.
-.
+.if t .nr gpinyin*do-table 1
+.if n .if '\*[.T]'utf8' .nr gpinyin*do-table 1
+.ie \n[gpinyin*do-table] \{\
+The tones are written as follows.
 .
 .P
 .\" XXX: This is so gross.  Why can't grops and gropdf figure this out?
@@ -236,6 +236,14 @@ fourth     falling \[ga]   ma4     m\[a ga]
 fifth  neutral (none)  ma0     ma
 \^     \^      \^      ma5     \^
 .TE
+.\}
+.el \{
+[The tone mark table is omitted from this rendering of the man page
+because the selected output device \[lq]\*[.T]\[rq] lacks the character
+repertoire to display it.
+.
+Try another output device.]
+.\}
 .
 .
 .P


G. Branden Robinson <gbranden>
Group administrator
Thu 20 Dec 2018 08:01:25 PM UTC, comment #2: 

  I use the latin1 locale.

  I adjusted the patch to accommodate ASCII output and compatibility mode.

#

1) Make compatibility and ASCII output (device) mode available.

2) Define a fallback character for an unknown special character, both
for "nroff" and "troff".

3) Adjustment of a string to both margins "always" fails.

  Use (generally) only a left adjustment for the text in question.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 contrib/gpinyin/gpinyin.1.man | 59 +++++++++++++++++++++++++++++++----
 1 file changed, 53 insertions(+), 6 deletions(-)

diff --git a/contrib/gpinyin/gpinyin.1.man b/contrib/gpinyin/gpinyin.1.man
index db634fdd..9ca44f19 100644
--- a/contrib/gpinyin/gpinyin.1.man
+++ b/contrib/gpinyin/gpinyin.1.man
@@ -23,6 +23,10 @@ gpinyin \- use Hanyu Pinyin Chinese in roff
 .\" Local definitions
 .\" ====================================================================
 .
+.nr _C \n(.C
+.cp 0
+.mso tty-char.tmac
+.
 .\" Define a string for the TeX logo.
 .ie t .ds TeX T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
 .el   .ds TeX TeX
@@ -145,7 +149,12 @@ these letters comprise the fifty-two upper- and lowercase letters from
 the ASCII character set,
 plus the letter \[lq]U\[rq] with dieresis (umlaut) in both cases\[em]in
 other words,
-the members of the set \[lq][a\[en]zA\[en]Z\[:u]\[:U]]\[rq].
+the members of the set
+.ie '\*[.T]'ascii' \{\
+  \[lq][a\[en]zA\[en]Z]\[rq]
+and the Latin letters \[lq]udieresis\[rq] and \[lq]Udieresis\[rq].
+.\}
+.el \[lq][a\[en]zA\[en]Z\[:u]\[:U]]\[rq].
 .
 .
 .P
@@ -201,19 +210,54 @@ The tone numbers 0 and 5 are synonymous.
 .P
 The following table summarizes the tones.
 .
-Some output devices will not be able to render every output example.
+Some output devices will not be able to render every output example
+correctly.
 .
 .
 .P
 .if t .ne 8 \" Try to keep the table on one page for printed output.
+.
+.ie '\*[.T]'ascii' \{\
+.\" macron = \[a-] looks bad with -Tascii
+.\" diacritics are typed first (on a dead key)
+.  char \[caron] v
+.  char \[macron] -
+.  char \[aacute] 'a
+.  char \[acaron] \[caron]a
+.  char \[agrave] `a
+.  char \[amacron] \[macron]a
+.\}
+.el \{\
+.  char \[macron] \[a-]
+.  char \[aacute] \['a]
+.  char \[agrave] \[`a]
+.
+.  ie c \[u0061_0304] \{\
+.    char \[amacron] \[u0061_0304]
+.  \}
+.  el \{\
+.    ie n .char \[amacron] \[a-]a
+.    el   .char \[amacron] \z\[a-]a
+.  \}
+.
+.  ie c \[u0061_030C] \{\
+.    char \[acaron] \[u0061_030C]
+.\}
+.  el \{\
+.    ie n .char \[acaron] \[ah]a
+.    el   .char \[acaron] \z\[ah]a
+.  \}
+.\}
+.
+.
 .TS
 l l l l l.
 Tone        Description        Diacritic        Example Input        Example Output
 _
-first        flat        \[a-]        ma1        m\[u0061_0304]
-second        rising        \[aa]        ma2        m\[u0061_0301]
-third        falling-rising        \[ah]        ma3        m\[u0061_030C]
-fourth        falling        \[ga]        ma4        m\[u0061_0300]
+first        flat        \[macron]        ma1        m\[amacron]
+second        rising        \[aa]        ma2        m\[aacute]
+third        falling-rising        \[ah]        ma3        m\[acaron]
+fourth        falling        \[ga]        ma4        m\[agrave]
 fifth        neutral        (none)        ma0        ma
 \^        \^        \^        ma5        \^
 .TE
@@ -298,6 +342,7 @@ romanization
 .UE ,
 .
 .br
+.ad l
 .UR http://\:git.savannah.gnu.org/\:gitweb/\:\
 ?p=cjk.git;a=blob_plain;f=doc/\:pinyin.txt;hb=HEAD
 pinyin.txt from the CJK macro package for \*[TeX]
@@ -313,6 +358,7 @@ and
 pinyin.sty from the CJK macro package for \*[TeX]
 .UE .
 .
+.ad
 .RE
 .
 .P
@@ -333,6 +379,7 @@ are comprehensive references covering the language elements of GNU
 .I roff
 and the available glyph repertoire,
 respectively.
+.cp \n[_C]
 .
 .
 .\" ====================================================================
--
2.19.2


Bjarni Ingi Gislason <bjarniig>
Thu 13 Dec 2018 02:42:04 PM UTC, comment #1: 

The first problem is locale-related.


$ LC_CTYPE=en_US.UTF-8 man -l build/contrib/gpinyin/gpinyin.1 >/dev/null
$ LC_CTYPE=C man -l build/contrib/gpinyin/gpinyin.1 >/dev/null
<standard input>:213: warning: can't find special character `u0061_0304'
<standard input>:215: warning: can't find special character `u0061_030C'


I'm not sure this problem is the page's fault.  Shouldn't all these composed characters be degrading the same way on -Tascii?

G. Branden Robinson <gbranden>
Group administrator
Wed 12 Dec 2018 10:30:00 PM UTC, original submission:  

From 8dc892514c7665b05ddc048ea21a593deba405cd Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Wed, 12 Dec 2018 22:20:37 +0000
Subject: [PATCH] gpinyin.1.man: Unknown characters and failed adjustment

  Warnings:

1) From "man -l gpinyin.1

troff: <standard input>:213: warning: can't find special character 'u0061_0304'
troff: <standard input>:215: warning: can't find special character 'u0061_030C'

2) From: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z gpinyin.1

.../groff/build/../tmac/an-ext.tmac:129: backtrace: macro 'UE'
troff: <gpinyin.1>:304: warning [p 2, 6.7i]: cannot adjust line
.../groff/build/../tmac/an-ext.tmac:129: backtrace: macro 'UE'
troff: <gpinyin.1>:314: warning [p 2, 7.3i]: cannot adjust line

#

1) Define missing characters.

2) Adjustment of a string to both margins "always" fails.

  Use (generally) only a left adjustment for the text in question.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 contrib/gpinyin/gpinyin.1.man | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/contrib/gpinyin/gpinyin.1.man b/contrib/gpinyin/gpinyin.1.man
index db634fdd..e3f9e3bc 100644
--- a/contrib/gpinyin/gpinyin.1.man
+++ b/contrib/gpinyin/gpinyin.1.man
@@ -206,14 +206,37 @@ Some output devices will not be able to render every output example.
 .
 .P
 .if t .ne 8 \" Try to keep the table on one page for printed output.
+.
+.ie n \{\
+.  char \[amacron] a\[a-]
+.  char \[aacute] \['a]
+.  char \[acaron] a\[ah]
+.  char \[agrave] \[`a]
+.\}
+.el \{\
+.  ie c \[u0061_0304] \{\
+.      char \[amacron] \[u0061_0304]
+.  \}
+.  el .char \[amacron] \za\[a-]
+.
+.  char \[aacute] \[u0061_0301]
+.
+.  ie c \[u0061_030C] \{\
+.      char \[acaron] \[u0061_030C]
+.  \}
+.  el .char \[acaron] \za\[ah]
+.
+.  char \[agrave] \[u0061_0300]
+.\}
+.
 .TS
 l l l l l.
 Tone        Description        Diacritic        Example Input        Example Output
 _
-first        flat        \[a-]        ma1        m\[u0061_0304]
-second        rising        \[aa]        ma2        m\[u0061_0301]
-third        falling-rising        \[ah]        ma3        m\[u0061_030C]
-fourth        falling        \[ga]        ma4        m\[u0061_0300]
+first        flat        \[a-]        ma1        m\[amacron]
+second        rising        \[aa]        ma2        m\[aacute]
+third        falling-rising        \[ah]        ma3        m\[acaron]
+fourth        falling        \[ga]        ma4        m\[agrave]
 fifth        neutral        (none)        ma0        ma
 \^        \^        \^        ma5        \^
 .TE
@@ -298,6 +321,7 @@ romanization
 .UE ,
 .
 .br
+.ad l
 .UR http://\:git.savannah.gnu.org/\:gitweb/\:\
 ?p=cjk.git;a=blob_plain;f=doc/\:pinyin.txt;hb=HEAD
 pinyin.txt from the CJK macro package for \*[TeX]
@@ -313,6 +337,7 @@ and
 pinyin.sty from the CJK macro package for \*[TeX]
 .UE .
 .
+.ad
 .RE
 .
 .P
--
2.19.2


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-15 gbranden CategoryNone Preprocessor - others/general
        Summary[PATCH] gpinyin.1.man: Unknown characters and failed adjustment gpinyin.1.man: Unknown characters and failed adjustment
    2021-05-13 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2021-05-10 gbranden StatusNeed Info In Progress
        Assigned toNone gbranden
    2018-12-13 gbranden StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code