I am designing a desktop software based on Python and the kivy platform and I use Persian / Arabic language in the software. Using two libraries arabic_reshaper and bidi. But the problem is that two of the letters, the letters "ی" and "ر", are not displayed correctly. I am sure about the health of the font because, firstly, it works perfectly well in environments such as Photoshop and Word, and secondly, it is the most famous font of this language.But I dont know where the problem is that they are not displayed properly in kivy.My method is to change the font name to roboto and replace the kivy font folder fonts.
this is my code:
from kivy.lang import Builder
import arabic_reshaper
from bidi.algorithm import get_display
from kivymd.app import MDApp
KV = '''
#:import arabic_reshaper arabic_reshaper
#:import get_display bidi.algorithm.get_display
Screen:
BoxLayout:
orientation: "vertical"
MDToolbar:
title: get_display(arabic_reshaper.reshape("ایران سنس"))
MDLabel:
halign: "center"
text_language: "ar"
base_direction: "rtl"
shorten_from: "left"
strip: True
text:get_display(arabic_reshaper.reshape("این یک متن نمونه برای تست می باشد"))
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run()
and this is result:
Does anyone know where the problem comes from?
2
Answers
By communicating with the font support, the problem was finally solved by providing several updates (the problem was with the font).
Thank you all
Try This: