|
5 | 5 | import time |
6 | 6 | import board |
7 | 7 | import supervisor |
| 8 | +import terminalio |
8 | 9 |
|
9 | 10 | from adafruit_fruitjam import FruitJam |
10 | 11 | from adafruit_fruitjam.peripherals import request_display_config |
11 | 12 |
|
12 | 13 | BG_COLOR = 0x0000FF |
13 | 14 |
|
| 15 | +# use built-in system font |
| 16 | +OVERLAY_FONT = terminalio.FONT |
| 17 | + |
| 18 | +# or un-comment to use a custom font. Fill in the path to your font file. |
| 19 | +# OVERLAY_FONT = "Free_Mono_10.pcf" |
| 20 | + |
14 | 21 | request_display_config(320, 240) |
15 | 22 | display = supervisor.runtime.display |
16 | 23 |
|
@@ -139,12 +146,14 @@ def format_data(json_data): |
139 | 146 | ) |
140 | 147 | fruitjam.remove_all_text() |
141 | 148 | fruitjam.add_text( |
142 | | - text_wrap=35, text_maxlen=180, text_color=0xFFFFFF, outline_size=1 |
| 149 | + text_font=OVERLAY_FONT, text_wrap=35, text_maxlen=180, text_color=0xFFFFFF, outline_size=1 |
143 | 150 | ) # title |
144 | 151 | fruitjam.add_text( |
145 | | - text_wrap=0, text_maxlen=30, text_color=0xFFFFFF, outline_size=1 |
| 152 | + text_font=OVERLAY_FONT, text_wrap=0, text_maxlen=30, text_color=0xFFFFFF, outline_size=1 |
146 | 153 | ) # stock |
147 | | -fruitjam.add_text(text_wrap=0, text_maxlen=30, text_color=0xFFFFFF, outline_size=1) # |
| 154 | +fruitjam.add_text( |
| 155 | + text_font=OVERLAY_FONT, text_wrap=0, text_maxlen=30, text_color=0xFFFFFF, outline_size=1 |
| 156 | +) # price |
148 | 157 | apply_hotkey_visuals(config_index) |
149 | 158 |
|
150 | 159 | fruitjam.neopixels.brightness = 0.1 |
|
0 commit comments