Software Versions
- Python: 3.10.9
- OS: Windows, Android
- Kivy: 2.1.0
- Kivy installation method: pip install kivy
I rendered the following text with google Noto Sans Sinhala in kivy app and it is rendered incorrectly. Is Kivy able to render Sinhala characters correctly? As we want to support Sinhala languages in our applications. Please help
Example text Expected output:
පාරිභෝගිකයාKivy application output:This happens in all controls - label and text input and we have tried different ttf files.
Can we get some help here please?
Example code:
from kivy.app import App
from kivy.lang import Builder
kv = """
GridLayout:
id: layout
cols: 1
Label:
text: "Customer"
font_name: "NotoSansSinhala-Regular.ttf"
halign: "center"
"""
class Main(App):
def build(self):
return Builder.load_string(kv)
if name == "main":
main().run()
Font file link: https://fonts.google.com/noto/specimen/Noto+Sans+Sinhala
You may find this article helpful: https://medium.com/@ahmedfgad/supporting-arabic-alphabet-in-kivy-for-building-cross-platform-applications-7a1e7c14a068
It looks like you need a reshaping engine that supports Sinhala. I found this reference:
and this: https://github.com/harfbuzz/harfbuzz
Try searching for “Unicode shaper”
From: ShanWick
Sent: Friday, March 3, 2023 9:49 PM
To: Kivy users support
Subject: [kivy-users] Sinhala Font rendering incorrect in Kivy App
Software Versions
I rendered the following text with google Noto Sans Sinhala in kivy app and it is rendered incorrectly. Is Kivy able to render Sinhala characters correctly? As we want to support Sinhala languages in our applications. Please help
Example text Expected output:
පාරිභෝගිකයා
Kivy application output:
This happens in all controls - label and text input and we have tried different ttf files.
Can we get some help here please?
Example code:
from kivy.app import App
from kivy.lang import Builder
kv = """
GridLayout:
id: layout
cols: 1
Label:
text: "Customer"
font_name: "NotoSansSinhala-Regular.ttf"
halign: "center"
"""
class Main(App):
def build(self):
return Builder.load_string(kv)
if name == "main":
main().run()
Font file link: https://fonts.google.com/noto/specimen/Noto+Sans+Sinhala
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/fa061c0e-ff81-4598-9ef3-cedde00ace5cn%40googlegroups.com.