[REQUEST] Support emoji variation selectors
See original GitHub issueHow 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:
The equivellent code for the emoji
package with variant="emoji_type"
results in:
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:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Amazing. Thanks for such a quick turnaround on this. This is already one of my favourite Python projects 👍
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 toprint
since there are already quite a lot of arguments on that method, and you can reverse it with the emoji code anyway.