Public Access
Add scrolling, countdown, stopwatch, images, seconds, multiplier and degree sign
- Text elements can scroll in a window at a set speed; clock, countdown and stopwatch can show seconds. Moving pages are sent as instant frames (new Nano command D1) and paced by the estimated flip time. - Countdown to a date and time (smart, days, days + time, with seconds), stopwatch (web UI, HA switch and reset button), image element (fixed or by Home Assistant state), multiplier for HA values, degree sign (char 127) in all fonts and the font converter. - Page format version 2; version 1 pages are converted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca8d78ea8a
commit
fc6fa1a180
38 files changed
+1370
-277
No files matched your search
@@ -1,4 +1,5 @@
|
||||
"""Generates src/esp32/logic/builtin_fonts.cpp: the built-in fonts of the dynamic pages.
|
||||
Characters 32-126, and 127 as the degree sign.
|
||||
|
||||
python tools/make_builtin_fonts.py
|
||||
|
||||
@@ -21,7 +22,14 @@ GFX = os.path.join(ROOT, ".pio", "libdeps", "esp32", "Adafruit GFX Library")
|
||||
OUT = os.path.join(ROOT, "src", "esp32", "logic", "builtin_fonts.cpp")
|
||||
|
||||
FIRST = 32
|
||||
LAST = 126
|
||||
LAST = 126 # plus character 127: the degree sign (DEGREE in each font)
|
||||
|
||||
# The degree sign per font height, drawn at the top of the character
|
||||
DEGREE = {
|
||||
6: [".#.", "#.#", ".#.", "...", "...", "..."],
|
||||
8: [".##.", "#..#", "#..#", ".##.", "....", "....", "....", "...."],
|
||||
19: [".####.", "##..##", "#....#", "#....#", "##..##", ".####."] + ["......"] * 13,
|
||||
}
|
||||
|
||||
|
||||
def numbers(text):
|
||||
@@ -62,6 +70,7 @@ def classic():
|
||||
columns = font[c * 5 : c * 5 + 5]
|
||||
rows = ["".join("#" if columns[x] >> y & 1 else "." for x in range(5)) for y in range(8)]
|
||||
glyphs.append((5, rows))
|
||||
glyphs.append((4, DEGREE[8]))
|
||||
return encode("Normal", 8, 1, glyphs)
|
||||
|
||||
|
||||
@@ -91,6 +100,7 @@ def tom_thumb():
|
||||
for i in digits:
|
||||
width, rows = glyphs[i]
|
||||
glyphs[i] = (widest, ["." * (widest - width) + r for r in rows])
|
||||
glyphs.append((3, DEGREE[6]))
|
||||
return encode("Small", 6, 1, glyphs)
|
||||
|
||||
|
||||
@@ -146,6 +156,7 @@ def full_height():
|
||||
glyphs.append((len(special[ch][0]), special[ch]))
|
||||
else:
|
||||
glyphs.append((0, [""] * 19)) # not in this font: skipped
|
||||
glyphs.append((6, DEGREE[19]))
|
||||
return encode("Full height", 19, 2, glyphs)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user