Browse Source

* Subtitle::SSA::Style : fix @FIELDS_SSA, add description of formats

master
Alex 'AdUser' Z 8 years ago
parent
commit
f6244182d7
  1. 13
      lib/Subtitle/SSA/Style.pm

13
lib/Subtitle/SSA/Style.pm

@ -8,19 +8,23 @@ use overload => (
'""' => \&to_string, '""' => \&to_string,
); );
my @FIELDS_SSA = qw(name fontname fontsize primarycolour secondarycolour outlinecolour backcolour bold italic underline strikeout scalex scaley spacing angle borderstyle outline shadow alignment marginl marginr marginv encoding); # FIXME: copypaste my @FIELDS_SSA = qw(name fontname fontsize primarycolour secondarycolour tertiarycolour backcolour bold italic borderstyle outline shadow alignment marginl marginr marginv alphalevel encoding);
my @FIELDS_ASS = qw(name fontname fontsize primarycolour secondarycolour outlinecolour backcolour bold italic underline strikeout scalex scaley spacing angle borderstyle outline shadow alignment marginl marginr marginv encoding); my @FIELDS_ASS = qw(name fontname fontsize primarycolour secondarycolour outlinecolour backcolour bold italic underline strikeout scalex scaley spacing angle borderstyle outline shadow alignment marginl marginr marginv encoding);
# formats:
# s - string, use as is
# d - decimal, no-zero pad
# b - boolean, 0 as false, -1 as true
# f - float, 6.01 or 6 if no fractional part
# x - hex-number, &H00AABBCC for ASS or decimal number for SSA
my %FIELDS = ( my %FIELDS = (
# format: string
name => { type => 's', value => 'Default', name => 'Name' }, name => { type => 's', value => 'Default', name => 'Name' },
fontname => { type => 's', value => 'Arial' , name => 'Fontname' }, fontname => { type => 's', value => 'Arial' , name => 'Fontname' },
# format: hex-string (&H00AABBCC) for ASS or decimal number for SSA
primarycolour => { type => 'x', value => 0x00FFFFFF, name => 'PrimaryColour' }, primarycolour => { type => 'x', value => 0x00FFFFFF, name => 'PrimaryColour' },
secondarycolour => { type => 'x', value => 0x00000000, name => 'SecondaryColour' }, secondarycolour => { type => 'x', value => 0x00000000, name => 'SecondaryColour' },
outlinecolour => { type => 'x', value => 0x004E3873, name => 'OutlineColour' }, outlinecolour => { type => 'x', value => 0x004E3873, name => 'OutlineColour' },
tertiarycolour => { type => 'x', value => 0x004E3873, name => 'TertiaryColour' },
backcolour => { type => 'x', value => 0x96000000, name => 'BackColour' }, backcolour => { type => 'x', value => 0x96000000, name => 'BackColour' },
# format: decimal number
fontsize => { type => 'd', value => 24, name => 'Fontsize' }, fontsize => { type => 'd', value => 24, name => 'Fontsize' },
bold => { type => 'b', value => 0, name => 'Bold' }, bold => { type => 'b', value => 0, name => 'Bold' },
italic => { type => 'b', value => 0, name => 'Italic' }, italic => { type => 'b', value => 0, name => 'Italic' },
@ -37,6 +41,7 @@ my %FIELDS = (
marginl => { type => 'd', value => 10, name => 'MarginL' }, marginl => { type => 'd', value => 10, name => 'MarginL' },
marginr => { type => 'd', value => 10, name => 'MarginR' }, marginr => { type => 'd', value => 10, name => 'MarginR' },
marginv => { type => 'd', value => 10, name => 'MarginV' }, marginv => { type => 'd', value => 10, name => 'MarginV' },
alphalevel => { type => 'd', value => 0, name => 'AlphaLevel' },
encoding => { type => 'd', value => 204, name => 'Encoding' }, encoding => { type => 'd', value => 204, name => 'Encoding' },
); );

Loading…
Cancel
Save