Schemas / Layout

rig.layout.paragraph_style

v0.31.0 · draft 16 fields 0 required

Fields

FieldTypeMeaning
storyStyle entity optional Optional. Story paragraph style this map applies to
basedOn entity optional Optional. Parent layout paragraph style; absent / null = none
font entity optional Optional. rig.media.asset_ref kind font
fontSize float optional Optional. Size in document units (or points when the host documents that)
leading float optional Optional. Line spacing; absent = host default from fontSize
alignment enumleft · center · right · justify optional Optional. left / center / right / justify. Absent = left
spaceBefore float optional Optional. Space before the paragraph
spaceAfter float optional Optional. Space after the paragraph
firstLineIndent float optional Optional. First-line indent
keepFirstLines int optional Optional. Min lines left before a frame / page break (orphans). 0 = off; absent = host default
keepLastLines int optional Optional. Min lines carried past a frame / page break (widows). 0 = off; absent = host default
keepLastWords int optional Optional. Min words on the paragraph's last line (runts). 0 / 1 = off; absent = host default
hyphenate bool optional Optional. Dictionary hyphenation at line breaks. Absent = true; authored soft hyphens (U+00AD) always stay break opportunities
alignToBaselineGrid bool optional Optional. Snap lines to the document rig.layout.grid baseline increment. Absent = false
baselineGridFirstLineOnly bool optional Optional. With alignToBaselineGrid, snap only the paragraph's first line; the rest follow leading. Absent = false
paint entity optional Optional. Paint entity (rig.paint.fill / solid) for the run colour

Visual map for a rig.story.paragraph_style. Format when present.

Story styles stay identity-only (name + basedOn + listKind). Font, size, leading, alignment, and colour live here so any host can open the same book. Key with storyStyle; resolve basedOn chains on this schema separately from the story chain.

Based-on chains stay acyclic. A cycle is a document error. Do not put these fields on rig.story.*.

JSON Schema

Resolves at https://rig.works/schemas/rig.layout.paragraph_style.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.layout.paragraph_style.schema.json",
  "title": "rig.layout.paragraph_style",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "storyStyle": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "basedOn": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "font": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "fontSize": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "leading": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "alignment": {
      "type": "string",
      "enum": [
        "left",
        "center",
        "right",
        "justify"
      ]
    },
    "spaceBefore": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "spaceAfter": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "firstLineIndent": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "keepFirstLines": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "keepLastLines": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "keepLastWords": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "hyphenate": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "alignToBaselineGrid": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "baselineGridFirstLineOnly": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "paint": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    }
  }
}

Seen in

story-frames.json