Skip to content

Handle U+FE0F variation selector to render characters as emoji #880

Closed

Description

I've installed the Twitter emoji font in wsltty 3.0.1.2 per the mintty wiki's instructions, and the emoji rendering works for the most part. However, there are certain characters that are only to be rendered as emoji if followed by U+FE0F, and mintty does not render these as emoji even in presence of this variation selector.

Examples:

Screenshot:

Screenshot

Activity

  1. mintty commented on Jun 3, 2019

    @mintty
    Owner

    Works for me. I suppose the Twitter emoji set you installed does not include the respective emoji graphics. Try another one.

  2. mintty commented on Jun 3, 2019

    @mintty
    Owner

    In fact, yes, mintty assumes that emoji sequences with FE0F are displayed by graphics without that suffix.
    It may have been the naming scheme of emoji graphics at the time I designed the implementation.
    Could it have changed? To be checked.

    About the width, that works as designed. As discussed in other issues, the display width is always made consistent with the locale-determined width of the respective character sequence. That also applies to emoji sequences, which can therefore be displayed in more than two cells width.

  3. mintty commented on Jun 4, 2019

    @mintty
    Owner

    Quoting from wiki Tips:

    Emojis are displayed in the rectangular character cell group determined by the cumulated width of the emoji sequence characters. The option EmojiPlacement can adjust the location of emoji graphics within that area.

    An application cannot know whether the terminal applies emoji graphic rendering or not. But in the cell-based traditional terminal paradigm, applications must know how many cells their output occupies. So I do not consider it a good idea to drop reliable width information for the sake of emoji display — that would be problematic. It's a trade-off; there is no way to "fix" it because it's not a bug.

  4. mintty commented on Jun 4, 2019

    @mintty
    Owner

    This was also discussed in https://gitlab.freedesktop.org/terminal-wg/specifications/issues/9#note_121976 and subsequent comments. Unicode is not a good model for cell-based terminals in this respect, unfortunately. I could imagine an optional workaround...

  5. mintty commented on Jun 4, 2019

    @mintty
    Owner

    The Unicode database contains distinct files emoji-data.txt, emoji-sequences.txt, emoji-zwj-sequences.txt and emoji-variation-sequences.txt, thereby calling for non-uniform handling...

    Try EmojiPlacement=align or =middle to avoid the stretching if you prefer.

  6. mintty commented on Jun 4, 2019

    @mintty
    Owner

    So where did you download the failing repository? Extracting "twitter" emojis from the Unicode charts, using my script, gives me 2139.png and 270f.png both without suffix.

  7. mintty commented on Jun 5, 2019

    @mintty
    Owner

    OK, that repository seems to be a clone of older emoji data, not updated recently, and following that naming scheme which I suppose is deprecated. I think I'll remove it from the wiki list.
    You can deploy emoji data from the Unicode charts list. If only the script wouldn't be so slow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions