fixed fonts
This commit is contained in:
parent
ade5e1b23a
commit
5abb5fa551
@ -6,3 +6,11 @@ Bold = ImageFont.truetype("%s-Bold.ttf" % PATH, 10)
|
|||||||
BoldSmall = ImageFont.truetype("%s-Bold.ttf" % PATH, 8)
|
BoldSmall = ImageFont.truetype("%s-Bold.ttf" % PATH, 8)
|
||||||
Medium = ImageFont.truetype("%s.ttf" % PATH, 10)
|
Medium = ImageFont.truetype("%s.ttf" % PATH, 10)
|
||||||
Huge = ImageFont.truetype("%s-Bold.ttf" % PATH, 25)
|
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._canvas = None
|
||||||
self._lock = Lock()
|
self._lock = Lock()
|
||||||
|
|
||||||
if config['ui']['display']['type'] == 'inkyphat':
|
if config['ui']['display']['type'] in ('inky', 'inkyphat'):
|
||||||
self._width = 212
|
self._width = 212
|
||||||
self._height = 104
|
self._height = 104
|
||||||
else:
|
fonts.setup(10, 9, 10, 35)
|
||||||
|
elif config['ui']['display']['type'] in ('ws', 'waveshare'):
|
||||||
self._width = 250
|
self._width = 250
|
||||||
self._height = 122
|
self._height = 122
|
||||||
|
fonts.setup(10, 8, 10, 25)
|
||||||
|
|
||||||
self._state = State(state={
|
self._state = State(state={
|
||||||
'channel': LabeledValue(color=BLACK, label='CH', value='00', position=(0, 0), label_font=fonts.Bold,
|
'channel': LabeledValue(color=BLACK, label='CH', value='00', position=(0, 0), label_font=fonts.Bold,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user