From 6b03740a8c9fb98b788549412f0ebf3cbae1d2de Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 13 Nov 2026 16:39:50 +0100 Subject: feat(tablet): clock fonts and sizes from keystone's Fonts page The dim cover's time and date fonts move out of [tablet] clock_font and clock_font_date into keystone's fonts.json: "family" deckit-clock and deckit-date, each served at /fonts/, and the "override" sizes deckit:clock and deckit:date (else deck.css's 8rem and 1.6rem). The date can now have a font of its own. theme.css carries the rules, so a save on the Fonts page reaches an open tablet page within 5s, with no restart and no flags in the tablet state. Co-Authored-By: Claude Opus 5.5 --- tests/test_server.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test_server.py') diff --git a/tests/test_server.py b/tests/test_server.py index 8f82e9f..4d734b4 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -143,14 +143,14 @@ class Server(unittest.TestCase): from pathlib import Path f = Path(tempfile.mkdtemp()) / "Graffiti.ttf" f.write_bytes(b"\x00\x01\x00\x00clock") - with mock.patch.dict(srv.CFG, {"tablet": {"clock_font": "a Graffiti"}}): + with mock.patch.object(srv.theme, "families", return_value={"deckit-date": "a Graffiti"}): with mock.patch.object(srv, "_run", return_value=f"a Graffiti\n{f}"): - self.assertEqual(self.req("GET", "/fonts/clock", HOST)[0:2], (200, b"\x00\x01\x00\x00clock")) + self.assertEqual(self.req("GET", "/fonts/deckit-date?f=a%20Graffiti", HOST)[0:2], + (200, b"\x00\x01\x00\x00clock")) + self.assertEqual(self.req("GET", "/fonts/deckit-clock", HOST)[0], 404) # unset # fc-match's fallback for a font that is not installed with mock.patch.object(srv, "_run", return_value="DejaVu Sans\n/usr/share/fonts/DejaVuSans.ttf"): - self.assertEqual(self.req("GET", "/fonts/clock", HOST)[0], 404) - with mock.patch.dict(srv.CFG, {"tablet": {}}): - self.assertEqual(self.req("GET", "/fonts/clock", HOST)[0], 404) + self.assertEqual(self.req("GET", "/fonts/deckit-date", HOST)[0], 404) def test_assets_and_api(self): self.assertEqual(self.req("GET", "/", HOST)[0], 200) -- cgit v1.2.3