bugGNU troff - Bugs: bug #55215, [PATCH] gpinyin.1.man: Unknown...

 
 

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

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Wed 12 Dec 2018 10:30:00 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  Documentation Status:  Need Info
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Member
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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-13 gbranden StatusNone => Need Info

    Back to the top


    Powered by Savane 3.5