question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[REQUEST] Support emoji variation selectors

See original GitHub issue

How would you improve Rich?

Add support for variation selectors. I have recently stated using rich and want to migrate from the emoji package. However, the emoji package lets me specify a variant_type when printing. This will then append a sequence after every emoji to ensure that the correct variation is printed. See the emoji package code in action.

What problem does it solve for you?

Current behaviour:

from rich.console import Console

def print_test():
    console = Console()
    console.print(":thumbs_up:")
    console.print(":warning:")

Results in: image

The equivellent code for the emoji package with variant="emoji_type" results in: image

We can obtain this behaviour with rich by changing the code to

console.print(":warning:\uFE0F")

But it would nice to have a flag on Console that automatically adds the sequence, so I don’t have to append it every time an emoji doesn’t render how I want it to.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pd93commented, Jul 13, 2021

Amazing. Thanks for such a quick turnaround on this. This is already one of my favourite Python projects 👍

1reaction
willmcgugancommented, Jul 13, 2021

I’ve added variants to 10.6.0 You can set empji_variant on the Console constructor. Or by adding -text or -emoji to the emoji code. I haven’t added it to print since there are already quite a lot of arguments on that method, and you can reverse it with the emoji code anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - Variation Sequences - Unicode
Variation sequences consist of a base character followed by a variation selector. Q: What variation sequences are valid? Only those listed in ...
Read more >
Variation Selectors (Unicode block) - Wikipedia
Variation Selectors is the block name of a Unicode code point block containing 16 variation selectors. Each variation selector is used to specify...
Read more >
Emoji and variation selectors (VS15 / VS16) #997 - GitHub
If the font supports both text and emoji presentation and can switch between them internally (e.g. using ligatures) then Hard buzz would help....
Read more >
font-variant-emoji - CSS: Cascading Style Sheets | MDN
The font-variant-emoji CSS property specifies the default presentation style for displaying emojis.
Read more >
️ Variation Selector-16 (Emoji Presentation) Emoji - Emojipedia
Variation Selector -16. Emoji Meaning. An invisible codepoint which specifies that the preceding character should be displayed with emoji presentation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found