From 120b01f3874ac439d28fbf1de715cc9e1049447e Mon Sep 17 00:00:00 2001 From: Rocco Augusto Date: Sat, 21 Jan 2023 10:51:17 -0800 Subject: [PATCH] fix: make sure to run fonts.init() so preview.py works Signed-off-by: Rocco Augusto --- pwnagotchi/ui/hw/base.py | 2 ++ scripts/preview.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/ui/hw/base.py b/pwnagotchi/ui/hw/base.py index 72793b0ff..f4cdd8a66 100644 --- a/pwnagotchi/ui/hw/base.py +++ b/pwnagotchi/ui/hw/base.py @@ -3,6 +3,8 @@ class DisplayImpl(object): def __init__(self, config, name): + if fonts.Medium is None: + fonts.init(config) self.name = name self.config = config['ui']['display'] self._layout = { diff --git a/scripts/preview.py b/scripts/preview.py index 4890ecabc..c564ae278 100755 --- a/scripts/preview.py +++ b/scripts/preview.py @@ -101,6 +101,10 @@ def main(): main: lang: {lang} ui: + font: + name: 'DejaVuSansMono' + size_offset: 0 + size: 0 fps: 0.3 display: enabled: false @@ -110,9 +114,8 @@ def main(): type: {display} web: enabled: true - address: "0.0.0.0" + address: '::' port: 8080 - faces: look_r: '( ⚆_⚆)' look_l: '(☉_☉ )'