bug-groff
[Top][All Lists]
Advanced

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

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


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

Hi,

With groff 1.21 and GROFF_NO_SGR=1, 'man man' in the ja_JP.UTF-8 locale
starts off looking like this in less:

MAN(1)                        Manual pager utils                        MAN(1)

^H前
       man - オンラインリファレンスマニュアルのインターフェース

Note the ^H.  Contrast this with the output in SGR mode:

MAN(1)                        Manual pager utils                        MAN(1)

名前
       man - オンラインリファレンスマニュアルのインターフェース

Looking at the text passed to less, it looks like this:

  名^H^H名前^H^H前

UTF-8 locales without double-width characters (I tested Russian) don't
have this problem.  I think what's happening is that the number of
backspaces to print is computed in tty_printer::make_underline and
tty_printer::make_bold as 'w / font::hor', and this equates to the width
of the string rather than the number of characters it contains.  Using
one backspace rather than two makes it look right in less.

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?

Thanks,

-- 
Colin Watson                                       address@hidden



reply via email to

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