|
|
@ -217,4 +217,22 @@ sub style_usage { |
|
|
|
return $stats; |
|
|
|
return $stats; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub fonts_usage { |
|
|
|
|
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
my $stats = {}; |
|
|
|
|
|
|
|
foreach my $s (@{ $self->{styles} }) { |
|
|
|
|
|
|
|
my $fn = $s->{fontname}; |
|
|
|
|
|
|
|
$stats->{$fn} //= 0; |
|
|
|
|
|
|
|
$stats->{$fn}++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
foreach my $e (@{ $self->{events} }) { |
|
|
|
|
|
|
|
next unless index($e->{text}, '\fn') > 0; |
|
|
|
|
|
|
|
my ($fn) = ($e->{text} =~ m<\\fn([^\\}]+)>); |
|
|
|
|
|
|
|
next unless $fn; |
|
|
|
|
|
|
|
$stats->{$fn} //= 0; |
|
|
|
|
|
|
|
$stats->{$fn}++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $stats; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
1; |
|
|
|
1; |
|
|
|