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

WIP: Consider supporting emoji characters #20

Open
lread opened this issue Nov 11, 2021 · 2 comments
Open

WIP: Consider supporting emoji characters #20

lread opened this issue Nov 11, 2021 · 2 comments

Comments

@lread
Copy link
Contributor

lread commented Nov 11, 2021

Opportunity

We chould have membrane.term support showing emoji characters.
Not sure if this is worth it or interesting, but we could do it.

Current behavior

Let's run echo -e '\U0001f602' and compare the results:

From an membrane.term session (with #18 included):
image

Same from an iTerm2 session:
image

Analysis

My understanding is currently shallow here.

Here's vaguely what I'm starting to learn:

  • emojis are drawn from a special emoji font
  • emojis (all or some?) take up 2 character cells

Next Steps

  • I'll update this text in place as I learn more.
  • I'll probably try to contact the Countour terminal team for advice. They take their emojis pretty seriously, it seems.
@phronmophobic
Copy link
Owner

Not all emoji are 2 cells. For example, any of the emojis that use the zero width joiner: https://tonsky.me/blog/emoji/#zero-width-joiner.
If you try: 👩‍✈️. You can actually see some pretty funny results in Mac osx built in terminal.

emoji

It's currently possible to display emoji in membrane with the skia and java2d backends:

;; (require '[membrane.java2d :as backend])
(require '[membrane.skia :as backend])

(backend/run
  (constantly
   (ui/label "👍" (ui/font "Apple Color Emoji" 12))))

What's interesting is that it seems like you have to pick the emoji font based on the byte sequence and potentially combine several cells for a single emoji.

@lread
Copy link
Contributor Author

lread commented Nov 13, 2021

Huh! Fascinating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants