Skip to content

Some Unicode characters (emojis) are b/w and others are colored #91357

Closed

Description

Testing: #91303 on Ubuntu 19.10 (running in Parallels)

  • open VI in VS Code integrated terminal
  • enter some emojis (e.g. 🥕carot U+1F955, 🍔hamburger U+1F354, 🥎softball: U+1F94E)

Observe:
in VS Code carot and hamburger are rendered in b/w whereas the softball is rendered in color.

If I enter the same characters in VI running in the terminal app all three emojis are rendered in color:

2020-02-25_11-43-19

(left is VS Code, right is terminal app).

Activity

  1. stevencl commented on Feb 25, 2020

    @stevencl
    Member

    Here's another one that shows up black and white 🗣 (U+1F5E3)

  2. added
    bug
    terminal
    on Apr 6, 2020
  3. Tyriar commented on Apr 6, 2020

    @Tyriar
    Contributor

    I always thought this was related to fonts, not sure we will be able to fix as I tell the canvas to draw the text and sometimes they get drawn as lofi.

  4. added this to the Backlog milestone on Apr 6, 2020
  5. fmeyertoens commented on Apr 9, 2020

    @fmeyertoens

    The reason might be that some emojis are displayed in text style by default instead of emoji-style. The variation selector Unicode block (U+FE0F) can be added to those emojis to indicate that it should be displayed in emoji-style.
    The gear emoji for instance should be inserted as U+2699, U+FE0F.
    https://emojipedia.org/variation-selector-16/
    https://en.wikipedia.org/wiki/Variation_Selectors_%28Unicode_block%29
    (I somehow can't connect to unicode.org to find the definitive source)

  6. added
    upstream
    upstream-issue-linked
    on Apr 9, 2020
  7. Tyriar commented on Apr 9, 2020

    @Tyriar
    Contributor

    Fabian Meyertöns (@fmeyertoens) sounds promising, created upstream issue xtermjs/xterm.js#2823

  8. fmeyertoens commented on Apr 10, 2020

    @fmeyertoens

    Might be related to #32840. It is originally about the editor but seems to be the same problem and people are also discussing the terminal behavior there.

  9. fmeyertoens commented on Apr 14, 2020

    @fmeyertoens

    After some research I am quite sure now that the variation selector is not the issue here because the emojis mentioned in the beginning

    (🥕carot U+1F955, 🍔hamburger U+1F354, 🥎softball: U+1F94E)

    shouldn't even have a text presentation and should be presented as emoji by default. So the emoji presentation selector (U+FE0F) has no effect on them. (See https://www.unicode.org/Public/13.0.0/ucd/emoji/emoji-data.txt and https://unicode.org/emoji/charts/emoji-style.html)
    This does seem to be a font (fallback) issue. The default terminal font has the emoji characters (although in black&white) and so it doesn't fall back to the colored emoji font.
    If VS Code and the terminal app use the same fonts then it could be that the terminal app prioritizes the emoji font for emoji characters.

    Here's another one that shows up black and white 🗣 (U+1F5E3)

    If the speaking head appears as on github (black&gray) then it is already the correct 'colored' emoji version of it.

  10. Tyriar commented on Apr 14, 2020

    @Tyriar
    Contributor

    For rendererType = canvas (the default) this is the font that's given to the canvas context to draw:

    https://github.com/xtermjs/xterm.js/blob/f0c518a13471bbc4890905a076b292d2d0a9f63c/src/browser/renderer/BaseRenderLayer.ts#L390

    Where this._optionsService.options.fontFamily is whatever is configured in vscode's terminal.integrated.fontFamily (uses editor.fontFamily if it's not set).

  11. Kedstar99 commented on May 3, 2020

    @Kedstar99
    Contributor

    Hello,

    I know this probably isn't helpful as you probably have a better/simpler solution. I found this issue seems to occur on several Linux programs by default. I think it's rather an issue on linux's default font handling.

    For example, below is an example image from running systemd-analyze security on default konsole, yakuake and terminator.

    Screenshot_20200503_233909

    The problem in this case is that most of the monospace fonts I saw were only supporting up to Unicode 6.

    This problem I think also occurs over here in VSCode, except unsupported emojis seem to get displayed as coloured emojis. Hence the mixture of b/w and colored in this case.

    image

    In theory this could be solved by switching to noto-color-emoji but unfortunately that seemed to also convert numeral characters into emojis as well.

    My actual solution that seems to fix the problem in all of the terminals and vscode was to apply the font config here.

    https://gist.github.com/IgnoredAmbience/7c99b6cf9a8b73c9312a71d1209d9bbb#gistcomment-2919833

    image

    I know this probably isn't the best solution and you probably would like a solution which works within vscode. It does seem to me that there is a lot of complexity involved with this binding and font config though. https://www.freedesktop.org/software/fontconfig/fontconfig-user.html

    In theory, this should be a relatively simple adjustment in the snap versions at least. What do you think about that as maybe a short-term solution to this problem?

    EDIT:
    Here is the above solution being used to show the carrot, hamburger and softball.
    image

  12. Kedstar99 commented on May 19, 2020

    @Kedstar99
    Contributor

    Hello Daniel Imms (@Tyriar),

    Sorry for disturbing, I was just curious about your thoughts about the above observations.

    Kind regards,
    Krish

  13. Tyriar commented on Jun 8, 2020

    @Tyriar
    Contributor

    Krish De Souza (@Kedstar99) all dealing with fontconfig is hidden from us as it's within Chromium, not sure what we can do here from inside vscode.

  14. Kedstar99 commented on Jun 9, 2020

    @Kedstar99
    Contributor

    Hi Daniel Imms (@Tyriar),

    Thanks for replying. I was just a little curious about how this issue was being tackled.

    I see this issue as a user config thing adjustable via fontconfig. However, if this is being solved within vscode that is fine too I guess.

    Kind regards,
    Krish

  15. Tyriar commented on Jun 11, 2020

    @Tyriar
    Contributor

    If there's a way to fix it using the font tools given to us from within a browser then we could fix it, I (and probably most users) don't want VS Code messing with config files like fontconfig.

  16. added
    electron
    on Sep 1, 2021
  17. Tyriar commented on Oct 12, 2021

    @Tyriar
    Contributor

    /duplicate #32840

  18. added
    *duplicate
    on Oct 12, 2021
  19. locked and limited conversation to collaborators on Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatebugelectronterminalupstreamupstream-issue-linked

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions