kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 237 forks source link

Update `libpng` recipe and build `SDL2_ttf` vendored `freetype` with png support, so can render colored emoji #827

Closed misl6 closed 11 months ago

misl6 commented 11 months ago

See: https://github.com/kivy/kivy/issues/7565

Apple Color Emoji and other system fonts are not accessible on iOS, as are located outside of the app sandbox, so the user will need to use an alternative font ATM.

PS: Accessing the system fonts is feasible, via CGFont methods (by reconstructing a .ttf file), and we likely want to introduce this feature on kivy/kivy.

Demo:

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout

class UI(BoxLayout):
    pass

Builder.load_string(
    """
<UI>:
    Label:
        text: "😀 🎉 📷 👕 🐞"
        font_size: dp(80)
        font_name: "./NotoColorEmoji_WindowsCompatible.ttf"
"""
)

class Testapp(App):
    def build(self):
        return UI()

Testapp().run()

Output: IMG_0065