bug-groff
[Top][All Lists]
Advanced

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

Re: doubled backspaces for bold/underline with CJK in no-SGR mode


From: Colin Watson
Subject: Re: doubled backspaces for bold/underline with CJK in no-SGR mode
Date: Sun, 9 Jan 2011 15:22:44 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jan 09, 2011 at 03:34:02PM +0100, Werner LEMBERG wrote:
> Colin Watson wrote:
> > Given that backspacing over half a character is never a particularly
> > sensible thing for a pager to do, I would suggest that we should
> > assume that pagers will backspace over a character at a time, as
> > less seems to do, and emit a number of backspaces corresponding to
> > the number of characters.  Does this make sense, or am I missing
> > something?
> 
> I second your analysis.  Can you provide a patch?

How about the following?

2011-01-09  Colin Watson  <address@hidden>

        * src/devices/grotty/tty.cpp (tty_printer::make_underline): Only
        emit a single backspace in no-SGR mode.  less (at least) backspaces
        over a character at a time.
        (tty_printer::make_bold): Likewise.

=== modified file 'src/devices/grotty/tty.cpp'
--- src/devices/grotty/tty.cpp  2010-12-13 17:42:28 +0000
+++ src/devices/grotty/tty.cpp  2011-01-09 15:17:24 +0000
@@ -311,11 +311,8 @@ void tty_printer::make_underline(int w)
     if (!w)
       warning("can't underline zero-width character");
     else {
-      int n = w / font::hor;
-      for (int i = 0; i < n; i++)
-       putchar('_');
-      for (int j = 0; j < n; j++)
-       putchar('\b');
+      putchar('_');
+      putchar('\b');
     }
   }
   else {
@@ -337,10 +334,8 @@ void tty_printer::make_bold(output_chara
     if (!w)
       warning("can't print zero-width character in bold");
     else {
-      int n = w / font::hor;
       put_char(c);
-      for (int i = 0; i < n; i++)
-       putchar('\b');
+      putchar('\b');
     }
   }
   else {

Thanks,

-- 
Colin Watson                                       address@hidden



reply via email to

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