fixed fonts

This commit is contained in:
Simone Margaritelli 2019-09-28 19:52:32 +02:00
parent ade5e1b23a
commit 5abb5fa551
2 changed files with 12 additions and 2 deletions
sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui

@ -6,3 +6,11 @@ Bold = ImageFont.truetype("%s-Bold.ttf" % PATH, 10)
BoldSmall = ImageFont.truetype("%s-Bold.ttf" % PATH, 8)
Medium = ImageFont.truetype("%s.ttf" % PATH, 10)
Huge = ImageFont.truetype("%s-Bold.ttf" % PATH, 25)
def setup(bold, bold_small, medium, huge):
global PATH, Bold, BoldSmall, Medium, Huge
Bold = ImageFont.truetype("%s-Bold.ttf" % PATH, bold)
BoldSmall = ImageFont.truetype("%s-Bold.ttf" % PATH, bold_small)
Medium = ImageFont.truetype("%s.ttf" % PATH, medium)
Huge = ImageFont.truetype("%s-Bold.ttf" % PATH, huge)

@ -22,12 +22,14 @@ class View(object):
self._canvas = None
self._lock = Lock()
if config['ui']['display']['type'] == 'inkyphat':
if config['ui']['display']['type'] in ('inky', 'inkyphat'):
self._width = 212
self._height = 104
else:
fonts.setup(10, 9, 10, 35)
elif config['ui']['display']['type'] in ('ws', 'waveshare'):
self._width = 250
self._height = 122
fonts.setup(10, 8, 10, 25)
self._state = State(state={
'channel': LabeledValue(color=BLACK, label='CH', value='00', position=(0, 0), label_font=fonts.Bold,