python kivymd MDDataTable font error

271 views
Skip to first unread message

tornike kharitonishvili

unread,
May 5, 2022, 2:25:11 PM5/5/22
to Kivy users support
hello,
I have a problem retrieving the database from the server, MDDataTable does not show Georgian font, it shows ????. I tried adding "font_name" but it does not work. "font_name" works: MDTextField and MDRaisedButton (.kv file). The records on the server are in Georgian(I have a problem only server database).

Elliot Garbus

unread,
May 5, 2022, 10:41:20 PM5/5/22
to kivy-...@googlegroups.com

Looking at the example in the KivyMD documentation, the Labels the data table appear to respond to markup.

I’d suggest changing the font with markup.  See: https://kivy.org/doc/stable/api-kivy.uix.label.html?highlight=label#markup-text

 

 

from kivy.metrics import dp
from kivy.uix.anchorlayout import AnchorLayout
 
from kivymd.app import MDApp
from kivymd.uix.datatables import MDDataTable
 
 
class Example(MDApp):
    def build(self):
        layout = AnchorLayout()
        data_tables = MDDataTable(
            size_hint=(0.9, 0.6),
            use_pagination=True,
            column_data=[
                ("No.", dp(30)),
                ("Column 1", dp(30)),
                ("[color=#52251B]Column 2[/color]", dp(30)),
                ("Column 3", dp(30)),
                ("[size=24][color=#C042B8]Column 4[/color][/size]", dp(30)),
                ("Column 5", dp(30)),
            ],
            row_data=[
                (
                    f"{i + 1}",
                    "[color=#297B50]1[/color]",
                    "[color=#C552A1]2[/color]",
                    "[color=#6C9331]3[/color]",
                    "4",
                    "5",
                )
                for i in range(50)
            ],
        )
        layout.add_widget(data_tables)
        return layout
 
 
Example().run()

--
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/8e39c9df-1c72-4c05-b67f-5cb4813d4c28n%40googlegroups.com.

 

tornike kharitonishvili

unread,
May 6, 2022, 2:23:20 AM5/6/22
to Kivy users support
Thanks for the feedback.
I have a problem with the data retrieved from the server.

For example:
I have a record on the server in Georgian, but it does not show me in MDDataTable:

gogole.png

Please help me.

Elliot Garbus

unread,
May 6, 2022, 11:07:33 AM5/6/22
to kivy-...@googlegroups.com

Did you use the markup directives in Label to set the font to a font that contains the required glyphs?

 

From: tornike kharitonishvili
Sent: Thursday, May 5, 2022 11:23 PM
To: Kivy users support
Subject: Re: [kivy-users] python kivymd MDDataTable font error

 

Thanks for the feedback.

I have a problem with the data retrieved from the server.

For example:
I have a record on the server in Georgian, but it does not show me in MDDataTable:

 

gogole.png

tornike kharitonishvili

unread,
May 11, 2022, 4:17:19 AM5/11/22
to Kivy users support
I used Georgian font only on labels, but it can not read Georgian in MDDataTable(server data).

berk berk

unread,
May 11, 2022, 10:40:17 AM5/11/22
to Kivy users support
Popular fonts about it ; { HintUnic.ttf,  unscii-16-full.ttf,  Symbola Hint.ttf,  Dejavu Sans.ttf,  Gnu-unifont.ttf,  FreeSans.ttf
But watch out that, some fonts is Monospaced.  probably Unscii-16-full or Gnu-unifont works on you.

11 Mayıs 2022 Çarşamba tarihinde saat 11:17:19 UTC+3 itibarıyla tkharitoni...@gmail.com şunları yazdı:
Reply all
Reply to author
Forward
0 new messages