fontstudio
v0.0.1
Published
Font-face, axis, and specimen helpers for small type studios.
Maintainers
Readme
Font Studio
Small font-facing primitives for specimens and type systems.
Font Studio is a small namespace claim for the font-facing pieces that sit
around a type specimen: CSS @font-face output, variable-font axis values,
and a few useful specimen presets.
Not published yet. It builds from source in this repository.
Usage
npm i fontstudioimport { axisValue, fontFace, specimenPresets } from "fontstudio";
fontFace({
family: "Atlas",
source: "/fonts/atlas.woff2",
weight: "300 800",
});
axisValue({ tag: "wght", min: 300, max: 800 }, 540);
// '"wght" 540'
specimenPresets();API
| Export | Purpose |
| --- | --- |
| fontFace(options) | Serialises a font source into a CSS @font-face rule. |
| axisValue(axis, value) | Validates a four-letter variable-font axis and formats its CSS value. |
| specimenPresets() | Returns display, reading, interface, and symbol specimens. |
| FontFaceOptions | Family, source, weight, style, and display settings. |
| FontAxis | A four-letter axis tag with finite minimum and maximum values. |
Development
npm run build --workspace=fontstudioMIT.
