stnd.build

@stnd/fonts

Circle 2 — Application Superpower (Official Extension) · Stable · First-Party

Role: Self-hosted variable and editorial font families (Inter, Instrument, Berkeley Mono, iA Writer, Söhne, Fraunces…).

When to use: Load only the font modules your theme requires in astro.config.mjs to guarantee zero external font requests.

Quick Start (TL;DR)

// astro.config.mjs
standard({ moduleLoad: ["@stnd/fonts/inter", "@stnd/fonts/berkeley-mono"] });

This package contains all the typographies used in the Utopie design system (the Astro framework) as well as the Obsidian Vault.

All fonts follow a strict standard: the Artisan Standard. No more blind automation scripts breaking variable or static fonts; everything is structured with care and precision.


Every typeface Francis has bothered to self-host, one folder each — .woff2 for the web, a matching .md note (fonts as base64, so the note is self-contained) for the Obsidian vault. Using one in a site is a one-liner; adding a new one properly (the “Artisan Standard” below) is the careful part.

Use an existing font (in astro.config.mjs):

standard({ moduleLoad: ["@stnd/fonts/fraunces"] });

Add a new font: follow the 4-file recipe below — fonts/*.woff2, <name>.css, <name>.md, index.module.js — then register it so themes can find it (see “Registering the Font in the Web Ecosystem”).


The “Artisan” Standard

Each font family has its own folder, named in kebab-case (e.g., atkinson-hyperlegible-mono).

Here is the exact structure that a valid font must respect:

packages/fonts/font-name/
├── fonts/
│   ├── font-name-regular.woff2
│   └── font-name-italic.woff2
├── font-name.css
├── font-name.md
└── index.module.js

1. The fonts/ folder (Binaries)

2. The .css file (Astro Framework)

3. The .md file (Obsidian Vault)

4. The index.module.js file (Plugin System)


Procedure: Adding a New Font

To add a font properly following the “Artisan” standard, use these steps:

Step 1: File Preparation

  1. Create a folder packages/fonts/font-name (in kebab-case).
  2. Create a fonts/ subfolder inside.
  3. Place your .woff2 files there. Clean their names (remove random numbers or special characters).

Step 2: The CSS File

Create the font-name.css file and write the @font-face declarations.

⚠️ WARNING: Variable vs Static
If the font is static, declare each file with its exact weight (e.g., font-weight: 700; for bold).

If the font is variable, declare the range (e.g., font-weight: 100 900;).

Step 3: The JS Module

Create index.module.js copying the template above and adapting IDs and labels.

Step 4: Generating the Obsidian Note (Base64)

Create a temporary script generate_md.cjs in the font’s folder to convert CSS to base64:

const fs = require('fs');
const path = require('path');

const cssContent = fs.readFileSync('packages/fonts/font-name/font-name.css', 'utf8');
const regex = /url\("\\.\\/fonts\\/(.*?)"\\)/g;
let newCss = cssContent;
let match;

while ((match = regex.exec(cssContent)) !== null) {
  const filename = match[1];
  const filePath = path.join('packages/fonts/font-name/fonts', filename);
  const base64 = fs.readFileSync(filePath).toString('base64');
  const dataUrl = `data:font/woff2;base64,${base64}`;
  newCss = newCss.replace(match[0], `url("${dataUrl}")`);
}

const mdHeader = `---
aliases: []
created: 2026-06-09 16:33
modified: 2026-06-09 16:33
cssclasses: []
publish: false
snippet: true
tags:
  - design
type: font
visibility: private
---

# Font Name

**Description**: Short description.
**Why use it**: Why we use it.

\`\`\`css
`;

fs.writeFileSync('packages/fonts/font-name/font-name.md', mdHeader + newCss + '\n\`\`\`\n');

Run it (node packages/fonts/font-name/generate_md.cjs) and then delete it.


Synchronizing with the Obsidian Vault

Once the .md note is successfully generated in packages/fonts/, it needs to be sent to Obsidian.

Quick command to copy a font:

cp packages/fonts/font-name/font-name.md vault/Atelier/Kernel/Fonts/

Command to sync everything (if you updated multiple fonts):

# From the Utopie project root
find packages/fonts -mindepth 2 -maxdepth 2 -name "*.md" -exec cp {} vault/Atelier/Kernel/Fonts/ \;

Registering the Font in the Web Ecosystem

To make the font package available to themes and the Astro application, you must add it to the dependencies list of the central fonts module in packages/modules/fonts/index.module.js:

  dependencies: [
    ...
    "@stnd/fonts/font-name",
  ]

Obsidian Theme Configuration (The static vs variable font trap)

When you use a font in an Obsidian theme (in vault/Atelier/Kernel/Themes/my-theme.md), make sure you configure it properly:

For a STATIC font (e.g., Forrest, Avant Garde Pro):

    --font-weight: 400;
    --bold-weight: 700;
    --font-variation: "";
    --font-header-variation: "";

For a VARIABLE font (e.g., Inter, MonoLisa):

    --font-variation: "wght" 400;
    --font-header-variation: "wght" 700;