-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kivy label show Khmer error #7227
Comments
Confirming that I ran this code on Windows 11, Kivy 2.2.1 using a copy of the font I downloaded from khmer-fonts.com, and got the wrongly-displayed text. Furthermore, I copied the text into the previewer on that site, and confirmed that the font is capable of showing it. |
Well ... I've just tested the following on macOS (and maybe @Julian-O can confirm that on Windows):
Is that a font issue that needs to be investigated on freetype? |
By looking at file infos, dates and releases are pretty different between the two versions, but I'm not able to find a release note for the font file. |
Interesting. On Windows...
Is Khmer OS Battambang the same font (albeit different versions) as the ones called Battambang on Google? Well EagleFonts seems to think so, listing Danh Hong as the author. |
Downloaded a copy from Google Fonts. Problem replicated also on macOS. However, by providing the correct script name it actually works. (with all the 3 fonts files) from kivy.uix.label import Label
from kivy.app import App
class KhmerApp(App):
def build(self):
label = Label(text="សួស្តី")
label.font_name = "./Battambang-Regular.ttf"
label.font_script_name = "Khmr"
label.font_size = 300
return label
if __name__ == '__main__':
KhmerApp().run() If you @Julian-O can confirm the same, I guess we can close the issue as fixed. ( |
Confirm it works on Windows when That's a new concept for me. Closing as solved, but I am thinking about working it into the FAQ. (Oh, and a big thanks to the @onsunsl. Your test code and clear explanation made this possible to debug and test despite not being able to read a word of Khmer. សូមអរគុណ) |
Software Versions
3.6.6
Windows 10
1.11.1
pip install kivy
Expected behavior
I want to show Khmer text like this
សួស្តី
, but the kivy show effect is like this:I think SDL2 has a problem with Khmer rendering. The
KhmerOSBattambang-Regular.ttf
font file i have verified in PyQtthat it can be show Khmer language normally.
Code and Logs and screenshots
The text was updated successfully, but these errors were encountered: