bug-groff
[Top][All Lists]
Advanced

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

[bug #66323] grops should handle special character escape sequences in c


From: G. Branden Robinson
Subject: [bug #66323] grops should handle special character escape sequences in certain device control commands
Date: Sat, 12 Oct 2024 13:24:26 -0400 (EDT)

Update of bug #66323 (group groff):

                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #11:

[comment #0 original submission:]
> # f=bad; pdfmom -Tps -K utf-8 $f.mom > $f.ps
> troff:bad.mom:5: error: cannot write a node to device-independent output
> troff:bad.mom:5: error: cannot write a node to device-independent output
> troff:bad.mom:5: error: cannot write a node to device-independent output
> troff:bad.mom:5: error: cannot write a node to device-independent output
> troff:bad.mom:5: error: cannot write a node to device-independent output
> GPL Ghostscript 10.04.0: Unrecoverable error, exit code 1
> 
> good.ps works (but see #66322), bad.ps detonates every parser I gave it to.

I get slightly different output from bleeding-edge _groff_ Git.


$ groff --version | head -n 1
GNU groff version 1.23.0.2208-e004b
$ cksum ATTIC/bad.mom
4257237161 9848 ATTIC/bad.mom
$ (f=ATTIC/bad; pdfmom -Tps -K utf-8 $f.mom > $f.ps)
troff:ATTIC/bad.mom:5: warning: special character 'u043D' not defined
troff:ATTIC/bad.mom:5: warning: special character 'u0430' not defined
troff:ATTIC/bad.mom:5: warning: special character 'u0431' not defined
troff:ATTIC/bad.mom:5: error: cannot write a node to device-independent
output
troff:ATTIC/bad.mom:5: error: cannot write a node to device-independent
output
GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1


Here's line 5 of the document.


.AUTHOR    "\v'-.5v'\*[UP 8p]наб, seb, rCs"


`\v` is a vertical motion escape sequence and produces a vertical motion node.
 `UP` is a _mom_(7) string that does something similar.  And one of her own
model documents shipped with _groff_ as an example does the same `AUTHOR UP`
thing.

This matter is covered at length in the
[https://lists.gnu.org/archive/html/groff/2024-08/msg00085.html so-called
"demystified" mailing list thread] I started earlier this year.

In a nutshell, _mom_(7) should be scrubbing things like vertical motions out
the argument to her `AUTHOR` macro before passing that argument to a device
extension escape sequence (or, nearly equivalently, a `device` request).

However, GNU _troff_ at present makes such scrubbing much harder than it
should be.  See bug #62264.

So, that part is a duplicate of a known issue.

As an aside:


GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1


...but _pdfmom_ exits with status 0, so that sucks.

I guess this commit:


commit b62f0605427caa156f23c81280f345496dd8a5cc
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Sep 26 17:26:16 2024 -0500

    [pdfmom]: Handle errors and abnormal exits.


Didn't go far enough.

But what about "grout", the output of GNU _troff_?

Well, for that, let's peel off the _pdfmom_ wrapper and have a look at all the
device control commands in the grout.


$ groff -Tps -K utf-8 -Z ATTIC/bad.mom | grep '^x'
troff:ATTIC/bad.mom:84: warning: special character 'u043D' not defined
troff:ATTIC/bad.mom:84: warning: special character 'u0430' not defined
troff:ATTIC/bad.mom:84: warning: special character 'u0431' not defined
x T ps
x res 72000 1 1
x init
x font 5 TR
x font 5 TR
x font 6 CR
x trailer
x stop


They special characters aren't getting into "grout" at all.

Not sure if this is a duplicate of an existing ticket or not, but it would be
nice to have parity between _grops_ and _gropdf_ in this respect.

I'll modify the document to make the `AUTHOR` call motionless and degenerately
Western.


$ groff -Tps -K utf-8 -Z ATTIC/bad_american.mom | grep '^x'
troff:ATTIC/bad_american.mom:84: warning: special character 'u043D' not
defined
troff:ATTIC/bad_american.mom:84: warning: special character 'u0430' not
defined
troff:ATTIC/bad_american.mom:84: warning: special character 'u0431' not
defined
x T ps
x res 72000 1 1
x init
x font 5 TR
x font 5 TR
x font 6 CR
x trailer
x stop


Hmm, no change.  Even if I add in the slated-for-the-chopping-block "pdfmark"
macro package, there is no difference.


$ groff -mpdfmark -Tps -K utf-8 -Z ATTIC/bad_american.mom | grep '^x'
troff:ATTIC/bad_american.mom:84: warning: special character 'u043D' not
defined
troff:ATTIC/bad_american.mom:84: warning: special character 'u0430' not
defined
troff:ATTIC/bad_american.mom:84: warning: special character 'u0431' not
defined
x T ps
x res 72000 1 1
x init
x font 5 TR
x font 5 TR
x font 6 CR
x trailer
x stop


So maybe parity is too far a reach for _groff_ 1.24.0.


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
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]