bugGNU troff - Bugs: bug #50917, Make \- consistently render as...

 
 

bug #50917: Make \- consistently render as U+002D across all macro sets and devices

Submitted by:  Ingo Schwarze <schwarze>
Submitted on:  Tue 02 May 2017 05:04:49 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: WishlistStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 12 May 2017 10:07:50 PM UTC, comment #1:

Sorry for the confusion, but this patch is wrong for two reasons:

1. The idea to "consistently render as U+002D across all output devices" is ill-defined. There is no such thing as a U+002D (or ASCII HYPHEN-MINUS) output glyph on some devices, namely on -Tps and -Tpdf. The PostScript TR font has glyphs for "hyphen", "minus", and "endash", but nor for "hyphen-minus".

2. Unicode is not a superset of everything, in the following sense: if two glyphs represent the same Unicode character, that doesn't imply that they are the same glyph. So it may well make sense to have two input characters that map to the same Unicode character, but to different output glyphs. In particular, Doug McIlroy pointed out the following long-established definition:

input : Unicode : output

+ : U+002B : plus (normal font, e.g. for running text)
\(pl : U+002B : plus (special font, e.g. for mathematics)
\- : U+2212 : minus (normal font, e.g. for running text)
\(mi : U+2212 : minus (special font, e.g. for mathematics)

So redefining

\- : U+002D : hyphen-minus # NO!

is sadly not an option because it would break lots of existing non-manual-page documents.

So the problem cannot be solved, at least not without defining a completely new input character. But defining

\(hm : U+002D : hyphen-minus # NO!

would be so ugly that it couldn't reasonably be recommended for manual pages. So the problem has no complete solution, and the current workaround of using \- in manual pages and rendering it as U+002D for manual page UTF-8 output only already is the best possible compromise.

So please close this bug report as invalid.

Ingo Schwarze <schwarze>
Tue 02 May 2017 05:04:49 PM UTC, original submission:

The attached patch has the following parts:

  • src/libs/libgroff/glyphuni.cpp

This is the main mapping change.

  • src/libs/libgroff/uniglyph.cpp

The reverse direction for consistency.

  • tmac/an-old.tmac tmac/doc.tmac-u PROBLEMS

Remove redefinitions that are now obsolete
because they are now done for all macro sets.

  • man/groff_char.7.man font/devutf8/NOTES

Adjust documentation for \- and U+002D.

No changes are needed for devascii, devlatin1, devhtml.
As far as i understand, devps and devpdf are fine, too.
A brief look at some of the vendor-specific devices
gives me the impression that those probably don't need
changes, either. If somebody who is more experienced
with the ps, pdf, and vendor-specific drivers could
cross-check, that would be welcome. Otherwise, any
omissions in those other drivers can be fixed later
if and when any are found.

The motivation for this change is that right now, as observed by Ralph Corderoy, there is no way to request a U+002D HYPHEN-MINUS output glyph that works across all macro sets and devices, even though that is often needed when documentation programming language syntax or quoting code samples. For more details, see the ongoing dicussion on <groff@gnu.org>.

Ingo Schwarze <schwarze>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40562:  bs-minus.patch added by schwarze (4KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by carstenkunze (Updated the item)
  • -unavailable- added by schwarze (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 May 2017 10:12:27 PM UTCcarstenkunzeStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Tue 02 May 2017 05:04:49 PM UTCschwarzeAttached File-=>Added bs-minus.patch, #40562

    Back to the top


    Powered by Savane 3.1-cleanup1