Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(fonts): preload the webfonts and swap them in over metric-matched fallbacks so text stops reflowing

nirholas6405983b4558
diff --git a/chat/index.html b/chat/index.html
index f401e9ce2..dd6406929 100644
--- a/chat/index.html
+++ b/chat/index.html
@@ -28,6 +28,8 @@
<meta name="twitter:description" content="Talk to your agent: voice, text, and real tool use in one interface, with 3D generation inline in the thread." />
<meta name="twitter:image" content="https://three.ws/api/page-og?s=agent-tools&amp;t=Chat&amp;d=Talk+to+your+agent.+Voice%2C+text%2C+and+tool-use+in+one+interface.&amp;p=%2Fchat" />
+ <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
+ <link rel="preload" href="/fonts/space-grotesk-latin.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="/fonts/fonts.css" />
<link
rel="stylesheet"
diff --git a/docs/index.html b/docs/index.html
index 4fa02bdac..b8f751bb5 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -22,6 +22,8 @@
<meta name="twitter:description" content="Full documentation: SDKs, API reference, embedding, agent system, smart contracts." />
<meta name="twitter:image" content="https://three.ws/api/page-og?s=learn&amp;t=Docs&amp;d=Full+documentation%3A+SDKs%2C+API+reference%2C+embedding%2C+agent+system%2C+smart+contracts.&amp;p=%2Fdocs" />
<link rel="icon" href="/favicon.ico" />
+ <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
+ <link rel="preload" href="/fonts/space-grotesk-latin.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="/fonts/fonts.css" />
<link rel="stylesheet" href="/style.css" />
<link
diff --git a/pages/create.html b/pages/create.html
index c894904d9..3d5796129 100644
--- a/pages/create.html
+++ b/pages/create.html
@@ -1060,6 +1060,8 @@
}
}
</style>
+ <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
+ <link rel="preload" href="/fonts/space-grotesk-latin.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/footer.css" />
<link rel="stylesheet" href="/mobile.css" />
diff --git a/pages/forge.html b/pages/forge.html
index ea401e5d0..617889c50 100644
--- a/pages/forge.html
+++ b/pages/forge.html
@@ -35,6 +35,10 @@
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.webmanifest" />
+ <!-- style.css reaches fonts.css through two @import hops; without a
+ preload the fonts are discovered late and every swap reflows the page. -->
+ <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
+ <link rel="preload" href="/fonts/space-grotesk-latin.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="/style.css" />
<link rel="preconnect" href="https://ajax.googleapis.com" />
<!-- Deferred, and placed BEFORE the model-viewer module: defer scripts and
diff --git a/pages/marketplace.html b/pages/marketplace.html
index 45895c99b..61f197107 100644
--- a/pages/marketplace.html
+++ b/pages/marketplace.html
@@ -24,6 +24,8 @@
<!-- Agent cards mount model-viewer (4.0.0) lazily from this CDN; warm the
connection so the handshake is paid before the bundle is requested. -->
<link rel="preconnect" href="https://ajax.googleapis.com" crossorigin />
+ <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
+ <link rel="preload" href="/fonts/space-grotesk-latin.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/footer.css" />
<link rel="stylesheet" href="/marketplace.css" />
diff --git a/public/discover/index.html b/public/discover/index.html
index cd1af37c3..7f7441b8f 100644
--- a/public/discover/index.html
+++ b/public/discover/index.html
@@ -28,6 +28,8 @@
data-i18n-attr="content:discover_index.meta_twitter_description"/>
<meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Discover&amp;d=On-chain+agent+directory+%28ERC-8004+%2B+Solana%29.+Browse%2C+search%2C+and+inspect+every+registered+agent.&amp;p=%2Fdiscover" />
<link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
+ <link rel="preload" href="/fonts/space-grotesk-latin.woff2" as="font" type="font/woff2" crossorigin />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/public/fonts/fonts.css b/public/fonts/fonts.css
index bf1947700..d2f583f31 100644
--- a/public/fonts/fonts.css
+++ b/public/fonts/fonts.css
@@ -58,3 +58,37 @@
src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
+
+/* Metric-compatible fallbacks. Until a webfont arrives, text renders in the
+ local fallback scaled to the webfont's average advance width and vertical
+ metrics, so the swap changes glyph shapes but not line breaks or box heights.
+ Without them the swap reflowed every page: Lighthouse traced /forge's 0.28
+ CLS to the Inter and Space Grotesk swaps alone. Overrides derived from
+ @capsizecss/metrics 3.5.0 with the same formula next/font uses:
+ size-adjust = xWidthAvg(web) / xWidthAvg(local), each vertical override =
+ metric / unitsPerEm / size-adjust. Referenced from the font stacks in
+ tokens.css; a system without the local face skips straight to system-ui. */
+@font-face {
+ font-family: 'Inter Fallback';
+ src: local('Arial');
+ size-adjust: 107.12%;
+ ascent-override: 90.44%;
+ descent-override: 22.52%;
+ line-gap-override: 0%;
+}
+@font-face {
+ font-family: 'Space Grotesk Fallback';
+ src: local('Arial');
+ size-adjust: 109.69%;
+ ascent-override: 89.71%;
+ descent-override: 26.62%;
+ line-gap-override: 0%;
+}
+@font-face {
+ font-family: 'JetBrains Mono Fallback';
+ src: local('Courier New');
+ size-adjust: 99.98%;
+ ascent-override: 102.02%;
+ descent-override: 30%;
+ line-gap-override: 0%;
+}
diff --git a/public/tokens.css b/public/tokens.css
index 994e23fcf..f2e556087 100644
--- a/public/tokens.css
+++ b/public/tokens.css
@@ -133,9 +133,9 @@
--header-h: 3.5rem;
/* Font stacks — families are self-hosted in /fonts/fonts.css */
- --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
- --font-body: 'Inter', system-ui, sans-serif;
- --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
+ --font-display: 'Space Grotesk', 'Space Grotesk Fallback', 'Inter', system-ui, sans-serif;
+ --font-body: 'Inter', 'Inter Fallback', system-ui, sans-serif;
+ --font-mono: 'JetBrains Mono', 'JetBrains Mono Fallback', 'SF Mono', 'Fira Code', ui-monospace, monospace;
/* Accent */
--accent: #ffffff;