ass_add_style
Create a new style or replace an existing style of the same name in an ASS subtitle document, validating all values before writing.
Instructions
Create a style, or replace an existing one of the same name.
Every value is stored verbatim (/48.0 becomes 48); colour values
given as #RRGGBB are converted into the spelling the document already
uses for that field. Values are validated before anything is written:
font_size must be positive, alignment 1-9, border_style 1 or 3,
margins whole numbers and colours a spelling the document can store.
overwrite=True replaces the style: every field is (re)written from
the arguments, so fields left at their defaults go back to those defaults
rather than keeping the old value — use ass_update_style to change a
few fields and leave the rest alone. relative_to is Aegisub's
style-manager setting: it is only written when the document's Format
line already declares a RelativeTo column, otherwise it is listed in
ignored_fields (adding the column would desynchronise the Format
line).
Returns:
{"doc_id", "name", "created", "style", "fields_set", "ignored_fields"} — created is False when overwrite=True
replaced an existing style.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bold | No | ||
| font | No | Arial | |
| name | Yes | ||
| angle | No | ||
| doc_id | No | ||
| italic | No | ||
| shadow | No | ||
| outline | No | ||
| scale_x | No | ||
| scale_y | No | ||
| spacing | No | ||
| encoding | No | ||
| margin_l | No | ||
| margin_r | No | ||
| margin_v | No | ||
| alignment | No | ||
| font_size | No | ||
| overwrite | No | ||
| underline | No | ||
| strike_out | No | ||
| back_colour | No | &H00000000& | |
| relative_to | No | ||
| border_style | No | ||
| outline_colour | No | &H00000000& | |
| primary_colour | No | &H00FFFFFF& | |
| secondary_colour | No | &H000000FF& |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||