Repository navigation
R15: serve the brand's Arabic and figure fonts from the agent (Dubai left out: its licence forbids it) - #68
Merged
Merged
Conversation
R15 (#59), approved on condition that Dubai's licence allows it. It does not: TEC's EULA licenses Dubai for internal use only and forbids further distribution or making it available to anyone without TEC's written consent (2.2, 3.1(d), 3.1(i)), and this repository is public. So the agent ships Lateef and IBM Plex Mono only. Both are unmodified, because both reserve their names and the OFL does not let a subset keep one. Lateef is SIL's 4.400 TTF (byte-identical to google/fonts) compressed to WOFF2 and nothing else; Plex Mono is IBM's own Latin-1 web file from @ibm/plex-mono 2.5.0. Each ships with its OFL. The storefront's subsets are not used. dashboard-fix.js declares the faces on the document with the rules proven on the bench: Lateef Arabic only at size-adjust 150%, Plex Mono 500. A browser fetches them only where a theme names these families. dashboard-fix.js is now registered with a content-hash cache buster: the static path is cached for 31 days, so an update could otherwise take a month to reach an open browser. tests/test_fonts.py pins the shipped files to their recorded hashes and licences and fails if a Dubai file appears; the live Dwains runner checks the fonts load in Firefox and Chromium in real Home Assistant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #59 (R15), with the owner's condition applied: Dubai's licence was read first, and it does not allow this. The agent ships Lateef and IBM Plex Mono only.
Dubai: the licence, and why it is left out
The web files in
smarthome-planner/assets/fonts/dartec-dubai-*.woff2are Monotype's Dubai W23 build: name table "Copyright © 2017 Dubai Executive Council. All rights reserved", with no licence URL. I did not use the copies inC:\Windows\Fonts. Their licence is the End User Licence Agreement – Dubai Font from The Executive Council of Dubai ("TEC"). I read the full text as published at fontsquirrel.com/license/dubai; dubaifont.com has no licence page of its own. The relevant clauses:A public repository publishes the files to anyone, so Dubai is out.
What Dubai would need: TEC's written consent under 3.1(i), requested per clause 8.1 at info@dubaifont.com, covering redistribution in a public repository and delivery to customers' browsers as a web font. Serving it from the private manager instead doesn't clearly avoid the problem: a font file sent to a browser can be saved, which 2.2(e) doesn't allow.
What ships
Lateef-Regular/Medium/Bold.woff2google/fontsofl/lateefOFL-Lateef.txtIBMPlexMono-Medium-Latin1.woff2@ibm/plex-mono2.5.0 (matches the npm tarball's sha512)OFL-IBMPlexMono.txtAbout 290 KB, in
www/fonts/, served from the existing/dartec_brandingstatic path.I did not use the planner's web files for these fonts either. Both licences reserve names: Lateef reserves "Lateef" and "SIL", and IBM reserves "Plex". Under OFL condition 3, "No Modified Version of the Font Software may use the Reserved Font Name(s)". OFL FAQ 2.6 answers "Is subsetting a webfont considered modification?" with "Yes".
dartec-lateef-*-ar.woff2are subsets Dartec made (1,386 of 1,830 glyphs).dartec-plex-mono.woff2is a 280-glyph subset matching none of IBM's builds.The agent ships unmodified fonts instead:
head, where WOFF2 itself sets flag bit 11 ("lossless transformation") and the checksum.Provenance and hashes are in
www/fonts/README.md.Code
dashboard-fix.jsdeclares the faces on the document using the bench rules fromdartec-variants/README.md#fonts, verbatim except for Dubai.size-adjust: 150%andunicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF.branding.pyregistersdashboard-fix.js?v=<content hash>. The static path is served withmax-age=2678400(31 days), so until now a new version of this module could take a month to reach an open browser. That applied to the Dwains fixes too.tests/test_fonts.pypins each file to its recorded hash and licence, pins the 150% and Arabic-only rules, and fails if any Dubai font file appears in the repository. I confirmed that last check trips when such a file is present.run_live_dwains.pygainscheck_fonts: in real HA, each file must be served byte-identical asfont/woff2, and in Firefox and Chromium, Lateef 400/700 and Plex Mono 500 must load, with Lateef Arabic-only at 150% and no Dubai face. Its fix-blocking route now matches the?v=URL.run_live_dwains.py 2026.9.3passed in 401 s.For the theme (kaboomAE/dartec-theme, not changed here)
Once this is released, the Dartec themes should set:
The drafts name
'Dartec Dubai'first. That's harmless, since browsers skip an undeclared face, but it names a font that won't exist without TEC's consent.Bench proof (BENCH Pi 192.168.1.51, location "TEST", HA 2026.9.3)
bench-tools/vshot.pydoes). The only thing that changed between runs was the agent:e95f7bd, installed through HACS by exact ref, then an HA restart.Lateef-Regular.woff2andLateef-Medium.woff2from the agent (200,font/woff2) and both loaded. English pages, and a dashboard with no Arabic text, fetched nothing.dashboard-fix.jsis served without?v=./dartec_branding/fonts/returns 404.bench-tools/changes.jsonl.Arabic detail, before (system Arabic) and after (Lateef at 150%):

Profile page, tablet, English and Arabic, light and dark:

Bedroom dashboard, phone:

Not in this PR
No version bump and no release. Agent changes reach homes only through a HACS release with guarded rollout, and that needs the owner's OK.
🤖 Generated with Claude Code