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

Cannot display emoji βœ”οΈ, πŸ™‹β€β™‚οΈ #32840

Open
Tracked by #189320
yzhang-gh opened this issue Aug 20, 2017 · 52 comments
Open
Tracked by #189320

Cannot display emoji βœ”οΈ, πŸ™‹β€β™‚οΈ #32840

yzhang-gh opened this issue Aug 20, 2017 · 52 comments
Assignees
Labels
chromium Issues and items related to Chromium font-rendering Font rendering issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@yzhang-gh
Copy link
Contributor

yzhang-gh commented Aug 20, 2017

Steps to Reproduce:

  1. Open a new file
  2. Copy these two emoji βœ”οΈβŒ to it
  3. See this result

image

Expected image

on Windows 10


2022.12: Edited to add a workaround:

Workaround. Append a color emoji font to the editor font family e.g.:

  • Windows: Consolas, 'Courier New', monospace, 'Segoe UI Emoji'
  • MacOS: Menlo, Monaco, 'Courier New', monospace, 'Apple Color Emoji'
  • Linux: 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback', 'Noto Color Emoji'

e.g. on macOS

  • "editor.fontFamily": "Roboto Mono, 'Apple Color Emoji'",

or for a cross-platform solution:

  • "editor.fontFamily": "Consolas, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji'"
@vscodebot vscodebot bot added editor editor-find Editor find operations labels Aug 20, 2017
@alexdima alexdima self-assigned this Oct 26, 2017
@alexdima alexdima removed the editor-find Editor find operations label Oct 26, 2017
@rebornix rebornix added the under-discussion Issue is under discussion for relevance, priority, approach label Nov 20, 2017
@rebornix
Copy link
Member

The style is decided by the browser and since we are using Chromium under the hood, it's Google's Emoji.

@rianadon
Copy link
Contributor

This may not be how it really works, but from my understanding this is how Windows displays emoji as a fallback when no specific "emoji font" is used.

This can be fixed by adding 'Segoe UI Emoji' to the end of the editor.fontFamily setting so emojis fall back to the correct, colored font. Or you could use 'Segoe UI Symbol' instead to get monochrome emoji.

Thus, building off the default setting, Consolas, 'Courier New', monospace, 'Segoe UI Emoji' would give you colored emoji. This should really be the default. But for now you could change this yourself to make the emoji display correctly.

@yzhang-gh
Copy link
Contributor Author

@rianadon many thanks!

@alexdima alexdima added font-rendering Font rendering issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed under-discussion Issue is under discussion for relevance, priority, approach labels Nov 21, 2017
@rianadon
Copy link
Contributor

@alexandrudima I wouldn't call this an issue with something upstream since there is a solution to solve this in Electron/Chromium - add all the emoji fonts to the font stack. For example GitHub uses the emoji fonts for both macOS and Windows in their CSS (along with the native system fonts): -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol".

The fix to this would be to edit the default by appending Segoe UI Emoji and possibly the Apple emoji font too.

@alexdima alexdima added under-discussion Issue is under discussion for relevance, priority, approach and removed upstream Issue identified as 'upstream' component related (exists outside of VS Code) font-rendering Font rendering issues labels Nov 23, 2017
@rebornix rebornix removed their assignment Dec 1, 2017
@yzhang-gh
Copy link
Contributor Author

Another emoji:
πŸ™‹β€β™‚οΈ (man raising hand)
in vscode image
expected image (as shown on GitHub webpage)

with font settings Consolas, 'Microsoft Yahei', 'Segoe UI emoji', 'Segoe UI Symbol'
on Windows 10 Pro 1709

@yzhang-gh yzhang-gh changed the title Cannot display emoji βœ” Cannot display emoji βœ”, πŸ™‹β€β™‚οΈ Dec 26, 2017
@rianadon
Copy link
Contributor

I see this too. The issue goes away when I change the font to only 'Segoe UI Emoji', which likely handles the zero width joiner.

This probably isn't going to have an easy fix, as while putting the emoji font first fixes the problem, it doesn't allow for the customization of the text font (as the emoji font seems to have glyphs for text). One solution would be to do as GitHub does and enclose emoji inside a separate element with its own font-family, but doing so would require a change in Monaco's syntax highlighting.

@alexdima alexdima added the font-rendering Font rendering issues label Apr 18, 2018
@sylann
Copy link

sylann commented May 15, 2018

When I paste this emoji: πŸ‘ˆ, in any file in vscode (on ubuntu), I get this :
image
It's the same in the integrated terminal of vscode;

While it is properly displayed in my terminal (tilix).

@rianadon
Copy link
Contributor

@SylannBin good find! Would you happen to know what font tilix is using?

Also what happens if you add 'Noto Color Emoji' to the start or end of your editor.fontFamily setting (with the single quotes)? It seems like this is the emoji font Ubuntu uses but I'm not completely sure.

@sylann
Copy link

sylann commented May 16, 2018

@rianadon Adding the 'Noto Color Emoji' font family makes the above emoji properly displayed both in the editor and the integrated terminal.
But without surprise, it also affects all other characters.
For example, numbers and stars are showed in a peculiar white fashion:
image

However if I put the font at the end of the list, it works perfectly.

Apparently, the ability to print the emojis properly in tilix is not related to Tilix itlsef but to the version of GTK that is being used. Color emojis work in ubuntu 18.04 but not in 17.10, it appears it has been added with gtk 3.22. source I've searched a bit, in the gtk repo, it seems the feature was handled by cairo for several years already, and was fixed very recently in gtk, but this is quite obscure to me right now and I couldn't figure out which commits introduced the fix.

@rianadon
Copy link
Contributor

Great to hear it works if you put the font at the end!
I've never seen an emoji font handle stars and numbers specially before though.

Also, I'm probably going to submit a PR soon to change the default font-family to include emoji. For my later reference (and anyone looking to make emoji work on their system), these defaults would be:

  • Windows: Consolas, 'Courier New', monospace, 'Segoe UI Emoji'
  • MacOS: Menlo, Monaco, 'Courier New', monospace, 'Apple Color Emoji'
  • Linux: 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback', 'Noto Color Emoji'

@NatoBoram
Copy link

NatoBoram commented Sep 24, 2018

I confirm that this worked for me on Ubuntu.

"editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback', 'Noto Color Emoji'"

@matthijsgroen
Copy link

In my case, i type πŸŽ‰ :tada but display like image

that make me almost crazy!!! 😞

OS: MacOS

I have the same in windows...

@q1b
Copy link

q1b commented Dec 10, 2021

same here

@HaloWang
Copy link

Hi, guys. I think fontFamily need to be noticed:
Iosevka + Source Han Sans, monospace is broken by some emojis:
1
Some fallback:
2
Default:
3
Windows:
4

@j1mmie
Copy link

j1mmie commented Jan 10, 2022

On MacOs, "Menlo" is actually breaking some emojis for me. I've installed the free Robot font from Google:

https://fonts.google.com/specimen/Roboto+Mono

and changed my editor.fontFamily to:

"editor.fontFamily": "'Roboto Mono', 'Apple Color Emoji'"

And it's a pretty acceptable alternative.

@DYW972
Copy link

DYW972 commented Jan 21, 2022

2022 thanks to @alexdima !
I solved this issue on my macOS by removing Menlo in editor.fontFamily": "Monaco, 'Courier New', monospace",

Now everything works like expected.

πŸ™Œ

@DG9Jww
Copy link

DG9Jww commented Mar 27, 2022

In my case, i type πŸŽ‰ :tada but display like image

that make me almost crazy!!! 😞

OS: MacOS

same here in windowsπŸ˜–

@Jafetlch
Copy link

I have the same problem on Windows 10
image

@kartinul
Copy link

Same here
image

@pohy
Copy link

pohy commented Jun 28, 2022

I have the same issue on Windows 10 using the Windows Emoji keyboard.
But! The same emojis render correctly when inserted through the Emoji Snippets extension.
Code_2022-06-28_10-59-40

@kartinul
Copy link

kartinul commented Jul 5, 2022

For me this problem was related with the vim extension,

bug

@divyamrit
Copy link

Might you be right, I have my vim extension also enabled. Showing the same results never tried toggling it, let might this is an issue with the vim extension

@kartinul
Copy link

kartinul commented Jul 6, 2022

here is the issue that was opened in VsCodeVim/Vim github
VSCodeVim/Vim#7547

@odebroqueville
Copy link

I'm using VS Code Version: 1.70.0 (Universal)
Commit: da76f93
Date: 2022-08-04T04:38:55.829Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Darwin x64 21.6.0

I'm neither using the Menlo font family nor Vim and some emojis appear in b&w instead of colour such as :red_heart:

Running the following Python script:

import emoji
print(emoji.emojize('Python is :thumbs_up:'))
print(emoji.emojize("I :red_heart: Python", variant="emoji_type"))
print(emoji.emojize("Python is fun :softball:", variant="emoji_type"))

Renders:

Screenshot 2022-08-05 at 18 59 42

VS Code font family settings:

{
  "editor.fontLigatures": "'calt', 'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'",
  "workbench.iconTheme": "material-icon-theme",
  "editor.fontFamily": "'Source Code Pro', 'Fira Code', 'Cascadia Code', 'Courier New', monospace",
  "editor.formatOnSave": true,
  "editor.wordWrap": "on",
  "editor.accessibilitySupport": "off",
  "editor.fontSize": 15,
  "terminal.integrated.env.osx": {
    "FIG_NEW_SESSION": "1"
  },
  "security.workspace.trust.untrustedFiles": "open",
  "terminal.integrated.inheritEnv": false,
  "editor.guides.bracketPairs": true,
  "editor.guides.bracketPairsHorizontal": true,
  "workbench.editor.enablePreview": false,
  "terminal.integrated.localEchoStyle": "dim",
  "terminal.integrated.fontFamily": "MesloLGS NF",
  "terminal.integrated.fontWeight": "normal"
}

@11xxx22
Copy link

11xxx22 commented Aug 25, 2022

@alexdima Ρ‚Π΅ΠΏΠ΅Ρ€ΡŒ это Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ ΠΈ Π² intellisense?

βœ…

@amir-khoshbakht
Copy link

It is easy to understand what emojis vsCode can show:
emoji list website
Capture

All the emojis that are shown in color on this page are also shown in color in vsCode

example of uncolored emoji:
Capture2
and the same exact emoji in my vsCode:
Capture3

@Ali-Jahankah
Copy link

I'm using emojis in my vs code integrated terminal and you can add these settings to your settings.json file to see the emojis

"terminal.integrated.cursorStyle": "line",
"terminal.integrated.cursorWidth": 4,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.fontSize": 12,
"terminal.integrated.fontFamily": "monospace",
"terminal.integrated.letterSpacing": 1,
"terminal.integrated.lineHeight": 1,

@mpacary
Copy link

mpacary commented Mar 27, 2023

Ubuntu 22.04 / Gnome here ; recommended option 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback', 'Noto Color Emoji' did not work (e.g. "⚠️" was displayed b&w), as well as the cross platform one.

After trying various combinations, this one worked:

'Courier New', 'Noto Color Emoji'

Poke @yzhang-gh if you wish to update the top message πŸ˜‰

@redactedscribe
Copy link

The information emoji (ℹ️) also doesn't display as expected (i.e. coloured): brave_2023-04-27_17-33-46

@felixhaeberle
Copy link

β„Ή βœ… Using inlang config file at /Users/felixhaberle/Desktop/git/inlang/source-code/sdk-js/src/adapter-sveltekit/examples/test-app/inlang.config.js
β„Ή 🌏 Found 3 languages with a total of 6 messages.                                                                                        
β„Ή πŸ“ Translating to 2 languages. [de, es]                                                                                               
β„Ή πŸ‡ͺπŸ‡Έ Translated message welcome to Bienvenido a inlang                                                                                    
β„Ή πŸ‡ͺπŸ‡Έ Translated message machine-test to Esta es una prueba de mΓ‘quina.                                                                     
β„Ή πŸ‡ͺπŸ‡Έ Translated message already-existing to Esta clave existe y es una prueba.       

Just to let you know: The flags doesn't display correctly with the default settings.
They getting displayed like [E][S] for Spain -> πŸ‡ͺπŸ‡Έ.

@tanpengsccd
Copy link

On MacOs, "Menlo" is actually breaking some emojis for me. I've installed the free Robot font from Google:

https://fonts.google.com/specimen/Roboto+Mono

and changed my editor.fontFamily to:

"editor.fontFamily": "'Roboto Mono', 'Apple Color Emoji'"

And it's a pretty acceptable alternative.

It is perfect for mac user, like ♻️ can't display the color.

@adrena11n
Copy link

덕뢄에 2022@alexdima! λ‹€μŒμ„ μ œκ±°ν•˜μ—¬ macOSμ—μ„œ 이 문제λ₯Ό ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€.Menlo``editor.fontFamily": "Monaco, 'Courier New', monospace",

이제 λͺ¨λ“  것이 μ˜ˆμƒλŒ€λ‘œ μž‘λ™ν•©λ‹ˆλ‹€.

πŸ™Œ

Thank you, you are save my life!

@p-i-
Copy link

p-i- commented Jul 24, 2024

Monaco, 'Apple Color Emoji' works on my mac.
✏️ ⚠️ ☣️ ♻️ ☎️ ‼️ ⁉️ all render, although the last 2 come out white (not red).
ref #223483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromium Issues and items related to Chromium font-rendering Font rendering issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests