suzdraws / mintty

Automatically exported from code.google.com/p/mintty
0 stars 0 forks source link

Consolas font renders UTF-8 chars as double-width #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set the font to Consolas
2. Run a command with UTF-8 output, like
   $ env LANG=en_US.UTF-8 pstree

What is the expected output? What do you see instead?
Expect a nice process tree with unicode line-drawing characters.  The
characters do show up, but all with a space after them, as if they were
double-width, and so the alignment is skewed.

What version of the product are you using? On what operating system?
MinTTY 0.3.9, and also svn-r240+
Windows 7 x64, build 7000

Please provide any additional information below.
You can also try editing UTF-8 characters, as in "pstree | vim -".  It
quickly becomes clear that vim is confused about what characters are where.

I have 5 fonts available to use in MinTTY -- Consolas and DejaVu Sans Mono
show this problem, while Bitstream Vera Sans Mono, Courier New, and Lucida
Console are fine.  (Bitstream actually shows block placeholders on the
UTF-8 characters, but at least they're single-width.)  It's also
interesting that changing the font doesn't seem to recalculate the widths
in the buffered output -- you have to run the command again with each font
to see if it made a difference.

I narrowed it down to r240 that caused the regression, as evidenced by the
attached screen snippets.

Original issue reported on code.google.com by cuviper on 27 Apr 2009 at 7:22

Attachments:

GoogleCodeExporter commented 9 years ago
Hmm, the CJK ambiguous width detection for issue 88 was too simplistic then.
Attempted fix in r268 on trunk: it now compares the width of Greek alpha and a
line-drawing character against Latin A to decide. Please give this a try.

Original comment by andy.koppe on 28 Apr 2009 at 6:09

GoogleCodeExporter commented 9 years ago
Btw, I had a quick look at why so few fonts show up under Win7: the Fonts 
control
panel now lets you hide or show fonts, and most are hidden by default. I think 
I like
the idea, although it does mean that the CJK fonts don't show up by default. 
But I
guess that'll be different in CJK locales. 

Original comment by andy.koppe on 28 Apr 2009 at 6:30

GoogleCodeExporter commented 9 years ago
Thanks for the quick fix -- r268 works for me.

Original comment by cuviper on 28 Apr 2009 at 4:06

GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 29 Apr 2009 at 8:43