Re: [PATCH 1/2] As some CJK fonts are dual-width, use the average width of ASCII glyphs instead of the max_x_advance of the font, just like the vte project.

2013-07-09 Thread Bill Spitzak
Having done this before (but about 18 years ago) I *REALLY* doubt this solution is better. However it is possible that font design has changed a good deal since then? Using the width of a '2' made attempts by software to print columns look *vastly* better. It was unreadable before this because

Re: [PATCH 1/2] As some CJK fonts are dual-width, use the average width of ASCII glyphs instead of the max_x_advance of the font, just like the vte project.

2013-07-09 Thread Peng Wu
Actually I used the technique from vte terminal widget. See: https://git.gnome.org/browse/vte/tree/src/vtedraw.h#n34 The average width is used for the ascii glyphs. Use "2" or "n" glyph is good for some font, but maybe not for the other fonts. Use the average width is good for most fonts, includi

Re: [PATCH 1/2] As some CJK fonts are dual-width, use the average width of ASCII glyphs instead of the max_x_advance of the font, just like the vte project.

2013-07-08 Thread Bill Spitzak
This average will result in a value that does not match any of the characters. Using the width of '2' probably works better. This means that at least digits will line up (it is very common for all digits except perhaps '1' to have the same width). In theory you can use 'n' but I have gotten bet

Re: [PATCH 1/2] As some CJK fonts are dual-width, use the average width of ASCII glyphs instead of the max_x_advance of the font, just like the vte project.

2013-07-08 Thread Kristian Høgsberg
On Thu, Jun 06, 2013 at 03:32:41PM +0800, Peng Wu wrote: > --- > clients/terminal.c | 55 > -- > 1 file changed, 41 insertions(+), 14 deletions(-) Thanks, that makes sense, committed. Sorry for the delay. Kristian > diff --git a/clients/term

[PATCH 1/2] As some CJK fonts are dual-width, use the average width of ASCII glyphs instead of the max_x_advance of the font, just like the vte project.

2013-06-06 Thread Peng Wu
--- clients/terminal.c | 55 -- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/clients/terminal.c b/clients/terminal.c index 2985726..0d4f726 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -54,6 +54,16 @@ terminal_de