You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extended-width characters only display in a single column #615
paste '☆' into your mintty prompt. It will appear as only left half of the character. Some other full width characters render correctly, like 你好.
The star character displays a correct full width character when I am using urxvt on linux. This happens for a handful of other characters as well but I don't have a list of all of them off hand. tested with 2.5.0 from msys2 and 2.6.2
U+2606 WHITE STAR is a Unicode "ambiguous width" character. Displaying it wide is not correct but context-dependent. Ambiguous width characters are "normally" displayed narrow, i.e. using single-cell width. Only in East Asian display context their display is wide. For mintty, that would be activated by using an East Asian locale, e.g. LC_ALL=ja_JP.UTF-8 mintty.
The visual display, on the other hand, also depends on the font. For me, the narrow form looks good, while the wide form looks expanded. What are your settings (locale, font)? What's the locale setting when you see this character wide in urxvt?
My msys2 system only has LANG=en_US.UTF-8 set. LC_ALL is unset.
My urxvt system has LC_ALL is en_US.UTF-8 im not sure exactly what LANG is set to, I can get back to you with that in a couple hours.
In both systems I am using Envy Code R as the primary font. I'm fine with getting a proper single column rendering, but I just want it not to be this broken half character.
There is a variant Envy Code R for Powerline which has wide ambiguous characters, and maybe urxvt uses that as a criterion to switch to ambiguous wide display. That would explain the difference.
Can you try on Windows with "Envy Code R" (not "for Powerline")?
Installed are the normal face, italic, and bold. Without the registry hack for cmd prompt and without the visual studio font hacks. I've reinstalled it for the sake of testing and it still shows the same artifact. I use the font at 10pt.
Here is the terminal using 'Courier New' but effect shows up in all fonts I chose (lucidia console at 10p shows only the far right pixel being cut off, but it is cut off)
The character looks "normal" for example with DejaVu Sans Mono, Everson Mono Unicode, and FreeMono.
The reason could be (not yet verified by tracing) that the character is included in those fonts but not in the others, in which case Windows applies its font fallback mechanism, turning up with a character from some other font which does not always match in cell-width. This happens to a range of character that are not typically used in terminals, like encircled numbers, Thai script characters, and lots more.
Considering what could be done about this in theory, we are facing a trade-off. Currently, via employing Uniscribe (if you use that option), extended font fallback is being used to the benefit of users displaying certain scripts. This feature should not be affected. Testing character availabilty, on the other hand, does not seem to consider font fallback. If we could check which characters would be wider than expected, we could even squeeze the rendering but at a performance penalty, I suppose...
The best workaround is to select a font that supports the characters you are using.
Sorry if you misunderstood but I meant urxvt on linux whenever I mentioned it, I dont use any other terminal emulators on windows mintty has won me over :)
Actually got some time to spin up a vm, here is the same character rendered correctly (it looks like it is rendered as a single column character not a wide character). The font setting for Xresources used was URxvt.font: xft:Envy Code R:style=Regular:size=10
changed the title [-]Full width characters only display in a single column[/-][+]Extended-width characters only display in a single column[/+]on Mar 11, 2017
I plan to close this issue because font and width dependencies have been discussed and you can achieve the desired behaviour by starting mintty in ambiguous wide mode (corresponding to xterm -cjk_width), e.g.: LC_ALL=ja_JP.utf8 mintty -o Font=BatangChe
You could be asking for an easier option to trigger this mode, without having to adjust the locale;
that would be #88.
I'm not sure I understand the issue linked or its significance. That looked like a proposal for a -cjk_width flag that was eventually turned down and instead opting for setting ambiguous width via a test against the Greek letter alpha's width as reported by the current font? So changing my font to one that reports Greek letter alpha's as wide would cause mintty to render ambiguous characters as wide?
Using the font in your example and setting 'Locale' in mintty options(exporting LC_ALL is overridden somewhere on my setup i guess), I do indeed get this character rendering as full width.
However, I'm not sure I see how this works in correcting(maybe "forcing" is the right word) rendering of these characters in my current font as even setting locale to ja_JP does not change character width with my chosen font (still Envy Code R). Or is this supposed to mean the only way I can change the rendering is choosing an "appropriate" font as well as an "appropriate" CJK locale.
... That looked like a proposal for a -cjk_width flag that was eventually turned down and instead opting for setting ambiguous width via a test against the Greek letter alpha's width as reported by the current font? So changing my font to one that reports Greek letter alpha's as wide would cause mintty to render ambiguous characters as wide?
That was the solution at that time, yes. But it was later changed to be triggered by locale setting rather than font properties. The font checking code is still in but I have the impression it is not effective anymore.
Using the font in your example and setting 'Locale' in mintty options(exporting LC_ALL is overridden somewhere on my setup i guess), I do indeed get this character rendering as full width.
The advantage of using a CJK font is that the glyphs are more likely to match the expected rendering behaviour. It also works for example with DejaVu Sans Mono, but here the glyph looks more widened.
With Envy Code R actually, I cannot reproduce what you describe. There the glyph is already too wide in non-CJK locale mode, and would get widened extremely in CJK-locale-triggered ambiguous-wide mode, so that only half of the star is visible.
Long delay on my end, not sure if there were other tweaks but 2.7.9 looks like it also fixed some other rendering glitches i was having with these characters. Haven't noticed any regressions been on 2.7.9 for a few weeks now, Huge thanks!
Thanks for the feedback; actually there was a related change meanwhile after 2.7.9. I would appreciate if you can check the current repository version too.
So far I have only noticed one difference between 2.7.9 and the commit that I have been running 3cabecf which had do with the ∞ glyph.
2.7.9 rendered sentence: 3cabecf rendered sentence:
Sentence:
"I am erdos ∞"
interestingly if i scale up the font enough the infinity ends up being displayed properly at certain intervals. like so. But going to the next level higher breaks rendering again.
The scale-jumping is weird and I'll try if I can tweak that.
But the main purpose of the change was to avoid clipping in as many cases as possible, especially in "ambiguous wide" mode (which people seem to appreciate in support of "Powerline fonts").
Try the following test cases (added infinity), and also with LC_CTYPE=zh_CN.utf8 mintty:
Alright i found the issue (error?), I had previously in our escapades with LC_* types. If I have Locale set in my minttyrc then all LC_* types are overridden or just unset (so with Locale=en_US in my config any attempts at setting LC_CTYPE or LC_ALL did nothing).
Setting LC_CTYPE=zh_CN.utf8 the characters in your test cases are for the most part legible (without LC_CTYPE all but the 3rd test case are illegible). However a number of the characters in ※℃℉ÅⅠ∪∬∮⑴ⓠ⓾♬♭♯∞ are single width in my fonts while some are double width. The single width characters appear to be stretched and cut off most notably Å and now that I take a closer look perhaps infinity as well)
master en_us
master zh_ch
2.7.9 en_us
LC_CTYPE doesnt appear to function in 2.7.9.
First, LC_CTYPE would be overriden by LC_ALL; maybe that's why it doesn't work? Use LC_ALL=.. mintty then.
I'm dismayed by your Å, I don't see that here. What's your font?
That seems to be the only glitch in your screenshot (considering that characters like encircled 10 cannot really be squeezed into a single-width cell).
Still using the same Envy Code R linked earlier in this thread, on windows 7 with i believe no other fonts installed. Im not to sure how to figure out where that glyph is coming from but it looks like some how the glyph with the font is not being selected.
--- edit ---
It may be the font is too old and doesnt have proper unicode support for the unicode characters it maps. Im not very well informed on the intricacies of fonts.
--- edit 2 ---
Oh looks like the font maps 0x00C5 but your test case is 0x212B
I'm not sure how I can help you replicate the issue, I did notice that starting with LC_CTYPE=zh_CN.utf8 ./mintty.exe
print the test to the screen,
go to options and set locale to en_US
the text already printed will be modified to look like
Not sure if this is what your text looks like or if this is just some undefined behavior. but this does make the ringed A sit nicely in its double column (similar for ♯) and the symbol provided by the font is no longer stretched (∪) though ∞ which started this all does not change.
∞ is actually on the border of fitting into a single-width cell or not, so it might be assessed differently when scaling due to rounding. That would explain the width-jumping when zooming.
I could add a small tolerance (as I tried before) to catch that, but then other characters would be affected.
If you want to check out the algorithm for possible tweaking, it's in wininput.c: win_char_width.
Activity
mintty commentedon Dec 15, 2016
U+2606 WHITE STAR is a Unicode "ambiguous width" character. Displaying it wide is not correct but context-dependent. Ambiguous width characters are "normally" displayed narrow, i.e. using single-cell width. Only in East Asian display context their display is wide. For mintty, that would be activated by using an East Asian locale, e.g.


LC_ALL=ja_JP.UTF-8 mintty.The visual display, on the other hand, also depends on the font. For me, the narrow form looks good, while the wide form looks expanded. What are your settings (locale, font)? What's the locale setting when you see this character wide in urxvt?
kkartaltepe commentedon Dec 15, 2016
My msys2 system only has
LANG=en_US.UTF-8set. LC_ALL is unset.My urxvt system has LC_ALL is en_US.UTF-8 im not sure exactly what LANG is set to, I can get back to you with that in a couple hours.
In both systems I am using Envy Code R as the primary font. I'm fine with getting a proper single column rendering, but I just want it not to be this broken half character.
mintty commentedon Dec 16, 2016
There is a variant Envy Code R for Powerline which has wide ambiguous characters, and maybe urxvt uses that as a criterion to switch to ambiguous wide display. That would explain the difference.
Can you try on Windows with "Envy Code R" (not "for Powerline")?
kkartaltepe commentedon Dec 16, 2016
I am using the original official release of the font found at the creators blog
https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released
Installed are the normal face, italic, and bold. Without the registry hack for cmd prompt and without the visual studio font hacks. I've reinstalled it for the sake of testing and it still shows the same artifact. I use the font at 10pt.
Here is the terminal using 'Courier New' but effect shows up in all fonts I chose (lucidia console at 10p shows only the far right pixel being cut off, but it is cut off)

mintty commentedon Dec 16, 2016
The character looks "normal" for example with DejaVu Sans Mono, Everson Mono Unicode, and FreeMono.
The reason could be (not yet verified by tracing) that the character is included in those fonts but not in the others, in which case Windows applies its font fallback mechanism, turning up with a character from some other font which does not always match in cell-width. This happens to a range of character that are not typically used in terminals, like encircled numbers, Thai script characters, and lots more.
Considering what could be done about this in theory, we are facing a trade-off. Currently, via employing Uniscribe (if you use that option), extended font fallback is being used to the benefit of users displaying certain scripts. This feature should not be affected. Testing character availabilty, on the other hand, does not seem to consider font fallback. If we could check which characters would be wider than expected, we could even squeeze the rendering but at a performance penalty, I suppose...
The best workaround is to select a font that supports the characters you are using.
mintty commentedon Dec 16, 2016
By the way, in urxvt (on Windows), the character isn't displayed properly either. It's aligned right and clipped left.
kkartaltepe commentedon Dec 16, 2016
Sorry if you misunderstood but I meant urxvt on linux whenever I mentioned it, I dont use any other terminal emulators on windows mintty has won me over :)
mintty commentedon Dec 16, 2016
Yes, that's why I mentioned "on Windows" explicitly. Could you make a screenshot of urxvt on Linux?
kkartaltepe commentedon Dec 16, 2016
Actually got some time to spin up a vm, here is the same character rendered correctly (it looks like it is rendered as a single column character not a wide character). The font setting for Xresources used was
URxvt.font: xft:Envy Code R:style=Regular:size=10mintty commentedon Dec 16, 2016
But look at its left wing: it's a pixel shorter than the right wing, it's clipped there.
kkartaltepe commentedon Dec 16, 2016
Actually you are right the left side of the glyph is clipped. But its much closer

[-]Full width characters only display in a single column[/-][+]Extended-width characters only display in a single column[/+]mintty commentedon May 30, 2017
I plan to close this issue because font and width dependencies have been discussed and you can achieve the desired behaviour by starting mintty in ambiguous wide mode (corresponding to xterm -cjk_width), e.g.:
LC_ALL=ja_JP.utf8 mintty -o Font=BatangCheYou could be asking for an easier option to trigger this mode, without having to adjust the locale;
that would be #88.
kkartaltepe commentedon May 31, 2017
I'm not sure I understand the issue linked or its significance. That looked like a proposal for a -cjk_width flag that was eventually turned down and instead opting for setting ambiguous width via a test against the Greek letter alpha's width as reported by the current font? So changing my font to one that reports Greek letter alpha's as wide would cause mintty to render ambiguous characters as wide?
Using the font in your example and setting 'Locale' in mintty options(exporting LC_ALL is overridden somewhere on my setup i guess), I do indeed get this character rendering as full width.
However, I'm not sure I see how this works in correcting(maybe "forcing" is the right word) rendering of these characters in my current font as even setting locale to ja_JP does not change character width with my chosen font (still Envy Code R). Or is this supposed to mean the only way I can change the rendering is choosing an "appropriate" font as well as an "appropriate" CJK locale.
I am on 2.7.5 if that matters.
mintty commentedon May 31, 2017
That was the solution at that time, yes. But it was later changed to be triggered by locale setting rather than font properties. The font checking code is still in but I have the impression it is not effective anymore.
The advantage of using a CJK font is that the glyphs are more likely to match the expected rendering behaviour. It also works for example with DejaVu Sans Mono, but here the glyph looks more widened.

With Envy Code R actually, I cannot reproduce what you describe. There the glyph is already too wide in non-CJK locale mode, and would get widened extremely in CJK-locale-triggered ambiguous-wide mode, so that only half of the star is visible.
11 remaining items
kkartaltepe commentedon Sep 23, 2017
Long delay on my end, not sure if there were other tweaks but 2.7.9 looks like it also fixed some other rendering glitches i was having with these characters. Haven't noticed any regressions been on 2.7.9 for a few weeks now, Huge thanks!
mintty commentedon Sep 23, 2017
Thanks for the feedback; actually there was a related change meanwhile after 2.7.9. I would appreciate if you can check the current repository version too.
kkartaltepe commentedon Sep 24, 2017
kkartaltepe commentedon Oct 2, 2017
So far I have only noticed one difference between 2.7.9 and the commit that I have been running 3cabecf which had do with the ∞ glyph.


2.7.9 rendered sentence:
3cabecf rendered sentence:
Sentence:
"I am erdos ∞"
interestingly if i scale up the font enough the infinity ends up being displayed properly at certain intervals. like so. But going to the next level higher breaks rendering again.


--Edit--
Renders the same on current head 667f9b6
mintty commentedon Oct 2, 2017
The scale-jumping is weird and I'll try if I can tweak that.
But the main purpose of the change was to avoid clipping in as many cases as possible, especially in "ambiguous wide" mode (which people seem to appreciate in support of "Powerline fonts").
Try the following test cases (added infinity), and also with
LC_CTYPE=zh_CN.utf8 mintty:kkartaltepe commentedon Oct 2, 2017
Alright i found the issue (error?), I had previously in our escapades with
LC_*types. If I haveLocaleset in my minttyrc then all LC_* types are overridden or just unset (so withLocale=en_USin my config any attempts at settingLC_CTYPEorLC_ALLdid nothing).Setting
LC_CTYPE=zh_CN.utf8the characters in your test cases are for the most part legible (withoutLC_CTYPEall but the 3rd test case are illegible). However a number of the characters in※℃℉ÅⅠ∪∬∮⑴ⓠ⓾♬♭♯∞are single width in my fonts while some are double width. The single width characters appear to be stretched and cut off most notably Å and now that I take a closer look perhaps infinity as well)master en_us



master zh_ch
2.7.9 en_us
LC_CTYPE doesnt appear to function in 2.7.9.
kkartaltepe commentedon Oct 2, 2017
Also looks like issues with overlapping characters not re-rendering when being highlighted (from pre-2.7.9) was fixed which is nice :)
mintty commentedon Oct 2, 2017
First, LC_CTYPE would be overriden by LC_ALL; maybe that's why it doesn't work? Use LC_ALL=.. mintty then.
I'm dismayed by your Å, I don't see that here. What's your font?
That seems to be the only glitch in your screenshot (considering that characters like encircled 10 cannot really be squeezed into a single-width cell).
kkartaltepe commentedon Oct 2, 2017
Still using the same Envy Code R linked earlier in this thread, on windows 7 with i believe no other fonts installed. Im not to sure how to figure out where that glyph is coming from but it looks like some how the glyph with the font is not being selected.
--- edit ---
It may be the font is too old and doesnt have proper unicode support for the unicode characters it maps. Im not very well informed on the intricacies of fonts.
--- edit 2 ---
Oh looks like the font maps 0x00C5 but your test case is 0x212B
mintty commentedon Oct 2, 2017
I've just installed Envy Code R (both with and without "for Powerline") and I don't see that effect.
kkartaltepe commentedon Oct 3, 2017
I'm not sure how I can help you replicate the issue, I did notice that starting with

LC_CTYPE=zh_CN.utf8 ./mintty.exeprint the test to the screen,
go to options and set locale to
en_USthe text already printed will be modified to look like
Not sure if this is what your text looks like or if this is just some undefined behavior. but this does make the ringed A sit nicely in its double column (similar for
♯) and the symbol provided by the font is no longer stretched (∪) though∞which started this all does not change.mintty commentedon Oct 3, 2017
∞ is actually on the border of fitting into a single-width cell or not, so it might be assessed differently when scaling due to rounding. That would explain the width-jumping when zooming.
I could add a small tolerance (as I tried before) to catch that, but then other characters would be affected.
If you want to check out the algorithm for possible tweaking, it's in wininput.c: win_char_width.
mintty commentedon Oct 23, 2017
Released 2.8.0.
character attribute to enforce single/double width (#615, #979, #938, #…
mintty commentedon May 20, 2020
Released 3.1.5 with explicit character width attribute support.