from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.core.text import LabelBase
LabelBase.register("Roboto","HelloKitty.TTF")
class IndexPage(BoxLayout):
def __init__(self):
super(IndexPage, self).__init__()
# self.join = Button(text="hello world")
# self.add_widget(self.join)
class RunApp(App):
def __init__(self):
super(RunApp, self).__init__()
def build(self):
return IndexPage()
if __name__ == '__main__':
RunApp().run()
如图所示 第一个自体的name Roboto 是固定的 其次路径自己的字体路径
第二个是类名的第一个词 小写后是.