Skip to main content
A paper style sets how a drawing looks: line weights, colours, hatches and text. Floorkit has four built-in styles, and you can add your own. resolvePaperStyle changes a style id or a partial style into a full style.

Import

Example

Notes

  • The built-in styles are ISO_128, INK_SKETCH, GRAPHITE and NAPKIN.
  • Your style replaces a built-in style that has the same id.
  • An unknown id gives the default style, and the id appears in unresolved.
  • With no input, the function returns undefined.

resolvePaperStyle

Flatten a style input against a registry.

mergeStyle

Merge one style over another, at the depth each field means: - classes / edgeClasses: key by key, then field by field on the class, then field by field on each byKind entry — so an overlay that says { classes: { WALL: { ink } } } keeps WALL’s weight, fill and hatch.

resolveSheetPolicy

The policy a sheet renders under: deps.paperStyle (caller) → the sheet → the document.

resolveViewportPolicy

The policy one viewport renders under.

documentStyleOf

A document’s style fields, for PaperRenderDeps.documentStyle.

PAPER_STYLES

The presets that ship, keyed by id.

DEFAULT_PAPER_STYLE_ID

ISO_128

INK_SKETCH

Freehand ink — a drafted plan in technical pen on vellum, in the register Francis Ching teaches: a compressed four-rung hierarchy, warm near-black ink that lightens as the line thins, solid poché pulled a hair in from its line, crossed corners with a short placed start and a longer lifted finish, a second strike on the heavy lines, and upper-case lettering with a little tracking.

GRAPHITE

Soft graphite on trace — a design-development plan in pencil on canary trace: every weight one rung heavier than ink (a pencil line is wider than a pen’s), warm greys that lighten as the line thins, a light warm poché with one sparse pass of scrubbed hatch over it (a tone, not a material), wider re-strike offsets than ink, longer softer tapers, a re-struck door swing, and larger upper-case lettering.

NAPKIN

Napkin sketch — the parti drawing: a fineliner on a paper napkin, drawn fast.

Types

PaperStyleInput

ResolvedPaperStyle

PaperStyle
required
Flattened: every extends walked and merged, no extends left.
string[]
required
Every reference that did not resolve, in the order it was met.

PaperRenderDeps

Dependencies the emitters (and, later, the screen renderer) need that aren’t part of the serializable document: the kernel-backed drawing extractor that resolves each viewport to vector data, and (optionally) the title-block template registry used to render a sheet’s title block.
(viewId: string, viewport?: import('../model/viewport').Viewport) => import('../model/raster-view').RasterDrawing | undefined
Resolve prepared named raster content; return undefined for a vector view.
DrawingExtractor
required
(viewId: string) => VectorDrawing
Draw a named project view; absent keeps bare paper renderers inline-only.
TitleblockTemplateRegistry
UnitSystem
Which conventions to format numbers with.
string
Fills the title block’s projectName auto-field, which nothing populated.
string
ISO date (YYYY-MM-DD) for the title block’s date auto-field. Absent means today, which makes a rendered sheet non-reproducible — a batch export or a golden test pins it here.
DimensionStyleRegistry
Mirrors PaperDocument.dimensionStyles; set from it by the exporter and the renderer, for the same reason unitSystem is.
PaperStyleInput
A caller’s paper style — an id or an inline overlay — for this render only. Narrower than anything stored: it outranks the viewport’s, the sheet’s and the document’s own style.
PaperStyleRegistry
Extra presets a host registers, resolvable by id alongside the builtins. A document’s own paperStyles outrank these.
DocumentStyleFields

DocumentStyleFields

The style-bearing fields of a document, lifted into the render deps.

BuiltinPaperStyleId

The presets that ship.
Last modified on October 11, 2026