Skip to main content

Styles, Swatches & Fonts

Typograph does not use a traditional "paragraph/character/object styles" system where styles are defined globally and applied by name. Instead, visual style is expressed two ways:

  1. Swatches — color values defined once at the document level, referenced by UUID from pages and elements.
  2. Per-element formatting — rich-text elements carry their own font, size, and inline tag runs; geometric properties (stroke width, shadow, opacity, blend mode) live directly on each element.

Swatches​

A swatch is a named color definition stored in the document's swatches array:

PropertyDescription
typeSWATCH, TINTSWATCH, or GRADIENT
uuidStable identifier used by pages and elements
nameHuman-readable name
modelPROCESS, SPOT, REGISTRATION, MIXEDINKMODEL, GRADIENT, or NONE
spaceThe color space the swatch is defined in: CMYK, RGB, LAB, MIXEDINK, or NONE
rgb, cmyk, labColor values in one or more color spaces, with lower-case channels: rgb.r, rgb.g, rgb.b; cmyk.c, cmyk.m, cmyk.y, cmyk.k; lab.l, lab.a, lab.b
ink_listThe inks of a mixed-ink swatch
tintDefault tint value (0–1)

A document must contain at least 4 swatches.

Using a Swatch​

Pages and elements don't embed raw colors — they reference swatches:

"fill_swatch_uuid":   "019b28fb-a11e-7641-a28f-e978f892ec06",
"fill_tint": 0.8,
"stroke_swatch_uuid": "019b28fb-a11e-7641-a28f-e978f892ec07",
"stroke_tint": 1.0,
"shadow_swatch_uuid": "019b28fb-a11e-7641-a28f-e978f892ec08"

Changing the swatch definition propagates to every page and element that references it by UUID.

Gradient Swatches​

Gradient swatches have type: GRADIENT and carry their stops in a gradient object: its samples, each with a position, a swatch_uuid and an opacity. Elements apply them via gradient_fill_angle, native_gradient_fill_start and native_gradient_fill_length, and the matching gradient_stroke_angle, native_gradient_stroke_start and native_gradient_stroke_length.

Fonts​

Fonts used in the document are declared in the top-level font_data array. Each entry names a font and points at a font asset resolved through the File Service (see File Service — project fonts with presigned URLs).

Text elements (type: rich) reference fonts by name:

PropertyDescription
font_nameName of a font declared in font_data
font_sizeSize in native units
font_styleRegular, italic, weight, etc.
default_fontFallback if the named font isn't available

Inline formatting (runs of bold, italic, or differently-styled text) uses a Tag-based model embedded in the rich-text content.

Element-Level Visual Properties​

Properties normally thought of as "object styles" live on each element directly, not in a shared style sheet:

  • Border: native_stroke_width, stroke_dash
  • Shadow: has_shadow, shadow_angle, native_shadow_offset_x, native_shadow_offset_y, native_shadow_blur
  • Opacity: opacity (0–1)
  • Blending: blend_mode — one of 26 values, see Elements → Blend Modes
  • Rotation: angle, native_rotation_center_x, native_rotation_center_y

These don't refer to a global style definition; they're set per element. Shared look-and-feel comes from using shared swatches.

Why This Model?​

The editor is optimized for interactive, direct manipulation — designers tweak an element and see the change immediately. Color consistency is maintained through the swatch palette; typography through font_data. This keeps the document portable (no external stylesheet to ship alongside) while still allowing documents-wide color and font changes to propagate through a single edit.