我如何在 KivyMD 中更改 MDDataTable 的字体?
How do i change font of MDDataTable in KivyMD?
我尝试了很多方法
def set_toolbar_font_name(self, *args):
self.data_tables.table_data.font_name = "./fonts/Shivaji01.ttf"
但其中 none 个正在工作!
您不能使用 font_name
属性为 table 设置外部字体。只需对 table 行使用标记 - https://kivy.org/doc/stable/api-kivy.core.text.markup.html
[font=<str>]Added in 1.1.0[/font]
Change the font (note: this refers to a TTF file or registered alias)
我尝试了很多方法
def set_toolbar_font_name(self, *args):
self.data_tables.table_data.font_name = "./fonts/Shivaji01.ttf"
但其中 none 个正在工作!
您不能使用 font_name
属性为 table 设置外部字体。只需对 table 行使用标记 - https://kivy.org/doc/stable/api-kivy.core.text.markup.html
[font=<str>]Added in 1.1.0[/font]
Change the font (note: this refers to a TTF file or registered alias)