diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1b6334a..33f528e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -606,6 +606,9 @@ jobs:
python -m pip install -r site/requirements.txt
- name: Build site
+ # The home page reads the newest releases through gh; a failed call fails the build.
+ env:
+ GH_TOKEN: ${{ github.token }}
run: python site/build.py
- name: Make the release files
diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml
index 79b021b..d2ac3d1 100644
--- a/.github/workflows/site.yml
+++ b/.github/workflows/site.yml
@@ -1,18 +1,24 @@
name: site
-# Build the specimen site (site/build.py) and deploy it to GitHub Pages.
+# Build the specimen site (site/build.py) and deploy it to GitHub Pages. A pull request that
+# touches the site builds and checks it too, with the same token, but does not deploy.
# Pages source must be "GitHub Actions" (repo settings).
on:
push:
branches: [main]
+ pull_request:
+ paths:
+ - "site/**"
+ - "fonts/**"
+ - ".github/workflows/site.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
- group: pages
+ group: ${{ github.event_name == 'pull_request' && format('site-pr-{0}', github.ref) || 'pages' }}
cancel-in-progress: false
jobs:
@@ -41,6 +47,9 @@ jobs:
# it stops with an error when a file is missing, so the deploy fails
# and the live site stays as it is.
- name: Build site
+ # The home page reads the newest releases through gh; a failed call fails the build.
+ env:
+ GH_TOKEN: ${{ github.token }}
run: python site/build.py
- name: Check the built site
@@ -50,21 +59,24 @@ jobs:
fonts/warp/MachineMadeWarp-Regular.woff2 fonts/warp/MachineMadeWarp-Italic.woff2 \
fonts/warp/MachineMadeWarp-Bold.woff2 fonts/warp/MachineMadeWarp-BoldItalic.woff2 \
fonts/warp/MachineMadeWarpDisplay-Regular.woff2 fonts/warp/MachineMadeWarpDisplay-Italic.woff2 \
- data/readability.json data/heddle.json data/warp.json index.html weft/index.html heddle/index.html \
- warp/index.html; do
+ data/readability.json data/heddle.json data/warp.json index.html 404.html weft/index.html heddle/index.html \
+ warp/index.html fonts/home/weft.woff2 fonts/home/heddle.woff2 og.jpg; do
test -s "site/_site/$f" || { echo "::error::site/_site/$f is missing."; exit 1; }
done
python -c 'import json,sys; r=json.load(open("site/_site/data/readability.json")); sys.exit(0 if r.get("rows") else 1)'
- name: Configure Pages
+ if: github.event_name != 'pull_request'
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload Pages artifact
+ if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/_site
deploy:
+ if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 10
diff --git a/README.md b/README.md
index 6ce0558..d92ff31 100644
--- a/README.md
+++ b/README.md
@@ -140,9 +140,15 @@ Site (from the repository root):
```sh
python -m pip install -r site/requirements.txt
-python site/build.py # site/_site/
+python site/build.py # site/_site/; reads the newest releases through gh (set GH_TOKEN)
+uv run --with playwright==1.65.1 playwright install chromium # once, or pass --chrome PATH
+uv run --with playwright==1.65.1 python3 site/shots.py --axe axe.min.js # browser check, by hand
```
+The home page and the 404 page follow the design system of the four
+machine-made sites. `site/assets/system.css` is copied unchanged from
+machine-made/machine-made.github.io; its first line names the commit.
+
## Repository layout
| Path | Content |
diff --git a/site/assets/heddle.js b/site/assets/heddle.js
index a42e049..97798bd 100644
--- a/site/assets/heddle.js
+++ b/site/assets/heddle.js
@@ -75,7 +75,7 @@
var grid = el("div", { "class": "glyph-grid", role: "group", "aria-labelledby": hid });
grp.chars.forEach(function (c) {
var b = el("button", { type: "button", "aria-pressed": "false",
- "aria-label": (c.n || hex(c.u)) + ", " + hex(c.u), title: hex(c.u) + " " + c.n },
+ "aria-label": String.fromCodePoint(c.u) + ", " + (c.n || hex(c.u)) + ", " + hex(c.u), title: hex(c.u) + " " + c.n },
String.fromCodePoint(c.u));
b.addEventListener("click", function () { show(b, c); });
grid.appendChild(b);
diff --git a/site/assets/site.css b/site/assets/site.css
index 2c1f542..95485ea 100644
--- a/site/assets/site.css
+++ b/site/assets/site.css
@@ -1,38 +1,24 @@
-/* machine-made/type site. Layout: a foundry proof sheet. One ruled column of
- sections; black, white and one red dot. The UI text is set in mm Sans; the
- samples are set in the family they show. */
+/* machine-made/type site: the specimen components of the family and download pages. The bars, the footer,
+ the colours, the grid and the home page come from system.css (the design system of the four sites); this file
+ maps its own names onto those tokens. The samples are set in the family they show. */
:root {
- --paper: #F4F5F3;
- --panel: #EAECE9;
- --ink: #121314;
- --muted: #555A5E;
- --rule: #D3D6D2;
- --red: #D42A1F;
- --sans: "mm Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
- --mono: "mm Weft", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
- --heddle: "mm Heddle", "Helvetica Neue", Arial, sans-serif;
- --warp: "mm Warp", Georgia, "Times New Roman", serif;
- --warp-display: "mm Warp Display", "mm Warp", Georgia, serif;
- --step-0: 0.8125rem;
- --step-1: 1rem;
- --step-2: 1.25rem;
- --step-3: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
- --step-4: clamp(2.25rem, 1.4rem + 4vw, 4.25rem);
- --gutter: max(16px, env(safe-area-inset-left, 0px));
+ --paper: var(--ground);
+ --panel: var(--surface);
+ --ink: var(--text);
+ --rule: var(--line);
+ --red: var(--accent);
+ --sans: var(--f-sans);
+ --mono: var(--f-weft);
+ --heddle: var(--f-heddle);
+ --warp: var(--f-warp);
+ --warp-display: "mm Warp Display", var(--f-warp);
+ --ss-0: 0.8125rem;
+ --ss-1: 1rem;
+ --ss-2: 1.25rem;
+ --ss-3: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
+ --ss-4: clamp(2.25rem, 1.4rem + 4vw, 4.25rem);
--sans-features: normal;
- color-scheme: light;
-}
-@media (prefers-color-scheme: dark) {
- :root {
- --paper: #0E0F10;
- --panel: #17191B;
- --ink: #ECEDEA;
- --muted: #A2A8AC;
- --rule: #2E3134;
- --red: #FF5446;
- color-scheme: dark;
- }
}
*, *::before, *::after { box-sizing: border-box; }
@@ -43,16 +29,16 @@ body {
color: var(--ink);
font-family: var(--sans);
font-feature-settings: var(--sans-features);
- font-size: var(--step-1);
+ font-size: var(--ss-1);
line-height: 1.55;
-webkit-font-smoothing: antialiased;
overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
-h1 { font-size: var(--step-4); }
-h2 { font-size: var(--step-3); }
-h3 { font-size: var(--step-2); font-weight: 600; }
+h1 { font-size: var(--ss-4); }
+h2 { font-size: var(--ss-3); }
+h3 { font-size: var(--ss-2); font-weight: 600; }
p { margin: 0; max-width: 68ch; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--red); }
@@ -60,49 +46,20 @@ code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 1px; }
main:focus { outline: none; }
-.wrap {
- max-width: 1160px;
- margin: 0 auto;
- padding-left: var(--gutter);
- padding-right: max(16px, env(safe-area-inset-right, 0px));
-}
.visually-hidden {
position: absolute !important; width: 1px; height: 1px; overflow: hidden;
clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
-.skip {
- position: absolute; left: 16px; top: -100px; z-index: 10;
- background: var(--ink); color: var(--paper); padding: 8px 14px; font-weight: 600;
-}
-.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.weft { font-family: var(--mono); font-feature-settings: normal; }
.sans { font-family: var(--sans); }
.heddle { font-family: var(--heddle); font-feature-settings: normal; }
.warp { font-family: var(--warp); font-feature-settings: normal; }
-/* Header */
-/* The row of sites, the same on every machine-made house: machine-made, openfluids, fonts, BoringQuantSystems. */
-.houses-in { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-block: 0; padding-block: 10px; list-style: none; }
-.houses a { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: -0.03em; color: var(--muted); text-decoration: none; }
-.houses a:hover, .houses a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }
-.site-head { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
-.site-head-in {
- display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
- gap: 10px 24px; padding-block: 14px;
-}
-.brand { display: inline-flex; align-items: flex-end; gap: 10px; text-decoration: none; color: var(--ink); }
-.brand .wordmark { height: 22px; width: auto; }
-.brand-sub { font-size: var(--step-0); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1; padding-bottom: 1px; }
-.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
-.nav a { display: inline-block; padding: 6px 0; font-size: 0.9375rem; font-weight: 550; text-decoration: none; border-bottom: 2px solid transparent; }
-.nav a:hover { border-bottom-color: var(--rule); }
-.nav a[aria-current="page"] { border-bottom-color: var(--red); }
-
/* Eyebrow and dot */
.eyebrow {
display: block;
- font-size: var(--step-0); font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
+ font-size: var(--ss-0); font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
color: var(--muted); max-width: none;
}
.dot { width: 9px; height: 9px; background: var(--red); border-radius: 50%; flex: none; display: inline-block; vertical-align: 0.05em; }
@@ -112,9 +69,9 @@ main:focus { outline: none; }
.band { display: grid; gap: 22px; padding-block: 48px; border-bottom: 1px solid var(--rule); }
.sec-head { display: grid; gap: 10px; }
.intro { color: var(--muted); }
-.cap { font-size: var(--step-0); font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
-.note { font-size: var(--step-0); color: var(--muted); }
-.lede { font-size: var(--step-2); line-height: 1.45; max-width: 56ch; }
+.cap { font-size: var(--ss-0); font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
+.note { font-size: var(--ss-0); color: var(--muted); }
+.lede { font-size: var(--ss-2); line-height: 1.45; max-width: 56ch; }
.page-hero { display: grid; gap: 18px; padding-block: 48px 40px; border-bottom: 1px solid var(--rule); }
/* Buttons */
@@ -126,40 +83,14 @@ main:focus { outline: none; }
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
-.btn-small { padding: 5px 12px; font-size: var(--step-0); }
+.btn-small { padding: 5px 12px; font-size: var(--ss-0); }
@media (forced-colors: active) { .btn { border: 1px solid ButtonText; } }
-/* Home */
-.hero { display: grid; gap: 22px; padding-block: 56px 44px; border-bottom: 1px solid var(--rule); }
-.hero-mark .wordmark { width: 100%; height: auto; color: var(--ink); }
-.hero-line { font-family: var(--mono); font-size: clamp(1.25rem, 0.9rem + 1.8vw, 2.25rem); line-height: 1.2; max-width: none; }
-.families { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); padding-inline: 0; }
-.fam { display: grid; gap: 16px; align-content: start; padding: 40px var(--gutter); min-width: 0; }
-.fam + .fam { border-left: 1px solid var(--rule); }
-.fam-head { display: grid; gap: 8px; }
-.fam h2 a { text-decoration: none; }
-.fam h2 a:hover { text-decoration: underline; text-decoration-color: var(--red); }
-.fam-sample { font-size: clamp(3.5rem, 2rem + 6vw, 7rem); line-height: 1; overflow-wrap: anywhere; }
-.fam-sample.sans { font-weight: 500; letter-spacing: -0.02em; }
-.fam-text { font-size: var(--step-2); }
-.fam-links { margin-top: 4px; }
-.fam-heddle { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
-.fam + .fam.fam-heddle { border-left: 0; }
-.fam-sample.heddle { font-variation-settings: "wght" 800, "wdth" 100; letter-spacing: 0; }
-@media (max-width: 760px) {
- .families { grid-template-columns: minmax(0, 1fr); }
- .fam + .fam { border-left: 0; border-top: 1px solid var(--rule); }
-}
-.pair { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; }
-@media (max-width: 760px) { .pair { grid-template-columns: minmax(0, 1fr); } }
-.pair-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
-.pair-sans { font-size: 1.125rem; line-height: 1.6; }
-.pair-code { margin: 0; font-size: 15px; line-height: 1.6; background: var(--panel); padding: 16px; border-radius: 2px; overflow-x: auto; }
-.pair-code code { font-size: inherit; }
-.facts { margin: 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--rule); }
-.facts li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
+/* Download facts */
+.dl-facts { margin: 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--rule); }
+.dl-facts li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.fact-k { font-weight: 600; }
-@media (max-width: 520px) { .facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
+@media (max-width: 520px) { .dl-facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
/* Weft playground */
.play { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
@@ -168,8 +99,8 @@ main:focus { outline: none; }
.field { display: grid; gap: 6px; }
.field[hidden], .axis-missing[hidden] { display: none; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
-.label { font-size: var(--step-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
-output { font-variant-numeric: tabular-nums; font-size: var(--step-0); color: var(--muted); }
+.label { font-size: var(--ss-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
+output { font-variant-numeric: tabular-nums; font-size: var(--ss-0); color: var(--muted); }
textarea {
width: 100%; resize: vertical; min-height: 92px; font: 0.9375rem/1.45 var(--mono); color: var(--ink);
background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 10px;
@@ -188,7 +119,7 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.chip[data-k="safe"] { color: var(--ink); background: var(--paper); }
.chip[data-k="head"] { color: var(--muted); }
.chip[data-k="title"] { color: var(--red); }
-.axis-missing { font-size: var(--step-0); color: var(--muted); border-left: 3px solid var(--rule); padding-left: 10px; }
+.axis-missing { font-size: var(--ss-0); color: var(--muted); border-left: 3px solid var(--rule); padding-left: 10px; }
.stage { min-width: 0; border: 1px solid var(--rule); border-radius: 2px; padding: 20px; min-height: 220px; overflow: hidden; }
.stage-text { font-size: 72px; line-height: 1.15; white-space: pre-wrap; overflow-wrap: anywhere; max-width: none; margin: 0; }
@@ -196,9 +127,9 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.stages { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 2px; }
.stages li { display: grid; gap: 2px; padding: 14px; min-width: 0; }
.stages li + li { border-left: 1px solid var(--rule); }
-.stage-range { font-family: var(--mono); font-size: var(--step-2); }
+.stage-range { font-family: var(--mono); font-size: var(--ss-2); }
.stage-name { font-weight: 600; }
-.stage-use { font-size: var(--step-0); color: var(--muted); }
+.stage-use { font-size: var(--ss-0); color: var(--muted); }
.stages li:nth-child(-n+2) .stage-use::after { content: " · safe"; color: var(--ink); font-weight: 600; }
@media (max-width: 700px) {
.stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@@ -209,15 +140,15 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.axis-rows[hidden] { display: none; }
.axis-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; padding-block: 8px; border-top: 1px solid var(--rule); }
.axis-row:first-child { border-top: 0; }
-.axis-row .v { font-family: var(--mono); font-size: var(--step-2); }
-.axis-row .s { display: block; font-size: var(--step-0); color: var(--muted); }
+.axis-row .v { font-family: var(--mono); font-size: var(--ss-2); }
+.axis-row .s { display: block; font-size: var(--ss-0); color: var(--muted); }
.axis-row .t { font-family: var(--mono); font-size: clamp(2rem, 1rem + 5vw, 4.5rem); line-height: 1.1; white-space: nowrap; overflow: hidden; }
@media (max-width: 560px) { .axis-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
/* Size specimen */
.sizes { margin: 0; padding: 0; list-style: none; display: grid; }
.sizes li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: baseline; padding-block: 10px; border-top: 1px solid var(--rule); }
-.size-k { font-family: var(--sans); font-size: var(--step-0); color: var(--muted); font-variant-numeric: tabular-nums; }
+.size-k { font-family: var(--sans); font-size: var(--ss-0); color: var(--muted); font-variant-numeric: tabular-nums; }
.size-v { line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: clip; min-width: 0; }
@media (max-width: 560px) {
.sizes li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
@@ -234,12 +165,12 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 80%;
}
@media (max-width: 840px) { .glyph-big { font-size: 112px; padding-inline: 12px; } }
-.glyph-meta { margin: 0; display: grid; gap: 6px; font-size: var(--step-0); }
+.glyph-meta { margin: 0; display: grid; gap: 6px; font-size: var(--ss-0); }
.glyph-meta div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; }
.glyph-meta dt { color: var(--muted); }
.glyph-meta dd { margin: 0; overflow-wrap: anywhere; }
.glyph-group + .glyph-group { margin-top: 18px; }
-.glyph-group h3 { font-size: var(--step-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
+.glyph-group h3 { font-size: var(--ss-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.glyph-grid button {
appearance: none; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
@@ -258,9 +189,9 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
/* Readability report */
.pending { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; color: var(--muted); max-width: 80ch; }
.cer-table { width: 100%; max-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
-.cer-table caption { text-align: left; font-size: var(--step-0); color: var(--muted); padding-bottom: 8px; }
+.cer-table caption { text-align: left; font-size: var(--ss-0); color: var(--muted); padding-bottom: 8px; }
.cer-table th, .cer-table td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
-.cer-table th { font-size: var(--step-0); font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
+.cer-table th { font-size: var(--ss-0); font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.cer-table td.num { font-family: var(--mono); white-space: nowrap; }
.cer-bar { height: 10px; background: var(--ink); min-width: 1px; border-radius: 1px; }
.cer-table tr.over .cer-bar { background: var(--red); }
@@ -274,7 +205,7 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.cards { grid-template-columns: minmax(0, 1fr); }
.card + .card { border-left: 0; border-top: 1px solid var(--rule); }
}
-.commits { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: var(--step-0); }
+.commits { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: var(--ss-0); }
.commits li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; }
.commits .sha { font-family: var(--mono); }
.commits .meta { grid-column: 2; color: var(--muted); }
@@ -287,14 +218,14 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.sans-copy { display: grid; gap: 18px; min-width: 0; }
.sans-l { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.sans-m { font-size: 1.125rem; line-height: 1.6; }
-.sans-s { font-size: var(--step-1); line-height: 1.6; overflow-wrap: anywhere; color: var(--muted); }
+.sans-s { font-size: var(--ss-1); line-height: 1.6; overflow-wrap: anywhere; color: var(--muted); }
.sans-italic { font-style: italic; }
.waterfalls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 840px) { .waterfalls { grid-template-columns: minmax(0, 1fr); } }
.waterfalls > div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.waterfall { margin: 0; padding: 0; list-style: none; }
.waterfall li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: baseline; padding-block: 6px; border-top: 1px solid var(--rule); }
-.wf-label { font-size: var(--step-0); color: var(--muted); font-variant-numeric: tabular-nums; }
+.wf-label { font-size: var(--ss-0); color: var(--muted); font-variant-numeric: tabular-nums; }
.wf-text { font-size: clamp(1.375rem, 1rem + 1.6vw, 2.125rem); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.forms { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.form-row { display: grid; gap: 8px; padding-block: 18px; border-bottom: 1px solid var(--rule); }
@@ -303,7 +234,7 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.form-sharp { font-feature-settings: "ss02" 1; }
.form-sharp.off { font-feature-settings: normal; }
.toggle { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; color: var(--ink); font-weight: 600; }
-.credit { font-size: var(--step-2); }
+.credit { font-size: var(--ss-2); }
.weft-title { font-family: var(--mono); font-weight: 400; letter-spacing: 0; }
.sans-title { font-family: var(--sans); }
@@ -313,8 +244,8 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.page-heddle .glyph-grid button, .page-heddle .glyph-big { font-family: var(--heddle); }
.rows { margin: 0; padding: 0; list-style: none; display: grid; }
.rows li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: baseline; padding-block: 8px; border-top: 1px solid var(--rule); }
-.row-k { font-size: var(--step-0); color: var(--muted); }
-.row-v { display: block; font-size: var(--step-2); color: var(--ink); font-variant-numeric: tabular-nums; }
+.row-k { font-size: var(--ss-0); color: var(--muted); }
+.row-v { display: block; font-size: var(--ss-2); color: var(--ink); font-variant-numeric: tabular-nums; }
.row-t { font-size: clamp(2.25rem, 1rem + 5.5vw, 5rem); line-height: 1.05; white-space: nowrap; overflow: hidden; min-width: 0; }
.rows-tight .row-t { font-size: clamp(1.75rem, 0.9rem + 3.6vw, 3.5rem); }
@media (max-width: 560px) { .rows li { grid-template-columns: minmax(0, 1fr); gap: 2px; } .row-v { display: inline; margin-right: 8px; } }
@@ -323,7 +254,7 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.parts li + li { border-left: 1px solid var(--rule); }
.part-glyph { font-size: clamp(4rem, 2rem + 6vw, 7.5rem); line-height: 1; font-variation-settings: "wght" 800, "wdth" 100; }
.part-name { font-weight: 600; }
-.part-text { font-size: var(--step-0); color: var(--muted); }
+.part-text { font-size: var(--ss-0); color: var(--muted); }
@media (max-width: 700px) {
.parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.parts li:nth-child(3) { border-left: 0; }
@@ -333,23 +264,16 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
/* Warp: a journal frontispiece, after the approved sketch page. Ivory
paper, hairline rules, small capitals, one deep ink blue. Set in Warp. */
-.page-warp {
- --paper: #F7F2E6;
- --panel: #EFE8D8;
- --ink: #1B1712;
- --muted: #6E6556;
- --rule: #D8CEBA;
- --accent: #1E3466;
-}
-@media (prefers-color-scheme: dark) {
- .page-warp {
- --paper: #15120E;
- --panel: #1D1914;
- --ink: #ECE4D2;
- --muted: #A39985;
- --rule: #3A332A;
- --accent: #AFBEE6;
- }
+.page-warp main {
+ --red: var(--accent);
+ --paper: #15120E;
+ --panel: #1D1914;
+ --ink: #ECE4D2;
+ --muted: #A39985;
+ --rule: #3A332A;
+ --accent: #AFBEE6;
+ background: var(--paper);
+ color: var(--ink);
}
.page-warp main { font-family: var(--warp); font-size: 1.0625rem; line-height: 1.5; }
.page-warp main h2, .page-warp main h3 { font-family: var(--warp-display); font-weight: 400; letter-spacing: 0; }
@@ -435,15 +359,11 @@ input[type=range] { width: 100%; accent-color: var(--red); margin: 4px 0; min-he
.page-warp .card h3 { font-family: var(--warp-display); }
.warp-cta { justify-items: center; text-align: center; }
.warp-dl-title { font-family: var(--warp-display); font-weight: 400; letter-spacing: 0; }
-.fam-sample.warp { font-family: var(--warp-display); letter-spacing: 0; }
-.fam-text.warp { font-family: var(--warp); font-style: italic; }
-.fam-warp { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
-.fam + .fam.fam-warp { border-left: 0; }
/* Specimen rows: a label and a sample, one per line */
.spec { margin: 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--rule); }
.spec li { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 8px 24px; align-items: baseline; padding-block: 12px; border-bottom: 1px solid var(--rule); }
-.spec-k { font-family: var(--sans); font-size: var(--step-0); color: var(--muted); }
+.spec-k { font-family: var(--sans); font-size: var(--ss-0); color: var(--muted); }
.spec-k code { display: block; font-family: var(--mono); }
.spec-v { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.spec-pre { margin: 0; background: none; padding: 0; overflow-x: auto; line-height: 1.2; }
@@ -463,12 +383,6 @@ math { font-family: var(--warp); }
.snippet pre code { font-size: inherit; }
.snippet .copy { position: absolute; top: 8px; right: 8px; margin: 0; }
-/* Footer */
-.site-foot { padding-block: 32px 40px; font-size: var(--step-0); color: var(--muted); }
-.site-foot-in { display: grid; gap: 12px; }
-.foot-mark { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
-.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
-
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
diff --git a/site/assets/system.css b/site/assets/system.css
new file mode 100644
index 0000000..3e8727d
--- /dev/null
+++ b/site/assets/system.css
@@ -0,0 +1,224 @@
+/* Copied unchanged from machine-made/machine-made.github.io, src/system.css at commit
+ f895aedbcab1a117cd9ba644ed428bca2843f7cf. Change it there first, then copy it here. */
+/* machine-made web system. One file for machine-made, openfluids, BoringQuantSystems and type.
+ A page sets only its house tokens (ground, surface, line, text, muted, accent) and its banner.
+
+ TYPE SCALE: ratio 1.25 (major third) on 1rem = 16 px. Every text style is one step.
+ step -1 0.8rem 12.8 px Weft meta: bar 1, bar 2 sections, section labels, plate facts, footer, table keys
+ step 0 1rem 16 px Sans reading text: captions, latest entries, table values, notes
+ step 1 1.25rem 20 px proposal page small headings only
+ step 2 1.5625rem 25 px bar-2 wordmark (type)
+ step 2-3 fluid 25 -> 31.25 px between 390 and 1280 px: the house line (--t-line)
+ step 3-5 fluid 31.25 -> 48.8 px between 390 and 1280 px: tester lines (--t-display)
+ step 4 2.441rem 39 px family tiles on the type site
+ SPACING: 4 8 12 16 24 32 48 64 96 px, nothing else.
+ GRID: 12 columns, 24 px gutter, 1200 px content at most, 16 px side margin on a phone.
+ ACCENT: four uses only. Bar 1 marker, bar 2 marker, section-label cell, link underline. */
+:root {
+ --step--1: 0.8rem;
+ --step-0: 1rem;
+ --step-1: 1.25rem;
+ --step-2: 1.5625rem;
+ --step-3: 1.953rem;
+ --step-4: 2.441rem;
+ --step-5: 3.052rem;
+ --t-line: clamp(1.5625rem, 1.391rem + 0.702vw, 1.953rem);
+ --t-display: clamp(1.953rem, 1.472rem + 1.975vw, 3.052rem);
+ --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
+ --side: var(--sp-4);
+ --gutter: var(--sp-5);
+ --max: 1200px;
+ --bar1: 40px;
+ --bar2: 64px;
+ --b1h: 41px; /* bar 1 plus its line: where bar 2 starts to stick */
+ --f-weft: "mm Weft", ui-monospace, monospace;
+ --f-sans: "mm Sans", system-ui, sans-serif;
+ --f-heddle: "mm Heddle", "mm Sans", system-ui, sans-serif;
+ --f-warp: "mm Warp", serif;
+ --ease: cubic-bezier(0.2, 0, 0, 1);
+}
+@media (min-width: 720px) { :root { --side: var(--sp-5); } }
+@media (min-width: 1100px) { :root { --side: var(--sp-6); } }
+
+*, *::before, *::after { box-sizing: border-box; }
+html { color-scheme: dark; background: var(--ground); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-padding-block-start: calc(var(--bar2) + var(--sp-4)); }
+body { margin: 0; min-height: 100dvh; background: var(--ground); color: var(--text); font: 400 var(--step-0)/1.5 var(--f-sans); }
+h1, h2, h3, p, ul, ol, figure { margin: 0; }
+ul, ol { padding: 0; list-style: none; }
+img { display: block; max-width: 100%; height: auto; }
+a { color: inherit; text-decoration: none; }
+:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
+.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--side)); margin-inline: auto; padding-left: max(var(--side), env(safe-area-inset-left)); padding-right: max(var(--side), env(safe-area-inset-right)); }
+.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
+.skip { position: absolute; top: calc(-1 * var(--sp-8)); left: var(--sp-4); z-index: 10; padding: var(--sp-2) var(--sp-4); background: var(--text); color: var(--ground); font: 400 var(--step--1)/1 var(--f-weft); }
+.skip:focus { top: var(--sp-2); }
+.n { font-family: var(--f-weft); font-variant-numeric: tabular-nums; font-feature-settings: "ss01" 1; }
+
+/* Bar 1: the four sites, same order and face everywhere. Scrolls away. On a phone it scrolls sideways. */
+.b1 { border-bottom: 1px solid var(--line); }
+.b1 ul { display: flex; align-items: center; gap: var(--sp-5); height: var(--bar1); font: 400 var(--step--1)/1 var(--f-weft); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
+.b1 ul::-webkit-scrollbar { display: none; }
+.b1 li { flex: none; height: 100%; }
+.b1 a, .b1 span { display: inline-flex; align-items: center; height: 100%; color: var(--muted); }
+@media (hover: hover) { .b1 a:hover { color: var(--text); } }
+.b1 [aria-current] { color: var(--text); text-decoration: underline 2px var(--accent); text-underline-offset: 6px; }
+
+/* Bar 2: logo left, sections right. Sticks to the top; its bottom line shows only after scrolling. */
+.b2 { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid transparent; }
+@media (prefers-reduced-motion: no-preference) {
+ @supports (animation-timeline: scroll()) {
+ .b2 { animation: b2-line linear both; animation-timeline: scroll(root); animation-range: var(--b1h) calc(var(--b1h) + 1px); }
+ @keyframes b2-line { to { border-bottom-color: var(--line); } }
+ }
+}
+.b2 .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); height: var(--bar2); }
+.logo { display: inline-flex; align-items: center; gap: var(--sp-3); flex: none; color: var(--text); }
+.logo img, .logo svg { width: 28px; height: 28px; border-radius: 4px; }
+.logo svg { fill: currentColor; border-radius: 0; }
+.logo .r { fill: var(--accent); }
+.wm { font: 650 var(--step-2)/1 var(--f-heddle); letter-spacing: -0.01em; font-stretch: 100%; }
+.secs { display: flex; align-items: center; gap: var(--sp-5); min-width: 0; font: 400 var(--step--1)/1 var(--f-weft); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
+.secs::-webkit-scrollbar { display: none; }
+.secs a { display: inline-flex; align-items: center; height: 44px; position: relative; flex: none; }
+@media (hover: hover) { .secs a:hover { color: var(--muted); } }
+.secs [aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: var(--sp-2); height: 2px; background: var(--accent); }
+@media (max-width: 719px) {
+ .b1 ul { flex-wrap: wrap; height: auto; column-gap: var(--sp-4); row-gap: 0; padding-block: var(--sp-1); overflow: visible; }
+ .b1 li { height: 44px; }
+ :root { --b1h: 97px; }
+ .logo { min-height: 44px; }
+ .secs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--sp-6)), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - var(--sp-6)), transparent); padding-right: var(--sp-6); }
+ .b2 .wrap { justify-content: flex-start; gap: var(--sp-4); }
+ .secs { gap: var(--sp-4); }
+}
+
+/* Banner: one rule for the three houses. 3:1 at every width; on a phone the empty 6 % at each side is cut. */
+.banner { margin-top: var(--sp-5); }
+.banner img { width: 100%; aspect-ratio: 1408 / 469; object-fit: cover; -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent); }
+@media (max-width: 719px) { .banner img { aspect-ratio: 1240 / 469; } }
+
+/* The house line: one size on all four sites. */
+.line { margin-top: var(--sp-6); max-width: 28em; font-weight: 400; font-size: var(--t-line); line-height: 1.25; text-wrap: pretty; hyphens: none; }
+@media (min-width: 720px) { .line { text-wrap: balance; } }
+.line.weft { font-family: var(--f-weft); }
+.line.heddle { font-family: var(--f-heddle); font-weight: 400; letter-spacing: -0.01em; }
+.line.warp { font-family: var(--f-warp); letter-spacing: -0.01em; }
+.nb { white-space: nowrap; }
+.warp { font-variant-numeric: oldstyle-nums proportional-nums; }
+.warp .sc { font-variant-caps: all-small-caps; letter-spacing: 0.04em; }
+.fit1 { white-space: nowrap; }
+@media (max-width: 519px) { .heddle.fit1, .wm { font-stretch: 80%; } }
+
+/* A row of the page grid: label in columns 1-3, content in columns 4-12. */
+.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
+.row.tight { margin-top: var(--sp-6); }
+.row > * { grid-column: 4 / 13; min-width: 0; }
+.row > .lbl { grid-column: 1 / 4; }
+.lbl { display: flex; align-items: center; align-self: start; gap: var(--sp-2); min-height: 20px; font: 400 var(--step--1)/1.4 var(--f-weft); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
+.mk { flex: none; width: 11px; height: 11px; }
+.mk .o { fill: var(--line); }
+.mk .on { fill: var(--accent); }
+@media (max-width: 859px) {
+ .row > *, .row > .lbl { grid-column: 1 / -1; }
+ .row > .lbl { margin-bottom: var(--sp-4); }
+}
+
+/* Plates: image 3:1, no inner padding, caption 8 px below, facts 4 px below the caption. */
+.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6) var(--gutter); }
+.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+@media (max-width: 999px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
+@media (min-width: 520px) { .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
+@media (max-width: 519px) { .grid, .grid.g2 { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); } }
+.plate { display: grid; align-content: start; min-width: 0; }
+.pic { display: block; border-radius: 2px; }
+.pic img, .tile { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 2px; outline: 1px solid var(--line); outline-offset: -1px; }
+.ds { margin-top: var(--sp-2); font: 400 var(--step-0)/1.4 var(--f-sans); color: var(--muted); text-wrap: pretty; }
+.facts { margin-top: var(--sp-1); font: 400 var(--step--1)/1.4 var(--f-weft); color: var(--muted); font-variant-numeric: tabular-nums; font-feature-settings: "ss01" 1; font-variation-settings: "FRAG" 0; }
+.facts { overflow: hidden; }
+.facts > span { display: inline-flex; flex-wrap: wrap; margin-left: calc(-1 * var(--sp-4)); }
+.facts > span > span { white-space: nowrap; }
+.facts > span > span::before { content: "\00b7"; display: inline-block; width: var(--sp-4); text-align: center; }
+a.u, .ds a { color: var(--text); text-decoration: underline 1px var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: from-font; }
+.ds a { display: inline-block; padding-block: var(--sp-3); margin-block: calc(-1 * var(--sp-3)); }
+@media (hover: hover) {
+ .plate:hover .pic img, .plate:hover .tile { filter: brightness(1.02); }
+ .plate:hover .facts { font-variation-settings: "FRAG" 40; }
+}
+.plate:focus-within .facts { font-variation-settings: "FRAG" 40; }
+@media (prefers-reduced-motion: no-preference) {
+ .pic img, .tile { transition: filter 240ms var(--ease); }
+ .facts { transition: font-variation-settings 240ms var(--ease); }
+}
+@media (prefers-reduced-motion: reduce) { .plate:focus-within .facts { font-variation-settings: "FRAG" 0; } }
+@media (hover: hover) and (prefers-reduced-motion: reduce) { .plate:hover .facts { font-variation-settings: "FRAG" 0; } }
+
+/* Latest: the three most recent releases. A row of cells on a wide screen, a list on a phone. */
+.latest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4) var(--gutter); }
+.latest.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
+.latest.n1 { grid-template-columns: minmax(0, 1fr); }
+.latest.n2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
+.latest.n1 li { grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: var(--sp-4); }
+.latest li { display: grid; gap: var(--sp-1); min-width: 0; }
+.latest a { justify-self: start; color: var(--text); text-decoration: underline 1px var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: from-font; }
+.latest .facts { margin-top: 0; }
+@media (max-width: 859px) { .latest.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
+@media (max-width: 519px) {
+ .latest, .latest.n1, .latest.n2, .latest.n4 { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
+ .latest li, .latest.n1 li { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--sp-4); padding-block: var(--sp-3); border-bottom: 1px solid var(--line); }
+ .latest a { padding-block: var(--sp-3); margin-block: calc(-1 * var(--sp-3)); }
+}
+
+/* Footer: one line, the four names. */
+footer { margin-top: var(--sp-8); padding-bottom: max(var(--sp-6), env(safe-area-inset-bottom)); }
+footer .fl { padding-top: var(--sp-4); border-top: 1px solid var(--line); overflow: hidden; }
+footer ul { display: flex; flex-wrap: wrap; align-items: center; margin-left: calc(-1 * var(--sp-6)); font: 400 var(--step--1)/1 var(--f-weft); color: var(--muted); }
+footer li { display: inline-flex; align-items: center; }
+footer li::before { content: "\00b7"; width: var(--sp-6); text-align: center; }
+footer a { display: inline-flex; align-items: center; min-height: 44px; }
+@media (hover: hover) { footer a:hover { color: var(--text); } }
+
+/* Type site: tester, family tiles, release table. Same grid as everything else. */
+.tester { display: grid; gap: 0; }
+.trow { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); padding-block: var(--sp-4); border-bottom: 1px solid var(--line); }
+.trow:first-child { padding-top: 0; }
+.tmeta { grid-column: 1 / 4; display: grid; align-content: start; gap: var(--sp-2); font: 400 var(--step--1)/1.4 var(--f-weft); color: var(--muted); }
+.tmeta b { font-weight: 400; color: var(--text); }
+.tline { grid-column: 4 / 13; min-width: 0; font-size: var(--t-display); line-height: 1.1; overflow-wrap: break-word; outline-offset: var(--sp-1); caret-color: var(--text); }
+.tline.weft { font-family: var(--f-weft); }
+.tline.sans { font-family: var(--f-sans); letter-spacing: -0.01em; }
+.tline.heddle { font-family: var(--f-heddle); letter-spacing: -0.01em; }
+.tline.warp { font-family: var(--f-warp); }
+.full .tline.weft { font-family: "mm Weft Full", var(--f-weft); }
+.full .tline.sans { font-family: "mm Sans Full", var(--f-sans); }
+.full .tline.heddle { font-family: "mm Heddle Full", var(--f-heddle); }
+.full .tline.warp { font-family: "mm Warp Full", var(--f-warp); }
+.tin { display: none; width: 100%; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--text); font: 400 var(--step-0)/1.5 var(--f-sans); }
+.tin::placeholder { color: var(--muted); }
+.js .tin { display: block; }
+.tester { grid-column: 1 / 13; margin-top: var(--sp-5); }
+.ctl { display: none; grid-template-columns: minmax(0, 1fr) 3.5em; align-items: center; gap: var(--sp-2); }
+.js .ctl { display: grid; }
+.ctl span { grid-column: 1 / -1; }
+.ctl input { width: 100%; margin: 0; accent-color: var(--text); }
+.ctl output { text-align: end; color: var(--text); }
+@media (max-width: 859px) {
+ .tmeta, .tline { grid-column: 1 / -1; }
+ .tmeta { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: var(--sp-3); }
+ .tmeta b { grid-column: 1 / -1; }
+}
+.tile { display: grid; align-items: center; justify-items: start; padding-inline: var(--sp-5); background: var(--surface); color: var(--text); overflow: hidden; white-space: nowrap; font-size: var(--step-4); line-height: 1; }
+.tile.weft { font-family: var(--f-weft); font-feature-settings: "ss01" 1; }
+.tile.sans { font-family: var(--f-sans); font-weight: 500; letter-spacing: -0.02em; }
+.tile.heddle { font-family: var(--f-heddle); font-weight: 700; }
+.tile.warp { font-family: var(--f-warp); }
+@media (max-width: 389px) { .tile { font-size: var(--step-3); } .heddle.fit1 { font-stretch: 70%; } }
+.table { border-top: 1px solid var(--line); }
+.table li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--sp-4); padding-block: var(--sp-3); border-bottom: 1px solid var(--line); }
+.table .k { font: 400 var(--step--1)/1.9 var(--f-weft); color: var(--muted); }
+.table p { max-width: 66ch; }
+.more { margin-top: var(--sp-5); }
+@media (max-width: 519px) { .table li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
+
+/* Not found: the same header, one line and a way back. */
+.nf { min-height: 50dvh; }
+.nf p + p { margin-top: var(--sp-4); }
diff --git a/site/assets/warp.js b/site/assets/warp.js
index 85cd41d..ce526d7 100644
--- a/site/assets/warp.js
+++ b/site/assets/warp.js
@@ -79,7 +79,7 @@
var grid = el("div", { "class": "glyph-grid", role: "group", "aria-labelledby": hid });
grp.chars.forEach(function (c) {
var b = el("button", { type: "button", "aria-pressed": "false",
- "aria-label": (c.n || hex(c.u)) + ", " + hex(c.u), title: hex(c.u) + " " + c.n },
+ "aria-label": String.fromCodePoint(c.u) + ", " + (c.n || hex(c.u)) + ", " + hex(c.u), title: hex(c.u) + " " + c.n },
String.fromCodePoint(c.u));
b.addEventListener("click", function () { show(b, c); });
grid.appendChild(b);
diff --git a/site/assets/weft.js b/site/assets/weft.js
index af93403..a4fa640 100644
--- a/site/assets/weft.js
+++ b/site/assets/weft.js
@@ -122,7 +122,7 @@
var grid = el("div", { "class": "glyph-grid", role: "group", "aria-labelledby": hid });
grp.chars.forEach(function (c) {
var b = el("button", { type: "button", "aria-pressed": "false",
- "aria-label": (c.n || hex(c.u)) + ", " + hex(c.u), title: hex(c.u) + " " + c.n },
+ "aria-label": String.fromCodePoint(c.u) + ", " + (c.n || hex(c.u)) + ", " + hex(c.u), title: hex(c.u) + " " + c.n },
String.fromCodePoint(c.u));
b.addEventListener("click", function () { show(b, c); });
grid.appendChild(b);
diff --git a/site/build.py b/site/build.py
index 0569c1c..7e933e7 100644
--- a/site/build.py
+++ b/site/build.py
@@ -1,8 +1,10 @@
"""Build the specimen and release site for machine-made/type.
Usage:
- python site/build.py # writes site/_site/
- python site/build.py --out DIR # writes DIR/
+ python site/build.py # writes site/_site/; reads the GitHub facts through gh
+ python site/build.py --out DIR # writes DIR/
+ python site/build.py --facts FILE # reads the facts from FILE instead of the GitHub API
+ python site/build.py --save-facts FILE # also writes the facts it read to FILE
The script:
@@ -16,11 +18,16 @@
4. Reads proofs/weft/readability.json (written by
weft/tools/readability.py). It stops with an error when the file is
missing or has no FRAG rows.
-5. Draws the "machine-made" wordmark and the favicon as SVG from the
- Weft outlines.
-6. Fills the page templates and writes the HTML.
-
-Needs Python 3.11+ and fontTools with brotli (for WOFF2).
+5. Reads the live facts from the GitHub API (home.py): the newest
+ release of each family and of each house, the release files, the
+ licence and the workflows. It stops with an error when a call fails,
+ so a page with stale facts is never written.
+6. Writes the home page and the 404 page in the design system of the
+ four sites (assets/system.css, home.py), and fills the family and
+ download pages into the same two bars and footer.
+
+Needs Python 3.11+, fontTools with brotli (for WOFF2), Pillow (for the
+images) and gh with a token (GH_TOKEN) for the facts.
"""
from __future__ import annotations
@@ -36,17 +43,15 @@
from pathlib import Path
from urllib.parse import quote
-from fontTools.pens.boundsPen import BoundsPen
-from fontTools.pens.recordingPen import DecomposingRecordingPen
-from fontTools.pens.svgPathPen import SVGPathPen
-from fontTools.pens.transformPen import TransformPen
from fontTools.ttLib import TTFont
+import home
+from home import BuildError
+
SITE = Path(__file__).resolve().parent
ROOT = SITE.parent
REPO_URL = "https://github.com/machine-made/type"
-ORG_URL = "https://github.com/machine-made"
RELEASE_VERSION = "0.2.0"
RELEASES = {fam: f"{REPO_URL}/releases/tag/{fam}-v{RELEASE_VERSION}"
for fam in ("weft", "sans", "heddle", "warp")}
@@ -113,15 +118,6 @@
READABILITY = ROOT / "proofs" / "weft" / "readability.json"
-# Weft metrics in font units (BRIEF.md): 1 design unit = 62.5 units.
-WEFT_UNIT = 62.5
-WEFT_X_HEIGHT = 500
-WORDMARK_WGHT = 700
-
-
-class BuildError(Exception):
- """A build step cannot continue."""
-
# ---------------------------------------------------------------------------
# Font selection
@@ -234,141 +230,6 @@ def inspect(path: Path) -> dict:
}
-# ---------------------------------------------------------------------------
-# Wordmark and favicon (SVG drawn from the Weft outlines)
-# ---------------------------------------------------------------------------
-
-def weft_for_wordmark(chosen: dict) -> TTFont:
- files = chosen["weft"]["files"]
- if "bold" in files:
- return TTFont(files["bold"])
- font = TTFont(files["vf"])
- axes = axes_of(font)
- if axes:
- from fontTools.varLib import instancer
- pins = {tag: v[1] for tag, v in axes.items()}
- if "wght" in axes:
- pins["wght"] = max(axes["wght"][0], min(axes["wght"][2], WORDMARK_WGHT))
- if "FRAG" in axes:
- pins["FRAG"] = 0
- font = instancer.instantiateVariableFont(font, pins)
- return font
-
-
-def contours(recording: list) -> list:
- """Split a recorded pen value into one list per contour."""
- out, cur = [], []
- for op, args in recording:
- cur.append((op, args))
- if op in ("closePath", "endPath"):
- out.append(cur)
- cur = []
- if cur:
- out.append(cur)
- return out
-
-
-def replay(ops: list, pen) -> None:
- for op, args in ops:
- getattr(pen, op)(*args)
-
-
-def contour_ymin(ops: list) -> float:
- ys = [pt[1] for _, args in ops for pt in args]
- return min(ys) if ys else 0
-
-
-def hyphen_ops(stroke_w: float) -> list:
- """Draw a hyphen from the loom stroke table when the font has none.
-
- Stroke table: open line (1.5, 4.6) to (5.5, 4.6), square caps, box
- offset 2.5. Phase 1 fonts have no hyphen glyph.
- """
- half = stroke_w / 2
- x0 = (2.5 + 1.5) * WEFT_UNIT - half
- x1 = (2.5 + 5.5) * WEFT_UNIT + half
- y0, y1 = 4.6 * WEFT_UNIT - half, 4.6 * WEFT_UNIT + half
- return [("moveTo", ((x0, y0),)), ("lineTo", ((x0, y1),)), ("lineTo", ((x1, y1),)),
- ("lineTo", ((x1, y0),)), ("closePath", ())]
-
-
-def stroke_width_units(font: TTFont) -> float:
- """Return the stem width of the font, measured from the 'l' stem."""
- gs = font.getGlyphSet()
- cmap = font.getBestCmap()
- name = cmap.get(ord("i"))
- if name is None:
- return 84
- rec = DecomposingRecordingPen(gs)
- gs[name].draw(rec)
- dots = [c for c in contours(rec.value) if contour_ymin(c) > WEFT_X_HEIGHT]
- if dots:
- bp = BoundsPen(gs)
- replay(dots[0], bp)
- if bp.bounds:
- return bp.bounds[2] - bp.bounds[0]
- return 84
-
-
-def wordmark_svg(font: TTFont, text: str = "machine-made", label: str = "machine-made") -> str:
- """Return an inline SVG of text in Weft. The dot of each i is red."""
- gs = font.getGlyphSet()
- cmap = font.getBestCmap()
- hmtx = font["hmtx"]
- ink, dots = SVGPathPen(gs), SVGPathPen(gs)
- bounds = BoundsPen(gs)
- sw = stroke_width_units(font)
- x = 0
- for ch in text:
- name = cmap.get(ord(ch))
- if name is None and ch == "-":
- ops, adv = hyphen_ops(sw), 750
- groups = [(ops, False)]
- elif name is None:
- raise BuildError(f"The Weft font has no glyph for {ch!r}; the wordmark needs it.")
- else:
- rec = DecomposingRecordingPen(gs)
- gs[name].draw(rec)
- adv = hmtx[name][0]
- groups = [(c, ch == "i" and contour_ymin(c) > WEFT_X_HEIGHT) for c in contours(rec.value)]
- for ops, is_dot in groups:
- # Flip y for SVG: font y goes up, SVG y goes down.
- target = dots if is_dot else ink
- replay(ops, TransformPen(target, (1, 0, 0, -1, x, 0)))
- replay(ops, TransformPen(bounds, (1, 0, 0, -1, x, 0)))
- x += adv
- x0, y0, x1, y1 = bounds.bounds
- pad = 0
- vb = f"{x0 - pad:.0f} {y0 - pad:.0f} {x1 - x0 + 2 * pad:.0f} {y1 - y0 + 2 * pad:.0f}"
- return (
- f''
- f' '
- f' '
- f" "
- )
-
-
-def favicon_svg(font: TTFont) -> str:
- """Return a favicon: the Weft i, white on black, with a red dot."""
- gs = font.getGlyphSet()
- name = font.getBestCmap()[ord("i")]
- rec = DecomposingRecordingPen(gs)
- gs[name].draw(rec)
- stem, dot = SVGPathPen(gs), SVGPathPen(gs)
- # Centre the 750-unit advance in a 1000-unit square; baseline at 820.
- tr = (1, 0, 0, -1, 125, 840)
- for c in contours(rec.value):
- replay(c, TransformPen(dot if contour_ymin(c) > WEFT_X_HEIGHT else stem, tr))
- return (
- ''
- ' '
- f' '
- f' '
- " \n"
- )
-
-
# ---------------------------------------------------------------------------
# Readability report and commit list
# ---------------------------------------------------------------------------
@@ -451,8 +312,9 @@ def commits(limit: int = 10) -> list:
# Templates
# ---------------------------------------------------------------------------
-PAGES = ["index.html", "weft/index.html", "sans/index.html", "heddle/index.html",
- "warp/index.html", "download/index.html", "404.html"]
+# The family and download pages, filled into templates/layout.html. The home page and the 404 page come from
+# home.py.
+PAGES = ["weft/index.html", "sans/index.html", "heddle/index.html", "warp/index.html", "download/index.html"]
TOKEN = re.compile(r"\{\{\s*([A-Z0-9_]+)\s*\}\}")
META = re.compile(r"\A\s*", re.S)
@@ -596,15 +458,19 @@ def swirl_tag(features: dict) -> str:
# Main
# ---------------------------------------------------------------------------
-def build(out: Path) -> None:
+def build(out: Path, facts_file: Path | None = None, save_facts: Path | None = None) -> None:
chosen = select_fonts()
report = readability()
+ facts = home.load_facts(facts_file) if facts_file else home.fetch_facts()
+ if save_facts:
+ save_facts.write_text(json.dumps(facts, indent=1, sort_keys=True) + "\n", encoding="utf-8")
if out.exists():
shutil.rmtree(out)
(out / "data").mkdir(parents=True)
# Copy the CSS, JS and images. The fonts go to fonts/ (below).
- shutil.copytree(SITE / "assets", out / "assets", ignore=shutil.ignore_patterns("fonts"))
+ # system.css goes into each page through home.system_css(), not as a file.
+ shutil.copytree(SITE / "assets", out / "assets", ignore=shutil.ignore_patterns("fonts", "system.css"))
# Fonts.
for fam, sel in chosen.items():
@@ -638,10 +504,8 @@ def build(out: Path) -> None:
(out / "data" / "readability.json").write_text(json.dumps(report, indent=1), encoding="utf-8")
(out / "assets" / "fonts.css").write_text(font_face_css(chosen, info), encoding="utf-8")
- mark_font = weft_for_wordmark(chosen)
- wordmark = wordmark_svg(mark_font)
- (out / "assets" / "favicon.svg").write_text(favicon_svg(mark_font), encoding="utf-8")
(out / ".nojekyll").write_text("", encoding="utf-8")
+ home.build_images(out)
weft_axes = info["weft"]["axes"]
sans_axes = info["sans"]["axes"]
@@ -650,7 +514,6 @@ def build(out: Path) -> None:
planned_w = FAMILIES["weft"]["planned_axes"]
values = {
"REPO_URL": REPO_URL,
- "ORG_URL": ORG_URL,
"WEFT_RELEASE": RELEASES["weft"],
"SANS_RELEASE": RELEASES["sans"],
"HEDDLE_RELEASE": RELEASES["heddle"],
@@ -673,7 +536,6 @@ def build(out: Path) -> None:
"HEDDLE_WDTH_RANGE": fmt_range(heddle_axes.get("wdth") or planned_sh["wdth"]),
"HEDDLE_WIDTH_ROWS": heddle_rows("wdth", heddle_widths, "Grotesk 1958", '"wght" 700'),
"HEDDLE_WEIGHT_ROWS": heddle_rows("wght", HEDDLE_WEIGHTS, "Hamburgefonstiv", '"wdth" 100'),
- "WORDMARK": wordmark,
"WEFT_VERSION": html.escape(short_version(info["weft"])),
"SANS_VERSION": html.escape(short_version(info["sans"])),
"WEFT_CHAR_COUNT": info["weft"]["char_count"],
@@ -689,33 +551,48 @@ def build(out: Path) -> None:
"SANS_FORMS_NOTE": "The default forms of machine-made Sans: straight a j p q r y. No feature is on.",
}
+ # The home page and the 404 page: the system pages, with font subsets and the tester.
+ axes = {fam: {"axes": [(t, int(v[0]), int(v[2])) for t, v in info[fam]["axes"].items()],
+ "statics": len(home.statics(facts["assets"][fam]))} for fam in chosen}
+ full = {fam: sel["files"]["vf"].name for fam, sel in chosen.items()}
+ pages = home.build_fonts(list(home.home_pages(facts, axes, full)),
+ {fam: sel["files"]["vf"] for fam, sel in chosen.items()}, out)
+ written = {"index.html": pages[0], "404.html": pages[1]}
+
layout = (SITE / "templates" / "layout.html").read_text(encoding="utf-8")
+ system = home.system_css()
for rel in PAGES:
src = (SITE / "pages" / rel).read_text(encoding="utf-8")
meta, body = page_meta(src)
- depth = rel.count("/")
- root = "../" * depth if depth else "./"
- nav = {f"NAV_{k}": ' aria-current="page"' if meta.get("nav") == k.lower() else ""
- for k in ("HOME", "WEFT", "SANS", "HEDDLE", "WARP", "DOWNLOAD")}
+ root = "../" * rel.count("/")
scripts = "".join(f''
for s in meta.get("scripts", "").split(",") if s.strip())
- # The 404 page can open at any depth, so it uses absolute paths.
- if rel == "404.html":
- root = "/type/"
- page_values = dict(values, ROOT=root, **nav,
+ page_values = dict(values, ROOT=root, SYSTEM=system, TOKENS=home.tokens(), GROUND=home.THEME["ground"],
+ BAR1=home.bar1(), BAR2=home.bar2(root, rel.split("/")[0] + "/"), FOOTER=home.footer(),
TITLE=meta.get("title", "machine-made fonts"),
DESCRIPTION=meta.get("description", ""),
BODY_CLASS=meta.get("class", ""),
SCRIPTS=scripts)
- # Preload the fonts that the first screen of the page uses.
+ # Preload the fonts that the first screen of the page uses: "warp" is the main file of a family,
+ # "warp.display" names one of its files (FAMILIES[...]["files"]).
+ hrefs = []
+ for entry in meta.get("preload", "sans").split(","):
+ fam, _, key = entry.strip().partition(".")
+ if fam not in chosen:
+ continue
+ if (key or "vf") not in chosen[fam]["files"]:
+ raise BuildError(f"{rel}: preload {entry.strip()!r} names no file of {fam}")
+ hrefs.append(f"fonts/{fam}/{url_path(chosen[fam]['files'][key or 'vf'].name)}")
page_values["PRELOAD"] = "".join(
- f' '
- for fam in meta.get("preload", "sans").split(",") if fam.strip() in info
+ f' ' for h in hrefs
)
page_values["BODY"] = render(body, page_values, rel)
+ written[rel] = render(layout, page_values, "layout.html")
+ home.check_pages(written)
+ for rel, text in written.items():
dest = out / rel
dest.parent.mkdir(parents=True, exist_ok=True)
- dest.write_text(render(layout, page_values, "layout.html"), encoding="utf-8")
+ dest.write_text(text, encoding="utf-8")
print(f"Built the site in {out}.")
for fam, sel in chosen.items():
@@ -728,9 +605,11 @@ def build(out: Path) -> None:
def main(argv: list[str]) -> int:
ap = argparse.ArgumentParser(description="Build the machine-made/type site.")
ap.add_argument("--out", type=Path, default=SITE / "_site", help="output folder (default: site/_site)")
+ ap.add_argument("--facts", type=Path, help="read the GitHub facts from this file instead of the API")
+ ap.add_argument("--save-facts", type=Path, help="also write the GitHub facts to this file")
args = ap.parse_args(argv)
try:
- build(args.out.resolve())
+ build(args.out.resolve(), args.facts, args.save_facts)
except BuildError as exc:
print(f"Error: {exc}", file=sys.stderr)
return 1
diff --git a/site/home.py b/site/home.py
new file mode 100644
index 0000000..0815e07
--- /dev/null
+++ b/site/home.py
@@ -0,0 +1,598 @@
+"""The home page, the 404 page and the shared parts of the type site, in the design system of the four sites.
+
+The style is assets/system.css, copied unchanged from machine-made/machine-made.github.io (its first line names the
+commit). Every page carries the same two bars and footer as the three house sites. The home page holds the type
+line, Latest (the newest release of each family), the tester, the families, the release table built from the
+release files, and the houses row (the newest release of each house).
+
+The facts come from the GitHub API through gh: fetch_facts() raises BuildError on any failure, so a page with stale
+facts is never written. The build checks what it writes: contrast, one h1 and heading order, banned words,
+homebrew-tap, Latest with no repeat, and font subsets that keep their axes and the features the style uses.
+"""
+
+from __future__ import annotations
+
+import datetime
+import html
+import io
+import json
+import re
+import subprocess
+from html.parser import HTMLParser
+from pathlib import Path
+from urllib.parse import quote
+
+SITE = Path(__file__).resolve().parent
+ROOT = SITE.parent
+TYPE_URL = "https://machine-made.github.io/type/"
+REPO = "machine-made/type"
+REPO_URL = f"https://github.com/{REPO}"
+LINE = "Four typefaces, made by code."
+TITLE = "machine-made type: Weft, Sans, Heddle and Warp"
+# Bar 1 and the footer: the three houses, then type.
+SITES = (
+ ("machine-made", "https://machine-made.github.io/"),
+ ("openfluids", "https://openfluids.github.io/"),
+ ("BoringQuantSystems", "https://boringquantsystems.github.io/"),
+ ("type", TYPE_URL),
+)
+ORGS = {"machine-made": "machine-made", "openfluids": "openfluids", "BoringQuantSystems": "BoringQuantSystems"}
+NEVER = {"homebrew-tap"}
+# The type site uses the machine-made palette.
+THEME = {"ground": "#0a0a0b", "surface": "#141416", "line": "#26262a", "text": "#ecebe6", "muted": "#8b8b90", "accent": "#e5251c"}
+PAIRS = (("text", "ground", 7.0), ("muted", "ground", 4.5), ("text", "surface", 7.0), ("muted", "surface", 4.5), ("accent", "ground", 3.0))
+SECTIONS = (("Weft", "weft/"), ("Sans", "sans/"), ("Heddle", "heddle/"), ("Warp", "warp/"), ("Download", "download/"))
+FAMILY_CSS = {
+ "weft": ('"mm Weft"', "font-weight:100 900"),
+ "sans": ('"mm Sans"', "font-weight:200 800"),
+ "heddle": ('"mm Heddle"', "font-weight:100 900;font-stretch:70% 140%"),
+ "warp": ('"mm Warp"', "font-weight:400"),
+}
+# family key, name, description, tile specimen
+FAMILIES = (
+ ("weft", "Weft", "a monospace on a grid, for code and tables", "Rg 0042"),
+ ("sans", "Sans", "a sans for long reading", "Rg Ka 0042"),
+ ("heddle", "Heddle", "a Swiss grotesk for posters and headlines", "Grotesk 1958"),
+ ("warp", "Warp", "a serif drawn by a pen, for papers and maths", "Warp αβγ ∂∫"),
+)
+# The tester: one slider per axis of each family (label, axis, min, max, start).
+CONTROLS = {
+ "weft": (("Weight", "wght", 100, 900, 400), ("FRAG", "FRAG", 0, 100, 0)),
+ "sans": (("Weight", "wght", 200, 800, 400),),
+ "heddle": (("Weight", "wght", 100, 900, 400), ("Width", "wdth", 70, 140, 100)),
+ "warp": (),
+}
+KEEP = "0123456789 ·–"
+USED_FEATURES = {"ss01", "tnum", "onum", "pnum", "smcp", "c2sc", "kern"}
+MONTHS = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split()
+BANNED = re.compile(r"\b(founder|brief|jac|card|session|codex)\b", re.I)
+PLATE_SIZES = "(min-width: 1264px) 282px, (min-width: 1000px) 22vw, (min-width: 520px) 46vw, calc(100vw - 32px)"
+HOUSE_BANNERS = {"machine-made": "machine-made", "openfluids": "openfluids", "BoringQuantSystems": "boringquantsystems"}
+BANNER_SIZE = (1408, 469)
+BANNER_WIDTHS = (704, 1408)
+MARK_SVG = (
+ '"
+ + "".join(f' ' for y in (0, 11, 22) for x in (0, 11, 22))
+ + " \n"
+)
+MK = (
+ ''
+ + "".join(f' ' for y in (0, 11, 22) for x in (0, 11, 22))
+ + " "
+)
+RED_CELL = ' class="r"'
+CURRENT = ' aria-current="page"'
+LOGO = (
+ ''
+ + "".join(f' ' for y in (0, 11, 22) for x in (0, 11, 22))
+ + " "
+)
+
+
+class BuildError(Exception):
+ """A build step cannot continue."""
+
+
+def esc(text: str) -> str:
+ return html.escape(text, quote=True)
+
+
+# ---------------------------------------------------------------------------
+# The facts
+# ---------------------------------------------------------------------------
+
+def gh(*args: str) -> str:
+ try:
+ done = subprocess.run(["gh", *args], capture_output=True, text=True, check=False, timeout=60)
+ except (OSError, subprocess.SubprocessError) as exc:
+ raise BuildError(f"gh {' '.join(args[:2])} could not run ({exc.__class__.__name__}); set GH_TOKEN and install gh.") from exc
+ if done.returncode != 0:
+ raise BuildError(f"gh {' '.join(args[:2])} failed: {done.stderr.strip()[:200]}")
+ return done.stdout
+
+
+RELEASE = "tagName publishedAt url isDraft isPrerelease"
+TYPE_RELEASES = (
+ 'releases(first:100{after}, orderBy:{{field:CREATED_AT, direction:DESC}})'
+ "{{pageInfo{{hasNextPage endCursor}} nodes{{" + RELEASE + "}}}}"
+)
+
+
+def graphql(query: str) -> dict:
+ try:
+ answer = json.loads(gh("api", "graphql", "-f", f"query={query}"))
+ except ValueError as exc:
+ raise BuildError("gh api graphql did not return JSON") from exc
+ if answer.get("errors") or not answer.get("data"):
+ raise BuildError("graphql errors: " + json.dumps(answer.get("errors"))[:200])
+ return answer["data"]
+
+
+def stable(r: dict | None) -> bool:
+ return bool(r) and not r.get("isDraft") and not r.get("isPrerelease") and bool(r.get("publishedAt"))
+
+
+def fetch_facts() -> dict:
+ """The live facts of the home page, from the GitHub API. Any failure stops the build."""
+ org_parts = [
+ f'o{i}: organization(login:"{login}"){{ description repositories(first:100, privacy:PUBLIC, isArchived:false)'
+ "{pageInfo{hasNextPage} nodes{name latestRelease{" + RELEASE + "} "
+ "releases(first:5, orderBy:{field:CREATED_AT, direction:DESC}){nodes{" + RELEASE + "}}}} }"
+ for i, login in enumerate(ORGS.values())
+ ]
+ data = graphql('query{ typerepo: repository(owner:"machine-made", name:"type"){ ' + TYPE_RELEASES.format(after="")
+ + " } " + " ".join(org_parts) + " }")
+ facts: dict = {"fetched": datetime.datetime.now(datetime.UTC).date().isoformat(), "families": {}, "houses": {}}
+ # Every page of type releases: the newest publication of each family wins, whatever the creation order.
+ page = data["typerepo"]["releases"]
+ nodes = list(page["nodes"])
+ while page["pageInfo"]["hasNextPage"]:
+ after = ', after:"' + page["pageInfo"]["endCursor"] + '"'
+ page = graphql('query{ typerepo: repository(owner:"machine-made", name:"type"){ '
+ + TYPE_RELEASES.format(after=after) + " } }")["typerepo"]["releases"]
+ nodes += page["nodes"]
+ for r in nodes:
+ fam = r["tagName"].split("-v")[0]
+ if fam in CONTROLS and stable(r) and (fam not in facts["families"] or r["publishedAt"] > facts["families"][fam]["publishedAt"]):
+ facts["families"][fam] = {k: r[k] for k in ("tagName", "publishedAt", "url")}
+ if set(facts["families"]) != set(CONTROLS):
+ raise BuildError(f"no release found for {sorted(set(CONTROLS) - set(facts['families']))}")
+ for i, name in enumerate(ORGS):
+ org = data[f"o{i}"]
+ if org["repositories"]["pageInfo"]["hasNextPage"]:
+ raise BuildError(f"{name} has more than 100 public repositories; read the next page before building")
+ newest = []
+ for repo in org["repositories"]["nodes"]:
+ if repo["name"] in NEVER:
+ continue
+ # The five newest releases may all be prereleases; the latest stable release still counts.
+ rels = [r for r in [*repo["releases"]["nodes"], repo["latestRelease"]] if stable(r)]
+ if rels:
+ r = max(rels, key=lambda x: x["publishedAt"])
+ newest.append((r["publishedAt"], repo["name"], r["tagName"]))
+ newest.sort(reverse=True)
+ facts["houses"][name] = {"line": org["description"] or "", "newest": newest[0] if newest else None}
+ facts["assets"] = {fam: gh("api", f"repos/{REPO}/releases/tags/{rel['tagName']}", "--jq", ".assets[].name").split()
+ for fam, rel in facts["families"].items()}
+ # The licences come from the checkout, like the workflows below.
+ licence = (ROOT / "LICENSE").read_text(encoding="utf-8")
+ facts["licence"] = "Apache-2.0" if "Apache License" in licence and "Version 2.0" in licence else "unknown"
+ facts["ofl"] = "SIL Open Font License 1.1" in (ROOT / "LICENSING.md").read_text(encoding="utf-8")
+ # The workflows come from the checkout: the site workflow may read contents only, not actions.
+ facts["workflows"] = {}
+ for fam in CONTROLS:
+ path = ROOT / ".github" / "workflows" / f"{fam}.yml"
+ if path.is_file():
+ body = path.read_text(encoding="utf-8")
+ facts["workflows"][fam] = {"build": "build" in body.lower(), "test": bool(re.search(r"pytest|\btests?\b", body))}
+ return facts
+
+
+def load_facts(path: Path) -> dict:
+ try:
+ facts = json.loads(path.read_text(encoding="utf-8"))
+ datetime.date.fromisoformat(facts["fetched"])
+ if set(facts["families"]) != set(CONTROLS) or set(facts["houses"]) != set(ORGS):
+ raise KeyError("families or houses")
+ except (OSError, ValueError, KeyError, TypeError) as exc:
+ raise BuildError(f"cannot read the facts file {path}: {exc}") from exc
+ return facts
+
+
+# ---------------------------------------------------------------------------
+# Parts
+# ---------------------------------------------------------------------------
+
+def date_text(iso: str, fetched: str) -> str:
+ d = datetime.date.fromisoformat(iso[:10])
+ return f"{d.day} {MONTHS[d.month - 1]}" + ("" if d.year == datetime.date.fromisoformat(fetched).year else f" {d.year}")
+
+
+def time_html(iso: str, fetched: str) -> str:
+ return f'{date_text(iso, fetched)} '
+
+
+def facts_html(parts: list[str]) -> str:
+ return '
' + "".join(f"{p} " for p in parts) + "
"
+
+
+def label(text: str, ident: str) -> str:
+ return f'{MK}{esc(text)} '
+
+
+def row(ident: str, text: str, inner: str, cls: str = "row") -> str:
+ return f'{label(text, ident)}{inner} '
+
+
+def bar1() -> str:
+ lis = "".join(
+ f'{esc(n)} ' if u == TYPE_URL else f'{esc(n)} '
+ for n, u in SITES
+ )
+ return f' '
+
+
+def bar2(root: str, current: str = "") -> str:
+ """The logo (the mark and the word type, a link home) and the sections. On the home page and the 404 page the
+ sections are full addresses, as in the approved page; on a family page the current one is marked."""
+ secs = "".join(
+ f'{name} '
+ for name, path in SECTIONS
+ )
+ secs += f'GitHub '
+ return (
+ f''
+ )
+
+
+def footer() -> str:
+ return '' + "".join(f'{esc(n)} ' for n, u in SITES) + " "
+
+
+def tokens() -> str:
+ return ":root{" + ";".join(f"--{k}:{v}" for k, v in THEME.items()) + "}"
+
+
+def system_css() -> str:
+ text = (SITE / "assets" / "system.css").read_text(encoding="utf-8")
+ if not re.match(r"/\* Copied unchanged from machine-made/machine-made\.github\.io, src/system\.css at commit\n [0-9a-f]{40}\.", text):
+ raise BuildError("assets/system.css must start with the comment that names its source commit.")
+ text = re.sub(r"/\*.*?\*/", "", text, flags=re.S)
+ return "\n".join(line.rstrip() for line in text.splitlines() if line.strip()) + "\n"
+
+
+def head(title: str, root: str, preload: str) -> str:
+ social = "".join(
+ f' '
+ for a, k, v in (
+ ("property", "og:type", "website"), ("property", "og:title", TITLE), ("property", "og:description", LINE),
+ ("property", "og:url", TYPE_URL), ("property", "og:image", f"{TYPE_URL}og.jpg"), ("property", "og:image:width", "1200"),
+ ("property", "og:image:height", "630"), ("property", "og:image:alt", "type"), ("name", "twitter:card", "summary_large_image"),
+ )
+ )
+ return (
+ '\n '
+ ' '
+ f'{esc(title)} '
+ f' '
+ f' '
+ f"{social}{preload}"
+ )
+
+
+def picture(root: str, stem: str, widths: tuple[int, int], size: tuple[int, int]) -> str:
+ avif = ", ".join(f"{root}img/{stem}-{w}.avif {w}w" for w in widths)
+ jpeg = ", ".join(f"{root}img/{stem}-{w}.jpg {w}w" for w in widths)
+ return (
+ f''
+ f' '
+ )
+
+
+def numword(n: int) -> str:
+ return "zero one two three four five six seven eight nine ten".split()[n] if n <= 10 else str(n)
+
+
+def statics(names: list[str]) -> list[str]:
+ out = []
+ for n in names:
+ m = re.match(r"MachineMade[A-Z][a-z]+(Display)?-([A-Za-z]+)\.woff2$", n)
+ if m:
+ out.append(("Display " if m.group(1) else "") + re.sub(r"(?<=[a-z])(?=[A-Z])", " ", m.group(2)))
+ order = ["Regular", "Italic", "Bold", "Bold Italic", "Display Regular", "Display Italic"]
+ return sorted(out, key=lambda s: order.index(s) if s in order else 99)
+
+
+def formats(names: list[str]) -> str:
+ ext = sorted({n.rsplit(".", 1)[1].upper() for n in names if n.endswith((".ttf", ".otf", ".woff2"))}, key=["TTF", "OTF", "WOFF2"].index)
+ return " and ".join([", ".join(ext[:-1]), ext[-1]] if len(ext) > 1 else ext)
+
+
+# ---------------------------------------------------------------------------
+# Pages
+# ---------------------------------------------------------------------------
+
+def latest(facts: dict) -> str:
+ items = sorted(((v["publishedAt"], k.capitalize(), v) for k, v in facts["families"].items()), key=lambda x: (x[0], x[1]), reverse=True)
+ if len({n for _, n, _ in items}) != len(items):
+ raise BuildError("Latest repeats a family.")
+ lis = "".join(
+ f'{esc(n)} {facts_html([esc(re.sub(r"^[a-z]+-(?=v)", "", r["tagName"])), time_html(r["publishedAt"], facts["fetched"])])} '
+ for _, n, r in items
+ )
+ return row("g-latest", "Latest", f'{lis} ', "row tight")
+
+
+def houses_row(facts: dict) -> str:
+ lis = []
+ for name, url in SITES[:3]:
+ house = facts["houses"][name]
+ if house["newest"]:
+ _, repo, tag = house["newest"][:3]
+ fx = facts_html([f"{esc(repo)} {esc(tag)}", time_html(house["newest"][0], facts["fetched"])])
+ else:
+ fx = facts_html(["unreleased"])
+ img = picture("", f"banner-{HOUSE_BANNERS[name]}", BANNER_WIDTHS, BANNER_SIZE)
+ lis.append(f'{img} {esc(house["line"])}
{fx} ')
+ return row("g-houses", "The houses", f'')
+
+
+def tester(axes: dict) -> str:
+ rows = []
+ for k, n, _, _ in FAMILIES:
+ cs = "".join(
+ f'{lab} {v} '
+ for lab, p, a, b, v in CONTROLS[k]
+ )
+ if not CONTROLS[k]:
+ cs = f"No weight axis: {numword(axes[k]['statics'])} static fonts "
+ rows.append(f'')
+ return (
+ f''
+ )
+
+
+def families(axes: dict) -> str:
+ tiles = []
+ for k, n, d, s in FAMILIES:
+ fx = [f"{t} {a}–{z}" for t, a, z in axes[k]["axes"]] or [f"{numword(axes[k]['statics']).capitalize()} static fonts"]
+ tiles.append(
+ f'{n} specimen: {esc(s)} '
+ f'{n}, {esc(d)}
{facts_html(fx)} '
+ )
+ return row("g-families", "Families", f'')
+
+
+def release(facts: dict, axes: dict) -> str:
+ versions = {facts["families"][k]["tagName"].split("-v")[1] for k, *_ in FAMILIES}
+ title = f"Release {versions.pop()}" if len(versions) == 1 else "Releases"
+ rows = []
+ if facts["licence"] == "Apache-2.0" and facts["ofl"]:
+ rows.append(("Licence", "Fonts: SIL Open Font License 1.1. Code: Apache-2.0."))
+ for k, n, *_ in FAMILIES:
+ names = facts["assets"][k]
+ st = statics(names)
+ parts = []
+ if axes[k]["axes"]:
+ ax = ", ".join(f"{t} {a}–{z}" for t, a, z in axes[k]["axes"])
+ parts.append(f"Variable ({ax})" + (", upright and italic" if any("Italic" in a for a in names) else ""))
+ if st:
+ parts.append("static " + " and ".join(st))
+ else:
+ parts.append(f"{numword(len(st)).capitalize()} static fonts: " + ", ".join(st))
+ rows.append((n, ". ".join(p[0].upper() + p[1:] for p in parts) + f". {formats(names)}."))
+ wf = facts["workflows"]
+ if all(wf.get(k, {}).get("build") for k, *_ in FAMILIES):
+ rows.append(("Built by", "CI, one workflow per family" + (", with its tests." if all(wf[k]["test"] for k, *_ in FAMILIES) else ".")))
+ items = "".join(f'{k} {esc(v)}
' for k, v in rows)
+ items += f'Source github.com/{REPO}
'
+ return row("g-release", title, f'')
+
+
+def script(full: dict) -> str:
+ """The tester: the field sets the four lines; a slider sets one axis. The page ships subsets; the full fonts load
+ once, the first time the visitor types."""
+ urls = json.dumps({k: f"fonts/{k}/{quote(v, safe='')}" for k, v in full.items()})
+ return (
+ ""
+ )
+
+
+def line_html(tag: str, extra: str = "") -> str:
+ t = re.sub(r"\b\w+(?:-\w+)+\b", lambda w: '' + w.group(0) + " ", esc(LINE))
+ return f'<{tag} class="line heddle{extra}">{t}{tag}>'
+
+
+def page(body: str, title: str, root: str, preload: str, faces: str, system: str, js: str = "", nf: bool = False) -> str:
+ return (
+ head(title, root, preload) + f"{js}\n"
+ f'Skip to content {bar1()}{bar2(root)}'
+ f'{body} {footer()}\n'
+ )
+
+
+def home_pages(facts: dict, axes: dict, full: dict) -> tuple[str, str]:
+ """The home page and the 404 page, with the @font-face rules left as a mark for build_fonts()."""
+ system = system_css()
+ body = line_html("h1", " fit1") + latest(facts) + tester(axes) + families(axes) + release(facts, axes) + houses_row(facts)
+ home = page(body, TITLE, "", "", "/*FACES*/", system, script(full))
+ nf_body = (
+ 'Not found This page does not exist.
'
+ 'Back to type
'
+ )
+ missing = page(nf_body, "Not found \u2013 type", "/type/", "", "/*FACES*/", system, nf=True)
+ return home, missing
+
+
+# ---------------------------------------------------------------------------
+# Fonts and images
+# ---------------------------------------------------------------------------
+
+class FaceText(HTMLParser):
+ VOID = {"img", "input", "br", "meta", "link", "source", "rect", "hr"}
+
+ def __init__(self, face: str) -> None:
+ super().__init__(convert_charrefs=True)
+ self.face, self.stack, self.out = face, [], set()
+
+ def handle_starttag(self, tag, attrs):
+ if tag not in self.VOID:
+ cls = (dict(attrs).get("class") or "").split()
+ self.stack.append(self.face in cls or (self.face == "heddle" and "wm" in cls))
+
+ def handle_endtag(self, tag):
+ if tag not in self.VOID and self.stack:
+ self.stack.pop()
+
+ def handle_data(self, data):
+ if any(self.stack):
+ self.out |= set(data)
+
+
+def strip_code(text: str) -> str:
+ return re.sub(r"<(script|style)[^>]*>.*?\1>", " ", text, flags=re.S)
+
+
+def visible_text(text: str) -> str:
+ text = strip_code(text)
+ text = re.sub(r'(?:aria-label|alt|placeholder|title|content)="([^"]*)"', lambda m: " " + m.group(1) + " ", text)
+ return html.unescape(re.sub(r"<[^>]+>", " ", text))
+
+
+def face_text(text: str, face: str) -> set[str]:
+ p = FaceText(face)
+ p.feed(strip_code(text))
+ return p.out
+
+
+def build_fonts(pages: list[str], sources: dict[str, Path], out: Path) -> list[str]:
+ """Cut one subset of each family for the home page and the 404 page (fonts/home/.woff2). Weft and Sans
+ keep the text of the pages and its capitals; Heddle and Warp keep the text set in them. Returns the pages with
+ their @font-face rules and the preload of Heddle, the face of the type line."""
+ from fontTools import subset as fts
+
+ text = "".join(visible_text(p) for p in pages) + KEEP
+ text = "".join(sorted(set(text + text.upper())))
+ (out / "fonts" / "home").mkdir(parents=True, exist_ok=True)
+ for fam, src in sources.items():
+ chars = text
+ if fam in ("heddle", "warp"):
+ keep = set(KEEP)
+ for p in pages:
+ keep |= face_text(p, fam)
+ chars = "".join(sorted(keep))
+ opts = fts.Options()
+ opts.flavor = "woff2"
+ opts.layout_features = ["*"]
+ opts.hinting = False
+ opts.desubroutinize = True
+ opts.name_IDs = ["*"]
+ font = fts.load_font(str(src), opts)
+ before = meta(font)
+ sub = fts.Subsetter(opts)
+ sub.populate(text=chars)
+ sub.subset(font)
+ after = meta(font)
+ lost = (before[1] & USED_FEATURES) - after[1]
+ if after[0] != before[0] or lost:
+ raise BuildError(f"the subset of {src.name} lost an axis or the features {sorted(lost)}")
+ fts.save_font(font, str(out / "fonts" / "home" / f"{fam}.woff2"), opts)
+ done = []
+ for p, root in zip(pages, ("", "/type/"), strict=True):
+ faces = "".join(
+ f'@font-face{{font-family:{FAMILY_CSS[f][0]};src:url({root}fonts/home/{f}.woff2) format("woff2");{FAMILY_CSS[f][1]};font-style:normal;font-display:swap}}'
+ for f in sources
+ )
+ preload = f' '
+ done.append(p.replace("/*FACES*/", faces, 1).replace("", preload, 1))
+ return done
+
+
+def meta(font) -> tuple[list, set]:
+ axes = [(a.axisTag, a.minValue, a.maxValue) for a in font["fvar"].axes] if "fvar" in font else []
+ feats = {r.FeatureTag for t in ("GSUB", "GPOS") if t in font for r in font[t].table.FeatureList.FeatureRecord}
+ return axes, feats
+
+
+def build_images(out: Path) -> None:
+ """The house banners of the houses row (AVIF and JPEG at 704 and 1408 px), the touch icon and the favicon."""
+ from PIL import Image, ImageDraw
+
+ (out / "img").mkdir(parents=True, exist_ok=True)
+ for stem in HOUSE_BANNERS.values():
+ src = SITE / "img" / f"banner-{stem}.jpg"
+ if not src.is_file():
+ raise BuildError(f"{src} is missing.")
+ im = Image.open(src).convert("RGB")
+ for w in BANNER_WIDTHS:
+ r = im if w == im.width else im.resize((w, round(im.height * w / im.width)), Image.LANCZOS)
+ r.save(out / "img" / f"banner-{stem}-{w}.avif", quality=62, speed=4)
+ r.save(out / "img" / f"banner-{stem}-{w}.jpg", quality=82, optimize=True, progressive=True)
+ big = 360
+ ground = tuple(int(THEME["ground"][i : i + 2], 16) for i in (1, 3, 5))
+ im = Image.new("RGB", (big, big), ground)
+ draw = ImageDraw.Draw(im)
+ pad, unit = big * 0.2, big * 0.6 / 30
+ for y in (0, 11, 22):
+ for x in (0, 11, 22):
+ colour = THEME["accent"] if (x, y) == (11, 11) else THEME["text"]
+ draw.rectangle([pad + x * unit, pad + y * unit, pad + (x + 8) * unit - 1, pad + (y + 8) * unit - 1], fill=colour)
+ buf = io.BytesIO()
+ im.resize((180, 180), Image.LANCZOS).save(buf, format="PNG", optimize=True)
+ (out / "assets" / "touch.png").write_bytes(buf.getvalue())
+ (out / "assets" / "mark.svg").write_text(MARK_SVG, encoding="utf-8")
+ og = SITE / "img" / "og.jpg"
+ if not og.is_file():
+ raise BuildError(f"{og} is missing.")
+ (out / "og.jpg").write_bytes(og.read_bytes())
+
+
+# ---------------------------------------------------------------------------
+# Checks
+# ---------------------------------------------------------------------------
+
+def luminance(colour: str) -> float:
+ c = [int(colour[i : i + 2], 16) / 255 for i in (1, 3, 5)]
+ c = [x / 12.92 if x <= 0.04045 else ((x + 0.055) / 1.055) ** 2.4 for x in c]
+ return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]
+
+
+def contrast(a: str, b: str) -> float:
+ la, lb = sorted((luminance(a), luminance(b)), reverse=True)
+ return (la + 0.05) / (lb + 0.05)
+
+
+def check_pages(pages: dict[str, str], own: tuple[str, ...] = ("index.html", "404.html")) -> None:
+ """Contrast, one h1, heading order and homebrew-tap on every page the build writes; banned words on the pages
+ whose text this module writes (own)."""
+ for fg, bg, floor in PAIRS:
+ if contrast(THEME[fg], THEME[bg]) < floor:
+ raise BuildError(f"{fg} on {bg} is {contrast(THEME[fg], THEME[bg]):.2f}, below {floor}")
+ for rel, text in pages.items():
+ if len(re.findall(r"]", text)) != 1:
+ raise BuildError(f"{rel} needs exactly one h1")
+ levels = [int(x) for x in re.findall(r"]", text)]
+ if levels[0] != 1 or any(b - a > 1 for a, b in zip(levels, levels[1:], strict=False)):
+ raise BuildError(f"{rel} skips a heading level: {levels}")
+ hit = BANNED.search(visible_text(text)) if rel in own else None
+ if hit:
+ raise BuildError(f"{rel} has the word {hit.group(0)!r}")
+ if "homebrew-tap" in text:
+ raise BuildError(f"{rel} names homebrew-tap, which is never listed")
diff --git a/site/img/banner-boringquantsystems.jpg b/site/img/banner-boringquantsystems.jpg
new file mode 100644
index 0000000..028694d
Binary files /dev/null and b/site/img/banner-boringquantsystems.jpg differ
diff --git a/site/img/banner-machine-made.jpg b/site/img/banner-machine-made.jpg
new file mode 100644
index 0000000..9208ae1
Binary files /dev/null and b/site/img/banner-machine-made.jpg differ
diff --git a/site/img/banner-openfluids.jpg b/site/img/banner-openfluids.jpg
new file mode 100644
index 0000000..514c2da
Binary files /dev/null and b/site/img/banner-openfluids.jpg differ
diff --git a/site/img/og.jpg b/site/img/og.jpg
new file mode 100644
index 0000000..924d097
Binary files /dev/null and b/site/img/og.jpg differ
diff --git a/site/pages/404.html b/site/pages/404.html
deleted file mode 100644
index c7ac19e..0000000
--- a/site/pages/404.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- Error 404
- Page not found
- This page does not exist. Go to the home page , Weft or Sans .
-
diff --git a/site/pages/download/index.html b/site/pages/download/index.html
index 4faee97..d15a1d5 100644
--- a/site/pages/download/index.html
+++ b/site/pages/download/index.html
@@ -191,7 +191,7 @@ npm package coming
Licence
Free to use, change and share
-
+
Fonts SIL Open Font License 1.1 . Use them in any project, also commercial ones. You can embed them in apps, documents and websites. If you change a font, give it a new name: "machine-made" is a Reserved Font Name. You cannot sell the fonts alone.
Code Apache License 2.0 . This covers the generator, the tools, the tests, the CI and this site.
Sans base machine-made Sans is based on Plus Jakarta Sans by Gumpita Rahayu, Tokotype (SIL OFL 1.1).
diff --git a/site/pages/index.html b/site/pages/index.html
deleted file mode 100644
index 396d498..0000000
--- a/site/pages/index.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
- machine-made/type · release {{RELEASE_VERSION}}
- machine-made fonts
- {{WORDMARK}}
- Human vision. Machine-made.
- Four typeface families, built and checked by code. Free to use under the SIL Open Font License.
-
-
-
-
-
- Rg 0042
- Proven for machines
- A monospace set on a 12-unit grid by a generator called the loom. One axis sets the weight. A second axis, FRAG, takes it from clean strokes to broken pieces. 0.2 adds Central European Latin, a dotted zero, redrawn look-alikes and box drawing.
- See Weft Get Weft {{RELEASE_VERSION}}
-
-
-
- Rg Ka 0042
- Every result is checked by another machine.
- A reading sans based on Plus Jakarta Sans. Straight forms are the default, and the sharp forms are one stylistic set away, so it sits next to Weft. 0.2 adds Cyrillic to the italic.
- See Sans Get Sans {{RELEASE_VERSION}}
-
-
-
- Grotesk 1958
- A Swiss display grotesk for posters, headlines and big figures. Every letter is built from four parts and level cuts. A width axis runs from Compressed to Extended. 0.2 adds Central European Latin and fractions.
- See Heddle Get Heddle {{RELEASE_VERSION}}
-
-
-
- Modern serif · Regular, Italic, Bold, Bold Italic · Display
-
-
- Warp αβγ ∂∫
- Drawn by a pen, for papers and maths.
- A Modern serif with vertical stress. Every letter is a few centre-lines swept by one level pen. Full basic Greek, small capitals and old-style figures. 0.2 adds an OpenType MATH table, so a browser or LaTeX can set formulas with it, and Central European Latin.
- See Warp Get Warp {{RELEASE_VERSION}}
-
-
-
-
-
-
Together
-
One for code, one for reading
-
-
-
-
Sans · 18 px · 400
-
Run the loom and it writes every outline from a table of strokes. Fontmake compiles the result, and the checks run on every pull request. A person reviews the proof by eye before a release.
-
-
-
Weft · 15 px · 400
-
python -m pytest -q
-scripts/build.sh
-scripts/check.sh fontspector
-python tools/proof.py
-
-
-
-
-
-
-
Release {{RELEASE_VERSION}}
-
What is in this release
-
-
- Licence Fonts: SIL OFL 1.1. Code: Apache-2.0.
- Weft Variable font (wght and FRAG), static Regular and Bold. TTF and WOFF2. What is new
- Sans Variable font (wght), upright and italic. TTF, OTF and WOFF2. What is new
- Heddle Variable font (wght and wdth), 11 static weights and widths. TTF and WOFF2. What is new
- Warp Six static fonts: Regular, Italic, Bold, Bold Italic for text, and Display Regular and Italic. TTF, OTF and WOFF2. What is new
- Made by Agents write the code and the commits. CI builds and checks the fonts.
- Source github.com/machine-made/type
-
- Download and install
-
diff --git a/site/pages/warp/index.html b/site/pages/warp/index.html
index 3d33679..30fe69e 100644
--- a/site/pages/warp/index.html
+++ b/site/pages/warp/index.html
@@ -3,7 +3,7 @@
description: machine-made Warp 0.2. A Modern serif for papers and maths, drawn by a pen model in code: Regular, Italic, Bold, Bold Italic and Display. An OpenType MATH table, Central European Latin, Greek, small capitals, old-style figures. Free under the SIL Open Font License.
nav: warp
class: page-warp
-preload: warp
+preload: warp,warp.display,warp.displayitalic
scripts: warp.js
-->
diff --git a/site/requirements.txt b/site/requirements.txt
index aebd144..403e3f8 100644
--- a/site/requirements.txt
+++ b/site/requirements.txt
@@ -1,3 +1,4 @@
-# Python packages for site/build.py. brotli writes and reads WOFF2.
+# Python packages for site/build.py. brotli writes and reads WOFF2; Pillow writes the images.
fonttools==4.68.0
brotli==1.2.1
+pillow==13.0.0
diff --git a/site/shots.py b/site/shots.py
new file mode 100644
index 0000000..ac223c8
--- /dev/null
+++ b/site/shots.py
@@ -0,0 +1,179 @@
+"""Browser check of the built site, by hand before a merge (CI builds the site but does not run a browser).
+
+ uv run --with playwright==1.65.1 python3 site/shots.py [--site site/_site] [--out DIR] [--chrome PATH] [--axe FILE]
+
+Serves the built site at /type/, as GitHub Pages does, with 404.html for a missing path. For every page, at 320, 360, 390,
+1280 and 1920 px: no sideways scroll and no element past the right edge outside a scrolling or clipping box, one h1
+and no skipped heading level, every image loaded, no request outside the site. At 390 px, every link in the two bars
+and the footer is at least 44 px high. On the home page and the 404 page: no text drawn in a system font. With --axe
+(axe-core's axe.min.js), axe runs at 1280 px on every page and every violation fails. Writes -390.png,
+-1280.png and report.json to --out. Exits 1 on any problem.
+"""
+
+from __future__ import annotations
+
+import argparse
+import functools
+import http.server
+import json
+import shutil
+import sys
+import tempfile
+import threading
+from itertools import pairwise
+from pathlib import Path
+from typing import Any
+
+from playwright.sync_api import BrowserContext, Page, sync_playwright
+
+PAGES = {"home": "", "weft": "weft/", "sans": "sans/", "heddle": "heddle/", "warp": "warp/", "download": "download/", "404": "no/such/page"}
+WIDTHS = (320, 360, 390, 1280, 1920)
+SHOTS = (390, 1280)
+SCROLL_ALL = "async () => { for (let y = 0; y < document.body.scrollHeight; y += innerHeight / 2) { scrollTo(0, y); await new Promise(r => setTimeout(r, 60)); } scrollTo(0, 0); }"
+BYTES = """() => { const t = {font: 0, image: 0};
+ for (const e of performance.getEntriesByType('resource')) {
+ if (/\\.woff2$/.test(e.name)) t.font += e.encodedBodySize; else if (/\\.(avif|jpg|png|svg)$/.test(e.name)) t.image += e.encodedBodySize; }
+ return t; }"""
+PROBE = """() => {
+ const W = document.documentElement.clientWidth, past = [];
+ const clipped = el => { for (let p = el.parentElement; p; p = p.parentElement) {
+ const s = getComputedStyle(p); if (/(auto|scroll|hidden|clip)/.test(s.overflowX)) return true; } return false; };
+ for (const el of document.body.querySelectorAll('*')) {
+ const r = el.getBoundingClientRect();
+ if (r.width && r.right > W + 0.5 && !clipped(el) && !el.closest('.skip, .vh, .visually-hidden')) past.push(el.tagName + '.' + el.className + ' ' + Math.round(r.right));
+ }
+ const links = [...document.querySelectorAll('.b1 a, .b1 [aria-current], .secs a, .logo, footer a')]
+ .map(a => [a.textContent.trim() || a.className, a.getBoundingClientRect().height]);
+ return {scroll: document.documentElement.scrollWidth, width: innerWidth, past: past.slice(0, 6),
+ levels: [...document.querySelectorAll('h1,h2,h3,h4,h5,h6')].map(h => +h.tagName[1]),
+ images: [...document.images].every(i => i.complete && i.naturalWidth > 0), links,
+ dark: getComputedStyle(document.body).backgroundColor};
+}"""
+
+
+class Pages(http.server.SimpleHTTPRequestHandler):
+ """GitHub Pages: a missing path gets /type/404.html with status 404."""
+
+ def log_message(self, *args: object) -> None:
+ pass
+
+ def send_error(self, code: int, message: str | None = None, explain: str | None = None) -> None:
+ page = Path(self.directory) / "type" / "404.html"
+ if code != 404 or not page.is_file():
+ super().send_error(code, message, explain)
+ return
+ body = page.read_bytes()
+ self.send_response(404)
+ self.send_header("Content-Type", "text/html; charset=utf-8")
+ self.send_header("Content-Length", str(len(body)))
+ self.end_headers()
+ self.wfile.write(body)
+
+
+def system_fonts(context: BrowserContext, page: Page) -> list[str]:
+ """Every text node drawn, even in part, in a font that is not a web font of the page."""
+ cdp = context.new_cdp_session(page)
+ cdp.send("DOM.enable")
+ cdp.send("CSS.enable")
+ root = cdp.send("DOM.getDocument", {"depth": -1, "pierce": False})["root"]
+ bad: list[str] = []
+
+ def walk(node: dict[str, Any]) -> None:
+ if node.get("nodeName") in ("SCRIPT", "STYLE", "HEAD", "TITLE", "NOSCRIPT"):
+ return
+ kids = node.get("children", [])
+ if any(c.get("nodeType") == 3 and c.get("nodeValue", "").strip() for c in kids):
+ fonts = cdp.send("CSS.getPlatformFontsForNode", {"nodeId": node["nodeId"]})["fonts"]
+ text = "".join(c.get("nodeValue", "") for c in kids if c.get("nodeType") == 3).strip()
+ bad.extend(f'{f["familyName"]} x{f["glyphCount"]} in "{text[:30]}"' for f in fonts if not f.get("isCustomFont"))
+ for c in kids:
+ walk(c)
+
+ walk(root)
+ cdp.detach()
+ return bad
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
+ ap.add_argument("--site", type=Path, default=Path(__file__).resolve().parent / "_site")
+ ap.add_argument("--out", type=Path, default=Path("shots"))
+ ap.add_argument("--chrome", default=None)
+ ap.add_argument("--axe", type=Path, default=None)
+ args = ap.parse_args()
+ args.out.mkdir(parents=True, exist_ok=True)
+ axe = args.axe.read_text(encoding="utf-8") if args.axe else None
+ top = Path(tempfile.mkdtemp())
+ (top / "type").symlink_to(args.site.resolve())
+ server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), functools.partial(Pages, directory=str(top)))
+ threading.Thread(target=server.serve_forever, daemon=True).start()
+ base = f"http://127.0.0.1:{server.server_address[1]}/type/"
+ report, problems = [], []
+ try:
+ with sync_playwright() as pw:
+ launch = {"executable_path": args.chrome, "args": ["--no-sandbox"]} if args.chrome else {}
+ browser = pw.chromium.launch(**launch)
+ for name, path in PAGES.items():
+ for width in WIDTHS:
+ ctx = browser.new_context(viewport={"width": width, "height": 900}, color_scheme="dark", device_scale_factor=1)
+ page = ctx.new_page()
+ outside: list[str] = []
+ page.on("request", lambda req, outside=outside: req.url.startswith(base) or req.url.startswith("data:") or outside.append(req.url))
+ answer = page.goto(base + path, wait_until="networkidle")
+ page.evaluate("document.fonts.ready")
+ page.evaluate(SCROLL_ALL)
+ page.wait_for_load_state("networkidle")
+ page.wait_for_timeout(200)
+ p = page.evaluate(PROBE)
+ tag = f"{name} {width}"
+ entry = {"page": name, "width": width, "status": answer.status if answer else None, "scroll": p["scroll"], "dark": p["dark"]}
+ if (name == "404") != (entry["status"] == 404):
+ problems.append(f"{tag}: status {entry['status']}")
+ if p["scroll"] > p["width"]:
+ problems.append(f"{tag}: scrolls sideways ({p['scroll']} > {p['width']})")
+ if p["past"]:
+ problems.append(f"{tag}: past the right edge: {p['past']}")
+ lv = p["levels"]
+ if lv.count(1) != 1 or lv[0] != 1 or any(b - a > 1 for a, b in pairwise(lv)):
+ problems.append(f"{tag}: headings {lv}")
+ if not p["images"]:
+ problems.append(f"{tag}: an image failed to load")
+ if outside:
+ problems.append(f"{tag}: requests outside the site: {outside[:3]}")
+ if width == 390:
+ short = [(t, round(h, 1)) for t, h in p["links"] if h < 44]
+ if short:
+ problems.append(f"{tag}: links below 44 px: {short}")
+ if width in SHOTS:
+ shot = args.out / f"{name}-{width}.png"
+ page.screenshot(path=str(shot), full_page=True)
+ entry["shot"] = str(shot)
+ entry["bytes"] = page.evaluate(BYTES)
+ if name in ("home", "404"):
+ misses = system_fonts(ctx, page)
+ entry["system_fonts"] = misses
+ if misses:
+ problems.append(f"{tag}: text in a system font: {misses[:4]}")
+ if width == 1280 and axe:
+ page.add_script_tag(content=axe)
+ found = page.evaluate("async () => (await axe.run(document, {resultTypes: ['violations']})).violations.map(v => [v.id, v.nodes.length])")
+ entry["axe"] = found
+ if found:
+ problems.append(f"{tag}: axe {found}")
+ report.append(entry)
+ ctx.close()
+ browser.close()
+ finally:
+ server.shutdown()
+ shutil.rmtree(top)
+ (args.out / "report.json").write_text(json.dumps(report, indent=1) + "\n", encoding="utf-8")
+ for line in problems:
+ print(line, file=sys.stderr)
+ if problems:
+ return 1
+ print(f"SHOTS OK ({len(report)} renders)")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/site/templates/layout.html b/site/templates/layout.html
index 8a6c837..dd313d2 100644
--- a/site/templates/layout.html
+++ b/site/templates/layout.html
@@ -2,60 +2,30 @@
-
+
{{TITLE}}
-
-
-
+
+
-
+
+
{{PRELOAD}}
+
+
{{SCRIPTS}}
Skip to content
-
-
-
-
+{{BAR1}}
+{{BAR2}}
{{BODY}}
-
+{{FOOTER}}