Thread (9 messages) 9 messages, 4 authors, 2021-03-07

Re: Escaping hyphens ("real" minus signs in groff)

From: Deri <hidden>
Date: 2021-01-21 18:01:35

On Thursday, 21 January 2021 11:03:13 GMT Michael Kerrisk (man-pages) wrote:
quoted
And I mean copy-and-paste not just from PDF but from a terminal window.
Yes, but I have a question: "\-1" renders in PDF as a long dash
followed by a "1". This looks okay in PDF, but if I copy and paste
into a terminal, I don't get an ASCII 45. Seems seems to contradict
what you are saying about cut-and-paste above. What am I missing?
If I do:-

echo "- \- \[fi]"|groff -Tpdf | okular -

I see a hyphen, minus and fi ligature. Copying to a text document gives hyphen 
hyphen f i. The reason is because gropdf adds a ToUnicode CMAP entry to fonts 
which used the text.enc encoding when created with afmtodit. You can see a 
difference if you run:-

echo "- \- \[fi]"|groff -Tpdf -P-u | okular -

Which prevents the CMAP entry, and when you copy to text the minus unicode cha
character is seen. (On my system the fi ligature is separated into f i still 
but I suspect that is KDE being "helpful").

Cheers

Deri


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help