A control code is a letter and a value in braces, written {letter:value},
placed in the text of a subtitle line. Several
can be combined, as in {c:$0000ff}{y:b,u}{f:DeJaVuSans}{s:12}Hello!. A brace
that does not form a valid code is shown as text.
Codes
| Code | Value | Meaning |
|---|---|---|
y, Y | Style letters: i, b, u, s | Italic, bold, underline, strikethrough. Several are separated by commas, as in {y:b,u}. |
f, F | Font name | The font face, as in {f:Arial}. |
s, S | Integer | Font size, as in {s:10}. |
c, C | $BBGGRR | Colour, written blue first: {c:$0000FF} is red. FFmpeg also accepts a leading #. |
P | Depends on the reader | Position. Described as {P:x,y} coordinates; FFmpeg instead reads one digit, where 0 puts the subtitle at the top and 1 leaves it at the bottom. Always upper case. |
o | x,y | Coordinates, as FFmpeg reads them. Not in the published descriptions. |
H | Character set name | Sets the character set, as in {DEFAULT}{H:Greek}. Valid only on the {DEFAULT} line. FFmpeg parses it and does nothing with it. |
Upper case and lower case
The case of a letter sets how long the code lasts. An upper-case code applies to the whole subtitle; a lower-case one applies only to the display line it appears in.
{Y:i}Hello!|How are you?
{y:i}Hello!|{y:b}How are you?
After a |, a line with no codes of its own keeps the previous
formatting, as far as public descriptions say. In FFmpeg, a lower-case code is
closed again at each |, and o behaves as an upper-case code
does.
Not confirmed
The two descriptions of P disagree and no original MicroDVD documentation
has survived to settle it. How MicroDVD itself treated colour names or sizes beyond
these examples is unknown.