Problem Devanagri Script

29 views
Skip to first unread message

Aman Kumar

unread,
Jul 29, 2022, 3:51:24 PM7/29/22
to Kivy users support

Hello sir ..


       I am trying to make a Kivy application in Indian native languages like Hindi , Urdu(Arabic)  but the actual text is not rendering accurately . While going through a research i found that some languages like Devanagri , Persian , e.t.c are not supported in Kivy .And I also found that  Uharfbuzz  module can help us in solving our problem but we are not able to understand how to use Uharfbuzz  to solve our problem. Kindly help us to know how to use Uharfbuzz module or any other solution .


                       Thanking you in anticipation 



References :- 


https://harfbuzz.github.io/

https://groups.google.com/g/kivy-users/c/gbToPjdiN4g



Description Currently Kivy does not support reshaping for alphabets such as Arabic, Per-.jpg

Elliot Garbus

unread,
Jul 29, 2022, 5:02:16 PM7/29/22
to kivy-...@googlegroups.com

Here is a reference to using kivy with Arabic.  I hope this is helpful.  https://medium.com/@ahmedfgad/supporting-arabic-alphabet-in-kivy-for-building-cross-platform-applications-7a1e7c14a068

This video seems to use the same approach, but focused on Hindi: https://youtu.be/Ij-BvASZjO8

 

Good Luck!

--
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/e8949c14-c454-4422-a60c-9dcfaf52391dn%40googlegroups.com.

 

Aman Kumar

unread,
Jul 29, 2022, 5:14:59 PM7/29/22
to kivy-...@googlegroups.com
We have tried but noting change the problems remain same . 


 our code 

import kivy.app
import kivy.uix.label
import kivy.uix.button
import kivy.uix.textinput
import kivy.uix.boxlayout
import arabic_reshaper
import bidi.algorithm

class TestApp(kivy.app.App):
    def build(self):
        reshaped_text = arabic_reshaper.reshape("हिंदी अंतरिक्ष")
        bidi_text = bidi.algorithm.get_display(reshaped_text)
        label = kivy.uix.label.Label(text=bidi_text, font_name="font/NotoSansDevanagari-Regular.ttf")
        textInput = kivy.uix.textinput.TextInput(text=bidi_text, font_name="font/NotoSansDevanagari-Regular.ttf")
        button = kivy.uix.button.Button(text=bidi_text, font_name="font/NotoSansDevanagari-Regular.ttf")

        boxLayout = kivy.uix.boxlayout.BoxLayout(orientation="vertical")
        boxLayout.add_widget(label)

        boxLayout.add_widget(textInput)
        boxLayout.add_widget(button)
        return boxLayout


testApp = TestApp()
testApp.run()



These are some screenshot 



test.py
NotoSansDevanagari-Regular.ttf
2d332bc9-2c3a-4169-9846-ba1db23b1456.jpg
348077ca-b32d-4854-8e3e-aa28c448a4f3.jpg

Shashank Chintalagiri

unread,
Jul 30, 2022, 10:19:46 AM7/30/22
to kivy-...@googlegroups.com
Aman,

See the following for some reference and test code for Indian language rendering using various libraries.


The comments will give you some aid in being able to run it. Specifically, you will be interested in the pango text provider, or the harfbuzz+sdl2 stack.

As far as Linux on x86, x86-64, and arm, pango presently works with pip compiled (no-binary) packages of the standard kivy project. I cannot speak to other platforms. 

For harfbuzz, see 

Regards 
Shashank


Reply all
Reply to author
Forward
0 new messages