Skip to main content

max / makenotwork

Share the face cut through quasi-type's cut_web, and fingerprint typography.css The fifteen lines here were the first of three copies; they live in quasi-type now. The version fingerprint also has to see typography.css, or a change to the weight range or the font URL serves stale to every browser holding a cached head.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-17 16:20 UTC
Signed with PGP, not checked
Commit: 59c8d38dba623cd998d60f258c212b589d79cee6
Parent: 451fd22
3 files changed, +36 insertions, -60 deletions
M server/Cargo.lock +12 -12
@@ -10772,18 +10772,6 @@
10772 10772 "pkg-config",
10773 10773 ]
10774 10774
10775 - [[patch.unused]]
10776 - name = "quasi-immediate"
10777 - version = "0.18.0"
10778 -
10779 - [[patch.unused]]
10780 - name = "quasi-store"
10781 - version = "0.1.0"
10782 -
10783 - [[patch.unused]]
10784 - name = "quasi-tauri"
10785 - version = "0.18.0"
10786 -
10787 10775 [[patch.unused]]
10788 10776 name = "kberg"
10789 10777 version = "0.1.0"
@@ -10796,6 +10784,18 @@
10796 10784 name = "painhours"
10797 10785 version = "0.1.0"
10798 10786
10787 + [[patch.unused]]
10788 + name = "quasi-immediate"
10789 + version = "0.18.0"
10790 +
10791 + [[patch.unused]]
10792 + name = "quasi-store"
10793 + version = "0.1.0"
10794 +
10795 + [[patch.unused]]
10796 + name = "quasi-tauri"
10797 + version = "0.18.0"
10798 +
10799 10799 [[patch.unused]]
10800 10800 name = "synckit-client"
10801 10801 version = "0.8.0"
M server/build.rs +23 -47
@@ -140,6 +140,15 @@
140 140 "static/geometry.css",
141 141 "static/layout.css",
142 142 "static/embed-geometry.css",
143 + // The tokens and the @font-face rules. Note what this does NOT cover:
144 + // the woff2 files themselves are served under fixed names with no `?v=`,
145 + // so a re-cut of the same slot ships new bytes at an old URL and a
146 + // browser holding a cached copy keeps it. That was equally true of the
147 + // Plex and Lato files this replaced, and a face changes about as often
148 + // as the glyph set version does, so it is a known edge rather than a
149 + // regression. The fix, if it ever bites, is a version in the URL
150 + // makeover is handed.
151 + "static/typography.css",
143 152 ] {
144 153 if let Ok(content) = fs::read(path) {
145 154 content.hash(&mut hasher);
@@ -184,56 +193,23 @@
184 193 /// finds out until a mark looks wrong. The pipeline is the source; these are
185 194 /// its output, and they are gitignored.
186 195 ///
187 - /// # woff2 only, and no ttf beside it
188 - ///
189 - /// The old pairs here offered `woff2` with a `truetype` fallback, which was
190 - /// already dead weight: every browser that can run this site has supported
191 - /// woff2 since 2018, and the ttf is 2-3x the bytes for a case that does not
192 - /// arrive. `makeover::font_face_css` declares woff2 alone, so writing a ttf
193 - /// would put a file in `static/` that nothing ever fetches.
194 - ///
195 - /// # The base is fetched once
196 - ///
197 - /// `quasi_type::cut` downloads the pinned base into the cache directory below
198 - /// and checksums it, so a warm target directory needs no network. `offline` is
199 - /// false because the first build on a fresh machine has to be able to fetch;
200 - /// a failure here is fatal rather than skipped, since a missing face is a site
196 + /// The base is downloaded into `OUT_DIR` once and checksummed against
197 + /// quasi-type's pins, so a warm target directory needs no network. `offline` is
198 + /// false because the first build on a fresh machine has to be able to fetch,
199 + /// and a failure here is fatal rather than skipped: a missing face is a site
201 200 /// rendering in the fallback with nothing to say so.
202 201 fn cut_house_faces() {
203 - let dir = Path::new("static/fonts");
204 - fs::create_dir_all(dir).expect("create static/fonts");
205 202 let cache = Path::new(&std::env::var("OUT_DIR").expect("cargo sets OUT_DIR")).join("bases");
206 -
207 - for (slot, file) in [
208 - ("quasi-mono", makeover_build::WEBFONT_MONO_FILE),
209 - ("quasi-body", makeover_build::WEBFONT_SANS_FILE),
210 - ] {
211 - let cut = quasi_type::cut(slot, &cache, false)
212 - .unwrap_or_else(|e| panic!("could not cut {slot}: {e}"));
213 - let face = cut
214 - .faces
215 - .first()
216 - .unwrap_or_else(|| panic!("{slot} cut no faces"));
217 - // One file per slot, and it carries the whole `wght` 200-800 axis. The
218 - // four static files this replaces (Plex Mono and Lato, regular and
219 - // bold) were 101 KB of woff2 between them and covered two weights.
220 - write_bytes_if_changed(&dir.join(file), &face.woff2);
221 - write_bytes_if_changed(
222 - &dir.join(format!("OFL-{}.txt", cut.family.replace(' ', ""))),
223 - &cut.license,
224 - );
225 - }
226 - }
227 -
228 - /// `write_if_changed` for bytes.
229 - ///
230 - /// Same reason as the text version: rewriting an identical file bumps its mtime
231 - /// and makes every downstream step think the fonts moved.
232 - fn write_bytes_if_changed(path: &Path, contents: &[u8]) {
233 - if fs::read(path).is_ok_and(|existing| existing == contents) {
234 - return;
235 - }
236 - fs::write(path, contents).unwrap_or_else(|e| panic!("write {}: {e}", path.display()));
203 + quasi_type::cut_web(
204 + Path::new("static/fonts"),
205 + &cache,
206 + false,
207 + &[
208 + ("quasi-mono", makeover_build::WEBFONT_MONO_FILE),
209 + ("quasi-body", makeover_build::WEBFONT_SANS_FILE),
210 + ],
211 + )
212 + .expect("cut the house faces");
237 213 }
238 214
239 215 /// Intrinsic dimensions of the landing screenshots, read from the files.
@@ -29,7 +29,7 @@
29 29 border: 'var(--border, #444)',
30 30 textSecondary: 'var(--content-secondary, #aaa)',
31 31 bgSecondary: 'var(--surface-overlay, #2d2d2d)',
32 - fontBody: 'var(--font-body, sans-serif)',
32 + fontBody: 'var(--font-sans, sans-serif)',
33 33 }, opts.cssVars || {});
34 34
35 35 let updateBannerShown = false;