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

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

 



On Thursday, 21 January 2021 11:03:13 GMT Michael Kerrisk (man-pages) wrote:
> > 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






[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux