Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode Pawn does not display like other Unicode chess symbols #13110

Open
paul-hansen opened this issue May 16, 2022 · 8 comments
Open

Unicode Pawn does not display like other Unicode chess symbols #13110

paul-hansen opened this issue May 16, 2022 · 8 comments
Assignees
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@paul-hansen
Copy link

paul-hansen commented May 16, 2022

Windows Terminal version

1.13.10984.0

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

Paste this Unicode character into your terminal ♟(U+265F)
Source: https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode

Expected Behavior

I expected it to match the current foreground color of the terminal similar to the other chess related Unicode symbols.

Actual Behavior

The pawn is always purple. Here's a screenshot of my chess game output in the windows terminal:
image
I can change the foreground color for all the other pieces using ANSI color codes but the pawn is always purple.

@paul-hansen paul-hansen added the Issue-Bug It either shouldn't be doing this or needs an investigation. label May 16, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 16, 2022
@zadjii-msft
Copy link
Member

zadjii-msft commented May 16, 2022

a minimal repro

printf "White: \u2654 \u2655 \u2656 \u2657 \u2658 \u2659\nBlack: \u265a \u265b \u265c \u265d \u265e \u265f \n"

Looks like the black pawn is an emoji, when the others aren't.

I suspect this is because the chess characters aren't in Cascadia Code (or most fonts), dwrite looks up the glyph in some other font that does have it, and the emoji font shows up higher in the search list than wherever the other pieces are coming from. Hmm.

Might not be anything we can do here besides changing the font fallback order for glyphs (#2664)

@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Fonts Related to the font Product-Terminal The new Windows Terminal. Priority-3 A description (P3) labels May 16, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 16, 2022
@zadjii-msft zadjii-msft added the Needs-Discussion Something that requires a team discussion before we can proceed label May 16, 2022
@zadjii-msft
Copy link
Member

See also #6864, but like the opposite. The black bawn is "emoji yes, emoji-presentation no", so it shouldn't be rendered by dwrite as an emoji, but it is. Hmm.

@j4james
Copy link
Collaborator

j4james commented May 16, 2022

My understanding is that there are a number of glyphs that have both a text presentation and an emoji presentation, and you can use a variant selector to choose which style you want. They each have a default style though (when no variant selector is used), and in the case of the black pawn, the default style is meant to be text.

I'm sure I've seen a document somewhere that list all the default styles in a simple table, but the best I can find at the moment is this: https://www.unicode.org/emoji/charts/text-style.html

@paul-hansen
Copy link
Author

I suspect this is because the chess characters aren't in Cascadia Code (or most fonts), dwrite looks up the glyph in some other font that does have it, and the emoji font shows up higher in the search list than wherever the other pieces are coming from.

That seems accurate, I confirmed it does use the font's symbol if you use a font that has the symbols. I found a font that has chess symbols using this page https://www.fontspace.com/unicode/char/265C-black-chess-rook
image

The issue you linked would help a lot, enabling us to set it up the way we want on our own PCs. However it's not a great solution for if I wanted to distribute software that uses those symbols though. I would have to instruct all users on how to install a special font correctly if they are using Windows Terminal. Any ideas on how to address where the default is coming from?

If it was consistent and all the Unicode chess pieces were rendered as emoji, that would okay too. At least they would be usable together.

Seems like this isn't limited to Windows Terminal:
Discord has a similar issue:
image
And in Chrome:
image

I'm not sure if that means it's a Windows OS problem, or the best way to report that if it is. Maybe I should report it in the WinUI repo? https://github.com/microsoft/microsoft-ui-xaml Seems like they would probably just have to escalate it to whoever works on DirectWrite or something too though.

@paul-hansen
Copy link
Author

paul-hansen commented May 16, 2022

My understanding is that there are a number of glyphs that have both a text presentation and an emoji presentation, and you can use a variant selector to choose which style you want. They each have a default style though (when no variant selector is used), and in the case of the black pawn, the default style is meant to be text.

I'm sure I've seen a document somewhere that list all the default styles in a simple table, but the best I can find at the moment is this: https://www.unicode.org/emoji/charts/text-style.html

Apparently U+FE00 - U+FE0F are supposed to be variant selectors which you put after the Unicode character you want to modify. I'm having a hard time finding documentation on which ones do what though. In my testing in WT, all of them just make the character double wide (which is how my chess board looks so square in the first screenshot)

According to https://stackoverflow.com/a/38452396/5399098 U-FE0E is supposed to force the text version.
Black Pawn:♟️
Black Pawn with ︎:♟
White Pawn: ♙️
Doesn't seem to work on Github for me but you can copy it into the textbox on https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_textarea and it works there for me.
image

@DHowett
Copy link
Member

DHowett commented May 17, 2022

Just driving by to say: this touches on #1472 and friends (#8000)!

@lhecker
Copy link
Member

lhecker commented May 16, 2024

It seems we forgot to mention here that the latest Windows Terminal version now has a setting to disable colored Emojis:
image

However, we still need to add support for handling VS-15 and VS-16 so that colored and uncolored Emojis can be mixed. That's a little bit more difficult unfortunately and currently not that high of a priority.

@Ashutosh-Chikhaliya

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

6 participants