-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Some emojis not displaying correctly in VSCode macOS #118905
Comments
Wow. Masterclass in how to file an issue. 💯
|
All of the emojis that work can be represented by a single 5 character long Unicode value. For example, in JavaScript, the books emoji would be All of the emojis that don’t work are represented by two 4 character long Unicode values. For example, the gear emoji is Vscode is treating emojis with two Unicode values as two separate characters. I haven’t looked at the code, but I would guess vscode has HTML tags around each Unicode value or something like that so that they are treated as separate values. |
Thanks for the explanation @thebinarysearchtree! I assumed the issue was related to how the unicode was being interpreted by VSCode. Do you know how to resolve the issue? I'm also curious if the unicode variations are to blame for the spacing issue. |
Yeah. There is a workaround, but it depends if that workaround is a good idea or not. The case to be made is that users expect the new Emoji style symbols because that is what GitHub and so on use, but the fonts used for programming, at least on MacOS, have the old style of symbols. Maybe the web browsers should fall back through the fonts in this situation, but they obviously don't. I don't know if that is a bug or a spec issue or whatever else. The only way to fix it in VSCode while still using the same fonts is to add this to the css:
and then somehow ask or require or something to put Emoji as the first font in the font-family above Menlo. |
All the text rendering in the editor is delegated to Chromium. I think it would be best if you would please open an issue directly against Chromium at https://bugs.chromium.org/p/chromium/issues/list and then please link to it here. I have created a simple test page at https://jsfiddle.net/zvqpghod/ which can be used as a repro when creating the issue. <div style="font-family:Menlo">
⚙️ :gear:
⚡️ :zap:
♻️ :recycle:
✔️ :heavy_check_mark:
✏️ :pencil2:
♿️ :wheelchair:
</div>
<div style="font-family:Monaco">
⚙️ :gear:
⚡️ :zap:
♻️ :recycle:
✔️ :heavy_check_mark:
✏️ :pencil2:
♿️ :wheelchair:
</div> Chrome:Safari: |
@alexdima this is what I am suggesting as a workaround for the font issue: https://jsfiddle.net/c0nj79ek/ |
Thanks for the workaround idea, in the meantime I have created https://bugs.chromium.org/p/chromium/issues/detail?id=1190093 |
@alexdima Thanks for the suggested workaround. I updated this line in my settings.json so that I no longer include Menlo and instead I have Monaco as the first font listed:
My VS Code files now show the Emojis fine. However, I'm still experiencing Problem 2 (inconsistent spacing in my termina)l: I'm assuming that this is an issue specific to Additionally, I do agree with @thebinarysearchtree that users expect Emojis to work in VS Code, regardless of the font-family selected (within reason). Users especially expect the default font to display Emojis correctly. |
cc @Tyriar @meganrogge for the terminal . The terminal rendering might be a different issue than the editor rendering. |
The size of the characters in the terminal is determined by the unicode version used ( Here's the issue that tracked supporting the setting of a unicode version in xterm.js xtermjs/xterm.js#1709 |
I used this on Arch Linux to solve the Issue. On Mac OS Use Apple Color Emoji instead of Noto color emoji. It should Fix the problem. "editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback', 'Noto Color Emoji'", |
I'm on Arch Linux and tried the fix suggested by @yorks-dev , sadly it did not work. I did try setting Noto Color Emoji as the first font, and it did work to show the missing emojis, but messed up every other non-emoji character. |
Yeah on mac it is a problem with the fonts not falling through to the end so it doesn't work. I spent a few hours creating a new setting called "Partial Fonts" that allows you to specify different fonts for specific ranges of characters as per the concept I mentioned earlier. It works well but I didn't really figure out where the most appropriate place would be to insert the css that is created from the user's settings. |
2022 thanks to @alexdima ! Now everything works like expected. 🙌 |
Same for me, I removed I've also added my favourite font for coding, Cascadia Code so the fonts I got are: Summarizing, just remove the font causing the issue: |
On macOS, some emojis will not resolve by adding Is anyone else having the same problem? |
@meredithmurfin U+FE0F is "Variation Selector-16", for some emojis from the earliest Emoji Unicode release are displayed as narrow (1 cell), and are partially occluded/blocked by any next character. This is probably an error by the Unicode standard, or perhaps some compatibility layer for the Japanese phone market, I can't be sure -- the purpose of U+FE0F is to be combined with these Emojis to make them become wide and occupy two cells. I have completed an automatic testing suite for VS-16, ZWJ, Wide, and Zero-width character support by unicode version, you can view the results of xterm.js (tested via visual studio code) here, https://ucs-detect.readthedocs.io/sw_results/VisualStudioCode.html#variation-selector-16-support and you can run the tests locally while developing by using ucs-detect The full list of Emoji characters that become wide when joined by VS-16 is here, https://unicode.org/Public/15.1.0/ucd/emoji/emoji-variation-sequences.txt Some additional documentation in the code generation function that parses this unicode data file, And the code tables generated by that code, I hope this is helpful, these results are preliminary and they may change in the coming weeks as I make minor changes, and I will also be publishing a detailed article. Best wishes! |
@nguyendviet Have you found the solution? Most emojis displayed correctly on my end, but the warning emoji. It is displayed as a symbol. |
@azzamsa No. I still have this issue. |
@jeanlescure |
I'm facing this issue on macOS. I'd like to use the warning emoji ( Here's my VS Code version information: Version: 1.87.0 (Universal) |
|
Steps to Reproduce:
Problem 1: Some emojis are displaying as small black and white images. I'm expecting them to paste normally (same size as other pasted emojis, with color).
:gear:
:zap:
:recycle:
:heavy_check_mark:
:pencil2:
:wheelchair:
Problem 2: The reason that I am adding these emojis to my project is to configure
git commit
prompts using commitizen, specifically with cz-customizable. When thegit commit
prompts are generated in my terminal, some emojis show inaccurate spacing. Additionally, all of the emojis that are displayed without color in VS Code files are being displayed in Terminal in the same way (no color, inconsistent sizing)My .cz-config.js file
Here are some of the spacing issues I see in my
git commit
prompts in VS Codenode
terminal::gear:
, ♻️:recycle:
, and ⚡️:zap:
emojis are not aligned with the text after all of the other emojis, even though there is only 1 space after each in my .cz-config.js file. The ⚡️ emoji strangely shows what looks to be more than a single space after it.:hammer_and_wrench:
and ⬇️:arrow_down:
emojis, although displaying correctly, do not show a space after.:arrow_up:
emoji should have a space after it:desktop_computer:
emoji should have a space after it:label:
emoji should have a space after itHere is the results when I attempt to use my new
git commit
prompts in a non-VS Code terminal (I am using my macOS terminal version 2.10)My project info:
My package.json
My VS Code settings.json
Similar Issues / Attempted Solutions:
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: