'Python Kivy Use colored emoji in Label
I've been trying to display colored emojis using Python & Kivy but the best I can achieve is this:
I tried using different fonts but none of them display with color. I also tried otf
file formats with no success. Here is my code:
from kivy.app import App
from kivy.uix.label import Label
class TestApp(App):
def build(self):
return Label(text="🌃💬🌶️💜📌", font_name="seguiemj")
TestApp().run()
I'm not trying to change the text color but actually display the fonts with their built in colors. I've tried searching myself but there doesn't seem to be a definitive yes or no to whether this is even possible.
It would greatly help if anyone can tell me how to accomplish this in the case that it is possible and an alternative method if it is not (hopefully one that doesn't involve using images).
Solution 1:[1]
try using kivymd maybe it can solve the problem
from kivymd.app import MDApp
from kivymd.uix.MDlabel import MDLabel
class TestApp(MDApp):
def build(self):
return MDLabel(text="??????", font_name="seguiemj")
TestApp().run()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |