From f6244182d708c3c0855b9985f9925850274d1264 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 30 Jun 2016 15:09:03 +1000 Subject: [PATCH] * Subtitle::SSA::Style : fix @FIELDS_SSA, add description of formats --- lib/Subtitle/SSA/Style.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/Subtitle/SSA/Style.pm b/lib/Subtitle/SSA/Style.pm index 5330d38..4b2b0e1 100644 --- a/lib/Subtitle/SSA/Style.pm +++ b/lib/Subtitle/SSA/Style.pm @@ -8,19 +8,23 @@ use overload => ( '""' => \&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); +# 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 = ( - # format: string name => { type => 's', value => 'Default', name => 'Name' }, 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' }, secondarycolour => { type => 'x', value => 0x00000000, name => 'SecondaryColour' }, outlinecolour => { type => 'x', value => 0x004E3873, name => 'OutlineColour' }, + tertiarycolour => { type => 'x', value => 0x004E3873, name => 'TertiaryColour' }, backcolour => { type => 'x', value => 0x96000000, name => 'BackColour' }, - # format: decimal number fontsize => { type => 'd', value => 24, name => 'Fontsize' }, bold => { type => 'b', value => 0, name => 'Bold' }, italic => { type => 'b', value => 0, name => 'Italic' }, @@ -37,6 +41,7 @@ my %FIELDS = ( marginl => { type => 'd', value => 10, name => 'MarginL' }, marginr => { type => 'd', value => 10, name => 'MarginR' }, marginv => { type => 'd', value => 10, name => 'MarginV' }, + alphalevel => { type => 'd', value => 0, name => 'AlphaLevel' }, encoding => { type => 'd', value => 204, name => 'Encoding' }, );