Card suite Unicode characters are the wrong width #8046

Closed
opened 2026-01-31 01:19:24 +00:00 by claunia · 8 comments
Owner

Originally created by @j4james on GitHub (May 9, 2020).

Originally assigned to: @leonMSFT on GitHub.

Environment

Windows build number: Version 10.0.18362.657
Windows Terminal version (if applicable): Commit 7ae34336da

Steps to reproduce

  1. Build commit 7ae34336da
  2. Open a bash shell
  3. Execute printf "\u2660\u2663\u2665\u2666\n"

Expected behavior

This should print our the four card suite Unicode characters, each being one cell wide. Here's what it used to look like in conhost:

image

Actual behavior

Each characters occupies two cells now.

image

I wouldn't be too concerned if these were some recently invented emoji like crying kitten, or dancing monkey with umbrella. But these characters are from the default cmd shell code page (CP437), and they've been narrow characters for going on 40 years now. They're even included in the WGL4 character repertoire. Changing their width is almost guaranteed to break things.

I'm sorry I didn't bring this up before PR #5795 was merged, but I wasn't paying attention to the actual characters that were being changed. I only noticed now when I was testing some of my own code and found that this broke Vttest (it uses the diamond character in a couple of the tests).

Originally created by @j4james on GitHub (May 9, 2020). Originally assigned to: @leonMSFT on GitHub. # Environment Windows build number: Version 10.0.18362.657 Windows Terminal version (if applicable): Commit 7ae34336da0be8428738df5e13dfc4c5f1df6f75 # Steps to reproduce 1. Build commit 7ae34336da0be8428738df5e13dfc4c5f1df6f75 2. Open a bash shell 3. Execute `printf "\u2660\u2663\u2665\u2666\n"` # Expected behavior This should print our the four card suite Unicode characters, each being one cell wide. Here's what it used to look like in conhost: ![image](https://user-images.githubusercontent.com/4181424/81461502-39e20800-91a4-11ea-8944-c878ad4c8499.png) # Actual behavior Each characters occupies two cells now. ![image](https://user-images.githubusercontent.com/4181424/81461517-45cdca00-91a4-11ea-8b37-5da63e426a9e.png) I wouldn't be too concerned if these were some recently invented emoji like crying kitten, or dancing monkey with umbrella. But these characters are from the default cmd shell code page ([CP437](https://en.wikipedia.org/wiki/Code_page_437)), and they've been narrow characters for going on 40 years now. They're even included in the [WGL4](https://en.wikipedia.org/wiki/Windows_Glyph_List_4) character repertoire. Changing their width is almost guaranteed to break things. I'm sorry I didn't bring this up before PR #5795 was merged, but I wasn't paying attention to the actual characters that were being changed. I only noticed now when I was testing some of my own code and found that this broke _Vttest_ (it uses the diamond character in a couple of the tests).
Author
Owner

@j4james commented on GitHub (May 9, 2020):

I've just been checking the rest of the CP437 characters, and there are few more that I think shouldn't be wide:

  • U+263A white smiling face
  • U+2640 female sign
  • U+2642 male sign
@j4james commented on GitHub (May 9, 2020): I've just been checking the rest of the CP437 characters, and there are few more that I think shouldn't be wide: * U+263A white smiling face * U+2640 female sign * U+2642 male sign
Author
Owner

@DHowett-MSFT commented on GitHub (May 9, 2020):

Augh, we deserve this for our hubris. Thank you. 😁

@DHowett-MSFT commented on GitHub (May 9, 2020): Augh, we deserve this for our hubris. Thank you. 😁
Author
Owner

@DHowett-MSFT commented on GitHub (May 9, 2020):

crying kitten, or dancing monkey with umbrella

(I'll have you know that I am still laughing at this.)

@DHowett-MSFT commented on GitHub (May 9, 2020): > crying kitten, or dancing monkey with umbrella (I'll have you know that I am still laughing at this.)
Author
Owner

@DHowett-MSFT commented on GitHub (May 11, 2020):

I'm actually yanking this into the v1 milestone -- we broke it in the run-up to v1, we should darned well fix it for v1.

@DHowett-MSFT commented on GitHub (May 11, 2020): I'm actually yanking this into the v1 milestone -- we broke it in the run-up to v1, we should darned well fix it for v1.
Author
Owner

@leonMSFT commented on GitHub (May 11, 2020):

grr now I'm wondering what other glyphs have incorrect widths... like when printed inside of terminal, I'm getting the emoji presentation like so:
image

@leonMSFT commented on GitHub (May 11, 2020): grr now I'm wondering what other glyphs have incorrect widths... like when printed inside of terminal, I'm getting the emoji presentation like so: ![image](https://user-images.githubusercontent.com/57155886/81589114-06eb7000-936e-11ea-8d0b-1e9cf0db9ae8.png)
Author
Owner

@DHowett-MSFT commented on GitHub (May 11, 2020):

This one looks like it's font-specific. Because Cascadia Code has those glyphs, I get:

image

@DHowett-MSFT commented on GitHub (May 11, 2020): This one looks like it's font-specific. Because Cascadia Code has those glyphs, I get: ![image](https://user-images.githubusercontent.com/14316954/81589725-85e0a880-936e-11ea-9cb3-20899529659e.png)
Author
Owner

@j4james commented on GitHub (May 12, 2020):

Note that the white smiling face was supposedly added to Cascadia Code in PR 213 (https://github.com/microsoft/cascadia-code/pull/213) so I'm assuming that should be rendered correctly whenever the font is next released.

However, I'm curious what fallback font is producing the color versions of all of these characters. Every fixed space font I've tried seems to have them as monochrome. It's only when the glyphs aren't included that I'm getting a fallback that's in color. Where is that coming from?

@j4james commented on GitHub (May 12, 2020): Note that the white smiling face was supposedly added to Cascadia Code in PR 213 (https://github.com/microsoft/cascadia-code/pull/213) so I'm assuming that should be rendered correctly whenever the font is next released. However, I'm curious what fallback font is producing the color versions of all of these characters. Every fixed space font I've tried seems to have them as monochrome. It's only when the glyphs aren't included that I'm getting a fallback that's in color. Where is that coming from?
Author
Owner

@DHowett-MSFT commented on GitHub (May 12, 2020):

So, it looks like there's an automatic fallback (in DirectWrite) to "Segoe UI Emoji" for this codepoint range.

@DHowett-MSFT commented on GitHub (May 12, 2020): So, it looks like there's an automatic fallback (in DirectWrite) to "Segoe UI Emoji" for this codepoint range.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8046