Schemas / Media
rig.media.text
v1.0.0 · stable maturity: stable 12 fields 1 required
Fields
| Field | Type | Meaning | |
|---|---|---|---|
text |
string | required | Content |
font |
entity | optional | Optional. rig.media.asset_ref with kind font; absent = host default face |
fontSize |
float | optional | Optional. Point or pixel size as the host documents; absent = host default |
axes |
array<object> | optional | Optional. OpenType variable-font axis values; absent = font defaults |
features |
string | optional | Optional. Comma-separated OpenType feature tags (e.g. liga,ss01); absent = host default |
useKerning |
bool | optional | Optional. Apply kerning; absent = true |
tracking |
float | optional | Optional. Letter-spacing in thousandths of an em; absent = 0 |
anchor |
enumstart · middle · end | optional | Optional. start / middle / end; absent = start |
writingMode |
enumhorizontal-tb · vertical-rl · vertical-lr | optional | Optional. horizontal-tb / vertical-rl / vertical-lr; absent = horizontal-tb |
direction |
enumltr · rtl | optional | Optional. ltr / rtl; absent = ltr |
baseline |
enumauto · alphabetic · middle · hanging · ideographic · central | optional | Optional. auto / alphabetic / middle / hanging / ideographic / central; absent = auto |
placements |
array<object> | optional | Optional. Authored per-character slots (index plus optional x / y / dx / dy / rotateDegrees). Glyph positions the host computes stay a cache |
Scene / canvas text run. Format when present.
Editorial copy (named styles, paragraphs, runs, tables) is rig.story.flow, not this schema. Do not flatten a story into canvas runs.
An editable UFO source face is rig.font.face - do not put outlines, kern pairs, or glyph names on this schema. font here is a compiled rig.media.asset_ref.
Appearance: rig.paint.fill_stroke or rig.paint.fill on the same entity - do not re-declare colour here. Absent paint means host default (typically black). A run that follows a contour composes rig.media.text_path. A styled child run is another rig.media.text entity, not a bag on this one.
Axis
Face handles, glyph caches, and GPU atlases stay in the host.
JSON Schema
Resolves at https://rig.works/schemas/rig.media.text.schema.json —
raw file.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://rig.works/schemas/rig.media.text.schema.json",
"title": "rig.media.text",
"type": "object",
"additionalProperties": false,
"properties": {
"text": {
"$ref": "./_defs.schema.json#/$defs/string"
},
"font": {
"$ref": "./_defs.schema.json#/$defs/entity"
},
"fontSize": {
"$ref": "./_defs.schema.json#/$defs/float"
},
"axes": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"tag",
"value"
],
"properties": {
"tag": {
"$ref": "./_defs.schema.json#/$defs/uint32"
},
"value": {
"$ref": "./_defs.schema.json#/$defs/float"
}
}
}
},
"features": {
"$ref": "./_defs.schema.json#/$defs/string"
},
"useKerning": {
"$ref": "./_defs.schema.json#/$defs/bool"
},
"tracking": {
"$ref": "./_defs.schema.json#/$defs/float"
},
"anchor": {
"type": "string",
"enum": [
"start",
"middle",
"end"
]
},
"writingMode": {
"type": "string",
"enum": [
"horizontal-tb",
"vertical-rl",
"vertical-lr"
]
},
"direction": {
"type": "string",
"enum": [
"ltr",
"rtl"
]
},
"baseline": {
"type": "string",
"enum": [
"auto",
"alphabetic",
"middle",
"hanging",
"ideographic",
"central"
]
},
"placements": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"index"
],
"properties": {
"index": {
"$ref": "./_defs.schema.json#/$defs/int"
},
"x": {
"$ref": "./_defs.schema.json#/$defs/float"
},
"y": {
"$ref": "./_defs.schema.json#/$defs/float"
},
"dx": {
"$ref": "./_defs.schema.json#/$defs/float"
},
"dy": {
"$ref": "./_defs.schema.json#/$defs/float"
},
"rotateDegrees": {
"$ref": "./_defs.schema.json#/$defs/float"
}
}
}
}
},
"required": [
"text"
],
"x-rig-maturity": "stable"
}