Upgrade Kivy and fix font error

This commit is contained in:
Ales (Shagi) Zabala Alava 2021-07-17 14:21:19 +02:00
parent 968ad8a788
commit 49c6a64a7b
3 changed files with 9 additions and 11 deletions

View File

@ -1,19 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
import json
import os import os
import subprocess import subprocess
import kivy import kivy
kivy.require('1.11.1') kivy.require('2.0.0')
from kivy.app import App from kivy.app import App
from kivy.config import Config from kivy.core.text import LabelBase
from kivy.core.window import Window from kivy.core.window import Window
from kivy.properties import StringProperty, ObjectProperty, ListProperty, BooleanProperty from kivy.properties import ObjectProperty, ListProperty, BooleanProperty
from kivy.resources import resource_add_path from kivy.resources import resource_add_path
from kivy.uix.boxlayout import BoxLayout from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from negromate.songs.loader import load_songs from negromate.songs.loader import load_songs
@ -112,7 +109,7 @@ class KaraokeGUI(BoxLayout):
def play(self): def play(self):
subprocess.call([ subprocess.call([
'vlc', 'cvlc',
'--fullscreen', '--fullscreen',
'--no-sub-autodetect-file', '--no-sub-autodetect-file',
'--sub-file', '--sub-file',
@ -140,6 +137,7 @@ class KaraokeApp(App):
def main(path): def main(path):
# Window.fullscreen = True # Window.fullscreen = True
resource_add_path(os.path.dirname(__file__)) resource_add_path(os.path.dirname(__file__))
Config.set('graphics', 'font_name', 'resources/fonts/CyrBit.ttf') LabelBase.register(
Config.write() name='CyrBit',
fn_regular='resources/fonts/CyrBit.ttf')
KaraokeApp(path).run() KaraokeApp(path).run()

View File

@ -1,7 +1,7 @@
KaraokeGUI: KaraokeGUI:
<Label>: <Label>:
font_name: 'CyrBit.ttf' font_name: 'CyrBit'
font_size: 12 font_size: 12
<Action@Button>: <Action@Button>:

View File

@ -1,2 +1,2 @@
Kivy==1.11.1 Kivy==2.0.0
negromate.songs @ git+https://git.negromate.rocks/NegroMate/songs.git@1.0 negromate.songs @ git+https://git.negromate.rocks/NegroMate/songs.git@1.0