From 49c6a64a7b8704ce9037f1e696714109dcd1767d Mon Sep 17 00:00:00 2001 From: shagi Date: Sat, 17 Jul 2021 14:21:19 +0200 Subject: [PATCH] Upgrade Kivy and fix font error --- negromate/karaoke/karaoke.py | 16 +++++++--------- negromate/karaoke/kv_templates/karaoke.kv | 2 +- requirements.txt | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/negromate/karaoke/karaoke.py b/negromate/karaoke/karaoke.py index fa4145d..0c11fff 100755 --- a/negromate/karaoke/karaoke.py +++ b/negromate/karaoke/karaoke.py @@ -1,19 +1,16 @@ #!/usr/bin/env python -import json import os import subprocess import kivy -kivy.require('1.11.1') +kivy.require('2.0.0') from kivy.app import App -from kivy.config import Config +from kivy.core.text import LabelBase 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.uix.boxlayout import BoxLayout -from kivy.uix.button import Button -from kivy.uix.widget import Widget from negromate.songs.loader import load_songs @@ -112,7 +109,7 @@ class KaraokeGUI(BoxLayout): def play(self): subprocess.call([ - 'vlc', + 'cvlc', '--fullscreen', '--no-sub-autodetect-file', '--sub-file', @@ -140,6 +137,7 @@ class KaraokeApp(App): def main(path): # Window.fullscreen = True resource_add_path(os.path.dirname(__file__)) - Config.set('graphics', 'font_name', 'resources/fonts/CyrBit.ttf') - Config.write() + LabelBase.register( + name='CyrBit', + fn_regular='resources/fonts/CyrBit.ttf') KaraokeApp(path).run() diff --git a/negromate/karaoke/kv_templates/karaoke.kv b/negromate/karaoke/kv_templates/karaoke.kv index 431f86b..e4c9b49 100644 --- a/negromate/karaoke/kv_templates/karaoke.kv +++ b/negromate/karaoke/kv_templates/karaoke.kv @@ -1,7 +1,7 @@ KaraokeGUI: