ass_add_typesetting
Build and apply an ASS override block to selected subtitle lines, combining position, move, fade, clip, alignment, and extra tags into one merged typesetting tag string.
Instructions
Build a leading override block out of named typesetting pieces.
Args:
selection: selection spelling; every selected line receives the block.
doc_id: document to edit; the current one when omitted.
pos: [x, y] -> \pos(x,y).
an: alignment, a plain integer 1..9 (7 -> \an7). Booleans,
floats and out-of-range values are rejected; \q-style
alignments are not part of this helper.
move: \move animation. Accepted shapes: six numbers
[x1, y1, x2, y2, t1, t2] (times in milliseconds), four
numbers, two pairs, a pair (expanded to a zero-length move), or a
dict with x1/y1/x2/y2 and optional t1/t2.
fade: \fad/\fade. A pair [in_ms, out_ms] produces
\fad(in,out); a 4-tuple [a1, a2, a3, t] produces
\fade(a1,a2,a3,t,t,t,t); the full 7-tuple
[a1, a2, a3, t1, t2, t3, t4] is passed through verbatim; a dict
with a1/a2/a3/t1..t4 also works.
clip: \clip/\iclip. A rectangle [x0, y0, x1, y1], a
drawing path string ("m 0 0 l 100 0 100 100" — it must contain a
drawing command, otherwise the string is rejected instead of being
handed to libass as a no-op), [scale, path],
or a dict {"rect": [...]} / {"drawing": "...", "scale": n}
with "inverse": true to emit \iclip.
org: [x, y] -> \org(x,y).
extra_tags: any additional override text (braces and the leading
backslash are optional) appended to the block in the order given.
reset_first: put \r at the front of the block so the line starts
from the style's values before the new tags are applied.
in_place: write the block back to the document (snapshot-backed,
True by default). With False the planned lines are returned
but the document is left alone.
Returns {"doc_id", "tag_string", "override", "reset_first", "count", "changed", "written", "in_place", "lines": [{"index", "before", "text", "changed"}], "text"}. tag_string is the exact tag string produced
(without the braces, e.g. \an8\pos(100,200)); text is the new line
text when the selection resolved to a single line, otherwise None (the
per-line texts are in lines). The block is merged into the line's
existing first block so duplicated tags are updated instead of stacking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| an | No | ||
| org | No | ||
| pos | No | ||
| clip | No | ||
| fade | No | ||
| move | No | ||
| doc_id | No | ||
| in_place | No | ||
| selection | Yes | ||
| extra_tags | No | ||
| reset_first | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||