@molecule/app-fonts-dm-serif-display
Provider bond · fonts · App (browser) · v1.0.4 · Apache-2.0
DM Serif Display — local, self-hosted font (no external CDN)
npm install @molecule/app-fonts-dm-serif-displaynpm · Source on GitHub · Implements @molecule/app-fonts
How it works
@molecule/app-fonts-dm-serif-display is a provider bond on the app (browser) side: it implements the fonts core interface (@molecule/app-fonts) with a concrete vendor or library behind it.
Your code calls the core; you wire this provider once at startup. Swapping vendors later is one line in that wiring, not a rewrite.
import { setFont } from '@molecule/app-fonts'
import { font as serif } from '@molecule/app-fonts-dm-serif-display'
setFont(serif) // once, at app startup — before first paintWorks with: @molecule/app-fonts
Reference
DM Serif Display font for molecule.dev.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
import { setFont } from '@molecule/app-fonts'
import { font as serif } from '@molecule/app-fonts-dm-serif-display'
setFont(serif) // once, at app startup — before first paint
Type
provider
Installation
npm install @molecule/app-fonts-dm-serif-display @molecule/app-fonts
API
Constants
font
DM Serif Display font definition — local, self-hosted (no external CDN).
const font: FontDefinition
Core Interface
Implements @molecule/app-fonts interface.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-fonts^1.0.1
Runtime Dependencies
-
@molecule/app-fonts -
Wiring it without
mlcl(the sandbox): the package is already installed undernode_modules— add an"@molecule/app-fonts-dm-serif-display"dependency to the app'spackage.json(pin the version already installed there), then inapp/src/bonds/index.tscallsetFont(serif). Preferred: import the webfont as an asset so nothing is copied —import woff from '@molecule/app-fonts-dm-serif-display/fonts/DMSerifDisplay-Regular.ttf?url'thensetFont({ ...serif, source: { type: 'local', faces: [{ file: woff, weight: 400 }] } }).setFont()uses afilestarting with/,httpordata:as-is. Without an asset import, copynode_modules/@molecule/app-fonts-dm-serif-display/fonts/DMSerifDisplay-Regular.ttftoapp/public/fonts/DMSerifDisplay-Regular.ttfand callsetFont(serif)— a plain filename is served from<basePath>fonts/<file>.