aeidon.tags.SubStationAlpha

Source: aeidon/tags/ssa.py

Anchestors: aeidon.markup.Markup, aeidon.singleton.Singleton, builtins.object

class aeidon.tags.SubStationAlpha

Text markup for the Sub Station Alpha format.

Sub Station Alpha format contains a lot of markup tags of which the following are of interest to us. The generic reset {\r} is used to revert to regular text, i.e. to close all open tags. Most of the tagging methods, e.g. colorize(), leave tags unclosed, instead of explicitly closing them and possibly other tags with {\r}. Usually this is not a problem as such tags tend to be applied to the whole subtitle.

  • {\b1}...........{\b0}
  • {\i1}...........{\i0}
  • {\fnNAME}............
  • {\fsPOINTS}..........
  • {\c&HBBGGRR&}........
  • .................{\r}

The hexadecimal color value is in reverse order, BBGGRR instead of the normal RRGGBB. Furthermore, leading zeros can be omitted, e.g. ff00 can be used instead of 00ff00.

Methods

SubStationAlpha.bolden(text, bounds=None)

Return bolded text.

SubStationAlpha.colorize(text, color, bounds=None)

Return text colorized to hexadecimal value.

SubStationAlpha.fontify(text, font, bounds=None)

Return text changed to font.

SubStationAlpha.italicize(text, bounds=None)

Return italicized text.

SubStationAlpha.scale(text, size, bounds=None)

Return text scaled to size.