From f8cbf40e1d1da62ff8c7f4eddd80e75a14f7472c Mon Sep 17 00:00:00 2001 From: j Date: Tue, 31 Jul 2018 09:37:42 +0200 Subject: [PATCH] add font size to config --- cdoseaplay/config.py | 2 +- cdoseaplay/play.py | 2 +- cdoseaplay/utils.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cdoseaplay/config.py b/cdoseaplay/config.py index a76fb20..4b88206 100644 --- a/cdoseaplay/config.py +++ b/cdoseaplay/config.py @@ -7,7 +7,7 @@ lang = '1080p' start = '' lights = False font = 'Menlo' - +font_size = 28 conf = os.path.expanduser('~/.config/cdosea.json') if os.path.exists(conf): diff --git a/cdoseaplay/play.py b/cdoseaplay/play.py index 50b70d6..1d90854 100755 --- a/cdoseaplay/play.py +++ b/cdoseaplay/play.py @@ -43,7 +43,7 @@ def main(): base = os.path.dirname(os.path.abspath(__file__)) os.chdir(base) - player = get_player(font=config.font) + player = get_player(font=config.font, font_size=config.font_size) player.register_key_binding('q', q_binding) def restart(*a): diff --git a/cdoseaplay/utils.py b/cdoseaplay/utils.py index a011d0f..1e06b01 100644 --- a/cdoseaplay/utils.py +++ b/cdoseaplay/utils.py @@ -22,11 +22,11 @@ def mpv_log(loglevel, component, message): logger.info('[{}] {}: {}'.format(loglevel, component, message)) -def get_player(fullscreen=True, font='Menlo'): +def get_player(fullscreen=True, font='Menlo', font_size=28): # 42 max player = mpv.MPV( log_handler=mpv_log, input_default_bindings=True, - input_vo_keyboard=True, sub_text_font_size=28, sub_text_font=font, + input_vo_keyboard=True, sub_text_font_size=font_size, sub_text_font=font, ) #player.observe_property('time-pos', lambda pos: print('Now playing at {:.2f}s'.format(pos))) player.fullscreen = fullscreen