| 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
Condition100%3/3
not $attributes{"line_height"} and $self->size > $self->line_height
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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 29 | 869 | ▶ | $loaded->{$family} = $file->pdf->corefont($family, -encoding => $enc || 'latin1'); | ||||||||||||||||||||||||||
|
Condition50%1/2
$enc || 'latin1'
MC/DC0%0/1
$enc || 'latin1'
$enc
Truth table50%1/2
A
A= $enc
| |||||||||||||||||||||||||||||
| 30 | 869 | $self->loaded($loaded); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 1721 | return $loaded->{$family}; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 3 | 1; | |||||||||||||||||||||||||||