Khonsu/Font.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond 80.0% 4 / 5 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 3 totaltotal 88.6% 39 / 44 CC 5 SCAR 6.9
CC
5
Cov
97%
find
3.0
load
3.0
BEGIN
1.0
CRAP 2.0
« Khonsu/Form/Field.pm ↑ Summary Khonsu/Ra.pm »
1 package Khonsu::Font;
2  
3 3 ▶use parent 'Khonsu::Ra';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 sub attributes {
6 636 ▶ my $a = shift;
Subroutine attributes: called CC=1 SCAR=0.0
Pod undocumented
7 return (
8 636 ▶ colour => {$a->RW, $a->STR, default => sub { '#000' }},
Subroutine __ANON__: called CC=1 SCAR=0.0
9 636 ▶ size => {$a->RW, $a->NUM, default => sub { 9 }},
Subroutine __ANON__: called CC=1 SCAR=0.0
10 636 ▶ family => {$a->RW, $a->STR, default => sub { 'Times' }},
Subroutine __ANON__: called CC=1 SCAR=0.0
11 loaded => {$a->RW, $a->DHR},
12 636 ▶ line_height => {$a->RW, $a->NUM, default => sub { $_[0]->size }},
Subroutine __ANON__: called CC=1 SCAR=0.0
13 636 );
14 }
15  
16 sub load {
17 1721 ▶ my ($self, $file, %attributes) = @_;
Subroutine load: called CC=3 SCAR=11.0
Pod undocumented
18 1721 $self->set_attributes(%attributes);
19 1721 ▶ if (!$attributes{line_height} && $self->size > $self->line_height) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $attributes{"line_height"} and $self->size > $self->line_height) 2 1719 1721
Condition100%3/3
not $attributes{"line_height"} and $self->size > $self->line_height
!ll&&!rl&&r
61411052
MC/DC100%2/2
not $attributes{"line_height"} and $self->size > $self->line_height
not $attributes{"line_height"} $self->size > $self->line_height
Truth table100%3/3
not(A) and B
A= not $attributes{"line_height"}B= $self->size > $self->line_height
ABresult
0X0
100
111
20 2 $self->line_height($self->size);
21 }
22 1721 return $self->find($file, $self->family);
23 }
24  
25 sub find {
26 1721 ▶ my ($self, $file, $family, $enc) = @_;
Subroutine find: called CC=3 SCAR=11.0
Pod undocumented
27 1721 my $loaded = $self->loaded;
28 1721 ▶ unless ($loaded->{$family}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($loaded->{$family}) 869 852 1721
29 869 ▶ $loaded->{$family} = $file->pdf->corefont($family, -encoding => $enc || 'latin1');
Condition50%1/2
$enc || 'latin1'
l!l
0869
MC/DC0%0/1
$enc || 'latin1'
$enc
Truth table50%1/2
A
A= $enc
Aresult
11
00
30 869 $self->loaded($loaded);
31 }
32 1721 return $loaded->{$family};
33  
34 }
35  
36  
37 3 1;
« Khonsu/Form/Field.pm ↑ Summary Khonsu/Ra.pm »