File Coverage

blib/lib/PDF/Make/Builder/Text/H6.pm
Criterion Covered Total %
statement 18 19 94.7
branch 1 2 50.0
condition 3 7 42.8
subroutine 5 5 100.0
pod 1 1 100.0
total 28 34 82.3


line stmt bran cond sub pod time code
1             package PDF::Make::Builder::Text::H6;
2 42     42   253 use strict;
  42         70  
  42         1215  
3 42     42   149 use warnings;
  42         95  
  42         1670  
4 42     42   186 use Object::Proto;
  42         52  
  42         2549  
5              
6             BEGIN {
7 42     42   4453 Object::Proto::define('PDF::Make::Builder::Text::H6',
8             extends => 'PDF::Make::Builder::Text',
9             'toc:Bool:default(0)',
10             );
11 42         8275 Object::Proto::import_accessors('PDF::Make::Builder::Text::H6');
12             }
13              
14             sub add {
15 2     2 1 5 my ($self, $builder) = @_;
16 2         6 my $f = font $self // {};
17 2   50     10 $f->{size} //= 15;
18 2   50     8 $f->{line_height} //= 19;
19 2         2 font $self, $f;
20              
21 2 50 33     9 if ($self->toc && $builder->toc) {
22 0         0 $builder->toc->outline($builder, 6,
23             text => PDF::Make::Builder::Text::text($self),
24             page_num => $builder->page->num,
25             );
26             }
27              
28 2         7 return $self->SUPER::add($builder);
29             }
30              
31             1;
32              
33             __END__