Improvements Wishlist
Plugin API: the setpoint digits as Font::DIGITS, for large numbers on large tiles
CompletedA plugin's largest font today is Font::VALUE (watch_value, 38 px on the standard look). On a large tile that leaves
the numbers small: my Custom card plugin on a 3x2 tile of the 7-inch JC1060P470 shows two counts and a bar, and the
numbers use a fraction of the room (first photo). Tessera's own cards in that room take the setpoint digits.
The setpoint digits are already in every build (setpoint_digits in packages/core.yaml, 64 px on the standard look),
so handing them to plugins costs no flash and keeps the fixed set of fonts. I tried this on dev at 0ce92b27, on the
7-inch:
--- a/components/smart_display/plugin_api.h
+++ b/components/smart_display/plugin_api.h
-enum class Font : uint8_t { VALUE, HEADLINE, TITLE, BODY_LARGE, BODY, ICON, ICON_SMALL };
+// DIGITS: the climate card's setpoint digits, larger than VALUE; only digits, '-', '.', ',', 'Β°' and '%'.
+enum class Font : uint8_t { VALUE, HEADLINE, TITLE, BODY_LARGE, BODY, ICON, ICON_SMALL, DIGITS };
--- a/components/smart_display/plugin_host.cpp
+++ b/components/smart_display/plugin_host.cpp
case Font::ICON_SMALL: face = rt::mini_icon_font; break; // materialdesign_icons_mini
+ case Font::DIGITS: face = rt::setpoint_font ? rt::setpoint_font : rt::watch_value_font; break; // setpoint_digits
The new value goes last, so nothing else moves. The plugin takes DIGITS only where every value it shows has just those
glyphs and the face fits, as runtime_tiles does with face_covers(setpoint_font, value), and otherwise steps down to
VALUE as before (second photo: the same card with DIGITS). A card with a word among its values (a lock's "open", a
state of "unknown") stays in VALUE for all its values, so one card keeps one size; it is decided again with every new
value. A large face with every letter would cost flash on every board, the 4 MB ones first, which is why I'd keep it to
the digits that are already there. It would need a new minor of the plugin API, so a plugin that uses it is refused by
older firmware.
Would you take this, or would you rather offer large digits another way?
Photos:
1: Zutritt 3x2 today (38 px), relatively small on large tile:

2: Zutritt 3x2 with DIGITS:

3: Wohnzimmer-Card with DIGITS:

Stefan
Discussion 1
Add a commentThanks Stefan, taken as you proposed. It is on dev now, as part of plugin API 0.9:
Font::DIGITSis the climate card'ssetpoint_digits(64 px on the standard look, 40 on the compact one). It goes last in the enum, so nothing else moves. A board without that font falls back toVALUE. No new font and no flash on any board.ui::covers(text, font)says whether a font has every character of a text. A tile takesDIGITSonly for a value made of digits, and steps down toVALUEfor anything else, as you described.Tested with the core's host probe plugin on the CYD and the Guition, built for the host:
DIGITShas a 47 px line againstVALUE's 26 on the CYD, andcoversis true for-21,5Β°and false foropen. A plugin that uses it namesapi: "0.9"and builds only on firmware that has it. That comes with the next release, usually within a week; until then Tessera's dev firmware has it. The plugins repository's docs/FIRMWARE_API.md andtools/check.pyknow it already.Something new for plugin makers came out of this: a bench in the plugins repository.
python3 tools/preview.py --setuponce, thenpython3 tools/preview.py <your plugin folder>. It builds your plugin into the real firmware of a small, a middle, a standing and a 10-inch screen (or any glass you name with--screen 1024x600@7, and any grid with--grid), and shows every tile at every size, light and dark, every card, the top bar and the settings page on one page. It also lists what it finds wrong: a word too faint to read in dark mode, a label cut off, a part outside its tile or over another part. A plugin with API 0.9 is built on dev by itself. docs/PREVIEW.md explains it all, and it might help with your Custom card.