|
|
|
@ -10,7 +10,7 @@ my ($fields, @fields, $format, $sample, $style, $output);
|
|
|
|
|
# SSA format line |
|
|
|
|
$format = 'Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding'; |
|
|
|
|
@fields = qw(name fontname fontsize primarycolour secondarycolour tertiarycolour backcolour bold italic borderstyle outline shadow alignment marginl marginr marginv alphalevel encoding); |
|
|
|
|
$style = Subtitle::SSA::Style->new(version => 'ssa'); |
|
|
|
|
$style = Subtitle::SSA::Style->new(type => 'ssa'); |
|
|
|
|
$fields = $style->parse_format_line($format); |
|
|
|
|
is(ref $fields, 'ARRAY'); |
|
|
|
|
is_deeply($fields, \@fields); |
|
|
|
@ -18,13 +18,13 @@ is_deeply($fields, \@fields);
|
|
|
|
|
# ASS format line |
|
|
|
|
$format = 'Format:Name,Fontname,Fontsize,PrimaryColour,SecondaryColour,OutlineColour,BackColour,Bold,Italic,Underline,StrikeOut,ScaleX,ScaleY,Spacing,Angle,BorderStyle,Outline,Shadow,Alignment,MarginL,MarginR,MarginV,Encoding'; |
|
|
|
|
@fields = qw(name fontname fontsize primarycolour secondarycolour outlinecolour backcolour bold italic underline strikeout scalex scaley spacing angle borderstyle outline shadow alignment marginl marginr marginv encoding); |
|
|
|
|
$style = Subtitle::SSA::Style->new(version => 'ass'); |
|
|
|
|
$style = Subtitle::SSA::Style->new(type => 'ass'); |
|
|
|
|
$fields = $style->parse_format_line($format); |
|
|
|
|
is(ref $fields, 'ARRAY'); |
|
|
|
|
is_deeply($fields, \@fields); |
|
|
|
|
|
|
|
|
|
$sample = 'Style: Default,Arial,20,11259130,33023,12582847,32,-1,0,1,2,1,2,10,10,2,0,204'; |
|
|
|
|
$style = Subtitle::SSA::Style->new(version => 'ssa'); |
|
|
|
|
$style = Subtitle::SSA::Style->new(type => 'ssa'); |
|
|
|
|
ok($style->parse($sample), "SSA style parsing test"); |
|
|
|
|
is($style->{name} => 'Default'); |
|
|
|
|
is($style->{fontname} => 'Arial'); |
|
|
|
@ -49,7 +49,7 @@ ok($output = $style->to_string(), 'converting SSA style to string');
|
|
|
|
|
is($output, $sample); |
|
|
|
|
|
|
|
|
|
$sample = 'Style: Default,Georgia,50,&H00F0F4F6,&H008D7127,&H00414B4C,&H00000000,0,0,0,0,100,95,0,0,1,3.5,0,2,11,11,13,204'; |
|
|
|
|
$style = Subtitle::SSA::Style->new(version => 'ass'); |
|
|
|
|
$style = Subtitle::SSA::Style->new(type => 'ass'); |
|
|
|
|
ok($style->parse($sample), "ASS style parsing test"); |
|
|
|
|
is($style->{name} => 'Default'); |
|
|
|
|
is($style->{fontname} => 'Georgia'); |
|
|
|
|