Skip to content

Commit eb1186f

Browse files
authored
Merge pull request #575 from brentru/patch-smart-therm
Fix PyPortal Thermostat Font Preloading
2 parents c38ae7d + d78219d commit eb1186f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

PyPortal_Smart_Thermometer/thermometer_helper.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# Fonts within /fonts folder
1313
info_font = cwd+"/fonts/Nunito-Black-17.bdf"
1414
temperature_font = cwd+"/fonts/Nunito-Light-75.bdf"
15-
glyphs = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-,.:'
1615

1716
class Thermometer_GFX(displayio.Group):
1817
def __init__(self, celsius=True, usa_date=True):
@@ -42,6 +41,7 @@ def __init__(self, celsius=True, usa_date=True):
4241
self.set_icon(self._cwd+"/icons/pyportal_splash.bmp")
4342

4443
print('loading fonts...')
44+
glyphs = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-,.:/ '
4545
self.info_font = bitmap_font.load_font(info_font)
4646
self.info_font.load_glyphs(glyphs)
4747

@@ -55,6 +55,11 @@ def __init__(self, celsius=True, usa_date=True):
5555
self.title_text.y = 15
5656
self._text_group.append(self.title_text)
5757

58+
self.subtitle_text = Label(self.info_font, text="Analog Devices ADT7410")
59+
self.subtitle_text.x = 43
60+
self.subtitle_text.y = 35
61+
self._text_group.append(self.subtitle_text)
62+
5863
self.temp_text = Label(self.c_font, max_glyphs=8)
5964
self.temp_text.x = 25
6065
self.temp_text.y = 110

0 commit comments

Comments
 (0)