bug-groff
[Top][All Lists]
Advanced

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

[bug #66165] commit dcae60b0fb1ad3fa3314fdfdbecb973961a40410 has wrong a


From: Deri James
Subject: [bug #66165] commit dcae60b0fb1ad3fa3314fdfdbecb973961a40410 has wrong assumption
Date: Thu, 5 Sep 2024 19:30:38 -0400 (EDT)

Follow-up Comment #4, bug #66165 (group groff):

You seem to have drifted away from the point of this bug report which was
specifically to point out this code change may cause problems:-

    // We want to represent ordinary characters that normally map to
    // non-basic Latin code points in a way that is compatible with how
    // they're typeset, to avoid confusion when these characters are
    // used in ways that are ultimately visible, as in tag names for PDF
    // bookmarks, which can appear in a viewer's navigation pane.
    if ('\'' == c)
      mac->append_str("\\[u2019]");
    else if ('-' == c)
      mac->append_str("\\[u2010]");
    else if ('^' == c)
      mac->append_str("\\[u0302]");
    else if ('`' == c)
      mac->append_str("\\[u0300]");
    else if ('~' == c)
      mac->append_str("\\[u0303]");
    else if (c == escape_char)
      mac

My reading of this change is that you are doing the following transformations
before sending the text to output drivers:-

' U+0027 APOSTROPHE        -> ’ U+2019 RIGHT SINGLE QUOTATION MARK
- U+002D HYPHEN-MINUS      -> ‐ U+2010 HYPHEN
^ U+005E CIRCUMFLEX ACCENT -> (ab̂c) U+0302 COMBINING CIRCUMFLEX ACCENT
` U+0060 GRAVE ACCENT      -> (ab̀c) U+0300 COMBINING GRAVE ACCENT
~ U+007E TILDE             -> (ab̃c) U+0303 COMBINING TILDE

The combining versions are completely wrong, let's see what it looks like
using them:-

.ig
  Run: test-groff -Tpdf -ms -U tryX.trf
  
  A special version of HEAD using \X not \!
..
.LP
.pdfbookmark 1 My~Fave~Pic
\s[+2]\fBMy~Fave~Pic\fP\s[-2]
.LP
My favourite picture is shown below:-
.PDFPIC -L My~Fave~Pic.png

This produces this grout:-

x T pdf
x res 72000 1 1
x init
p1
V84000
H72000
x font 5 TR
f5
s10000
V84000
H72000
md
DFd
x X ps:exec [/Dest /pdf:bm1 /View [/FitH \[u2010]67000 u] /DEST pdfmark
                                         ^ causes error line 1490 gropdf
V84000
H72000
x X ps:exec [/Dest /pdf:bm1 /Title (My\[u0303]Fave\[u0303]Pic) /Level 1 /OUT
pdfmark
                                       ^ tilde changed to combining tilde
x font 36 TB
f36
s12000
tMy~F
   ^ note use of asciitilde here
H100356
ta
H106056
tv
H111936
te~Pic
n12000 0
f5
s10000
V99600
H72000
tMy
wh2500
tf
H91620
ta
H95860
tv
H100660
tourite
wh2500
tpicture
wh2500
tis
wh2500
tsho
H179570
twn
wh2500
tbelo
H211260
tw:-
n12000 0
V111600
H72000
V111600
H72000
x X pdf: pdfpic My\[u0303]Fave\[u0303]Pic.png \[u2010]L 230000z 191000z
                                              ^ gropdf won't recognise flag
n12000 0
V768000
H540000
n12000 0
x trailer
V792000
x stop

The errors during running:-

Argument "\\[u2010]67.0]" isn't numeric in multiplication (*) at
/home/derij/groff-git/groff/build/gropdf line 1490, <> line 15.
gropdf: warning: failed to open image file 'My\[u0303]Fave\[u0303]Pic.png'

And the PDF produced is attached.

The first thing to notice is the very strange bookmark. Then wonder why, in
the text of the document, the given asciitilde has become a "˜ U+02DC SMALL
TILDE". The answer is in the afmtodit.tables file:-

  "tilde", "02DC",

And the TR font file which has:-

~       333,638 2       126     tilde   --      02DC
a~      "

Which shows that the groff glyph names "~" (and \[a~] are mapped to the
postscript glyph named tilde and that has unicode \[u02DC]. So this is the
unicode you should have used in this commit, and I suspect similar mistakes
with the other combining glyphs:-

^       333,674 2       94      circumflex      --      02C6
a^      "
ga      333,678 2       146     grave   --      0060    

So grave stays as \[u0060], so I'm not sure what you were thinking.



    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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