@mocanvas/editor · interface

TLFontFace

interface TLFontFace

One loadable typeface, in the vocabulary of the CSS @font-face rule.

A font *manager* turns these into real FontFace objects and loads them on demand; the theme only says which faces exist.


Properties · 7

display?: "auto" | "block" | "swap" | "fallback" | "optional"

font-display descriptor.

family: string

The font-family this face is registered under, e.g. tldraw_draw.

src: string | TLFontFaceSource

Where the face comes from.

Either a CSS src descriptor verbatim — url("/f.woff2") format("woff2"), or local("Georgia") for a face already on the machine — or a TLFontFaceSource, which is the same thing with the URL and the format kept apart so neither has to be escaped into a string.

stretch?: string

font-stretch descriptor.

style?: string

font-style descriptor, e.g. "normal", "italic".

unicodeRange?: string

unicode-range descriptor.

weight?: string

font-weight descriptor, e.g. "normal", "700".

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.