groff
[Top][All Lists]
Advanced

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

[Groff] unicode support, part 13: \-


From: Bruno Haible
Subject: [Groff] unicode support, part 13: \-
Date: Tue, 21 Feb 2006 18:54:10 +0100
User-agent: KMail/1.5

Werner Lemberg wrote:

> > - devhtml maps "hy" and "-" to U+002D.
> >   devutf8 and glyphuni.cpp map "hy" and "-" to U+2010.
> >
> > - devhtml and devutf8 map "\-" to U+2212.
> >   glyphuni.cpp doesn't.
> 
> `U+2010' is the right one but problematic since many editors are not
> capable to search for it in a user-friendly way.  Maybe we should
> apply the same solution as is done with the devutf8 backend: Use
> U+2010 and let distributions overwrite it with the .char request (see
> the PROBLEMS file).

I think the issues are slightly different for the two cases. For "hy" and
"-" the problem is primarily that some man page authors are using "-" where
they mean to produce a minus sign. We are telling people that "\-" is the
right way to display an option's first character in a manual page. The
problem with "\-" is then that in a tty or HTML browser it gets displayed
as U+2212 where people expect U+002D. Regarding the glyphs, it makes no
doesn't work.

For immediate action, I propose to
  - add comments for the first case,
  - make glyphuni.cpp consistent with devhtml and devutf8. groff currently
    already converts "\-" to U+2212 in the output; this change to glyphuni.cpp
    doesn't change the behaviour, unless composed characters will be used.


2006-02-19  Bruno Haible  <address@hidden>

        * src/libs/libgroff/glyphuni.cpp (glyph_to_unicode_list): Map \- to
        U+2212.

diff -r -c3 groff-20060217.orig/src/libs/libgroff/glyphuni.cpp 
groff-20060217/src/libs/libgroff/glyphuni.cpp
--- groff-20060217.orig/src/libs/libgroff/glyphuni.cpp  2006-02-20 
00:32:51.000000000 +0100
+++ groff-20060217/src/libs/libgroff/glyphuni.cpp       2006-02-20 
01:03:51.000000000 +0100
@@ -335,6 +335,10 @@
   { "*f", "03D5" },
   { "+p", "03D6" },
   { "+e", "03F5" },
+  // "-" and "hy" denote a HYPHEN, usually a glyph with a smaller width
+  // than the MINUS sign. Users who are viewing broken man pages that
+  // assume that "-" denotes a U+002D character can either fix the broken
+  // man pages or apply the workaround described in the PROBLEMS file.
   { "-", "2010" },
   { "hy", "2010" },
   { "en", "2013" },
@@ -394,7 +398,11 @@
   { "product", "220F" },
   { "coproduct", "2210" },
   { "sum", "2211" },
-//{ "\\-", "2212" },
+  // \- denotes a MINUS sign. But it is used in many man pages to denote
+  // the U+002D character that introduces a command-line option. For devices
+  // that support copy&paste, such as devhtml and devutf8, the user can
+  // apply the workaround described in the PROBLEMS file.
+  { "\\-", "2212" },
   { "mi", "2212" },
   { "-+", "2213" },
   { "**", "2217" },





reply via email to

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