Branch Coverage

blib/lib/PDF/Builder/Content.pm
Criterion Covered Total %
branch 230 534 43.0


line true false branch
106 4 0 if ($self->{'-docompress'} and $self->{'Filter'})
278 32 23 unless defined $opts{$o}
280 8 15 if ($o eq '-translate') { }
5 10 elsif ($o eq '-rotate') { }
5 5 elsif ($o eq '-scale') { }
5 0 elsif ($o eq '-skew') { }
0 0 elsif ($o eq '-matrix') { }
317 0 11 if ($opts{'-point'})
337 8 3 if ($opts{'-translate'}) { }
343 5 6 if ($opts{'-rotate'}) { }
349 5 6 if ($opts{'-scale'}) { }
355 5 6 if ($opts{'-skew'}) { }
377 1 0 $opts{'-skew'} ? :
380 1 0 $opts{'-scale'} ? :
386 1 0 $opts{'-translate'} ? :
441 20 0 if (defined $a)
442 3 17 if ($self->_in_text_object) { }
450 3 17 if ($self->_in_text_object) { }
483 0 87 unless (defined $linewidth)
529 0 1 unless (defined $linecap)
579 0 1 unless (defined $style)
614 0 1 unless (defined $ratio)
664 3 7 if (scalar @pat) { }
668 1 2 if ($pat[0] =~ /^\-/) { }
684 0 10 if (scalar @pat == 1 and $pat[0] == -1)
711 0 1 if ($tolerance < 0)
712 0 1 if ($tolerance > 100)
719 0 1 unless (defined $tolerance)
773 0 107 if ($self->_in_text_object) { }
859 0 93 if ($self->_in_text_object) { }
887 0 2 if ($self->_in_text_object) { }
901 0 1 if ($self->_in_text_object) { }
1045 0 159 unless (defined $dir)
1047 0 159 if ($rx <= 0 or $ry <= 0)
1051 0 159 if ($alpha == $beta)
1064 0 159 if (not $dir and $alpha > $beta)
1065 0 0 if ($alpha == 360 and $beta == 0) { }
0 0 elsif ($alpha == 360) { }
0 0 elsif ($beta == 0) { }
1078 1 158 if ($dir and $alpha < $beta)
1079 0 1 if ($alpha == 0 and $beta == 360) { }
1 0 elsif ($alpha == 0) { }
0 0 elsif ($beta == 360) { }
1095 74 84 if (abs $beta - $alpha > 30) { }
1148 4 1 unless (defined $dir)
1155 3 2 if $move
1202 1 0 unless (defined $dir)
1237 0 89 if ($self->_in_text_object) { }
1489 0 1 if (defined $opts{'-firstseg'}) { }
1494 0 1 if (defined $opts{'-lastseg'}) { }
1501 0 1 if (defined $opts{'-ratio'}) { }
1504 0 0 if ($ratio <= 0.1)
1509 0 1 if (defined $opts{'-colinear'}) { }
1515 0 1 if (defined $opts{'-debug'}) { }
1529 0 7 if ($inputs[-2][0] == $inputs[-1][0] and $inputs[-2][1] == $inputs[-1][1])
1540 0 1 if (scalar @inputs == 1) { }
0 1 elsif (scalar @inputs == 2) { }
0 1 elsif (scalar @inputs == 3) { }
1549 0 0 if ($firstseg ne 'curve')
1550 0 0 if ($lastseg ne 'curve')
1555 0 1 if ($debug > 0)
1582 7 1 if ($i < $last)
1593 6 2 if ($i > 0 and $i < $last)
1595 0 6 if ($polyline[$i - 1][0] == $polyline[$i][0] and $polyline[$i - 1][1] == $polyline[$i][1])
1600 0 0 if ($i == 1)
1602 0 0 if ($firstseg =~ /^constraint/) { }
1612 0 0 if ($i == $last - 1)
1614 0 0 if ($lastseg =~ /^constraint/) { }
1637 7 1 if ($i > 0)
1640 7 1 if ($i < $last)
1644 1 7 if ($i == 0 or $i < $last and $colinpt[$i]) { }
1 6 elsif ($i == $last) { }
1647 0 1 if ($i > 0)
1666 0 6 if ($l == 0) { }
1682 0 1 if ($debug > 0)
1694 0 0 if ($debug > 1)
1704 0 0 if ($debug > 2)
1716 0 0 if ($debug > 3)
1732 0 1 if ($colinpt[$i]) { }
1743 0 1 if ($colinpt[$i]) { }
1763 0 1 if ($firstseg eq 'line1') { }
0 1 elsif ($firstseg eq 'line2') { }
0 1 elsif ($firstseg eq 'constraint1') { }
0 1 elsif ($firstseg eq 'constraint2') { }
1800 0 1 if ($lastseg eq 'line1') { }
0 1 elsif ($lastseg eq 'line2') { }
0 1 elsif ($lastseg eq 'constraint1') { }
0 1 elsif ($lastseg eq 'constraint2') { }
1843 0 4 if ($colinpt[$i]) { }
1847 0 0 unless ($colinpt[$j])
1852 0 0 if ($colinear eq 'line' and $j > $i) { }
1877 0 0 if ($dtheta >= 0 and $dthetap < 0 or $dtheta < 0 and $dthetap >= 0) { }
1887 0 0 if ($odd) { }
1919 0 0 if ($odd)
1920 0 0 if ($same) { }
1954 0 1 if ($debug > 3)
1958 0 0 if ($i < $last and $type[$i] == 1 || $type[$i] == 3)
1987 0 1 if ($debug > 0)
1996 1 0 if ($type[0] < 2) { }
2002 0 7 if ($type[$i] > 1)
2003 7 0 if ($type[$i] == 0) { }
2029 1 1 if ($ptheta >= 0 and $ttheta >= 0 or $ptheta < 0 and $ttheta < 0) { }
2034 0 1 if ($ttheta < 0) { }
2039 0 1 if ($ttheta <= $antip) { }
2054 2 0 if ($ptheta >= 0) { }
2055 0 2 if ($dtheta >= 0) { }
2059 2 0 if ($max >= -$dtheta) { }
2067 0 0 if ($dtheta >= 0) { }
2069 0 0 if ($max >= $dtheta) { }
2132 0 4 if ($x1 == $x2 and $y1 == $y2)
2135 0 4 if ($r <= 0)
2138 0 4 unless defined $move
2139 2 2 unless defined $larc
2140 3 1 unless defined $spf
2146 0 4 if $dx < 0
2152 1 3 if $spf
2156 0 4 if ($z > $d)
2163 1 3 if $larc
2170 1 3 if ($spf)
2185 1 3 if $move
2193 0 36 if (scalar @points == 0) { }
2251 1 1 shift() ? :
2265 1 1 shift() ? :
2307 1 1 shift() ? :
2409 29 5 if (scalar @clr == 1) { }
5 0 elsif (scalar @clr > 1) { }
2410 0 29 if (ref $clr[0]) { }
23 6 elsif ($clr[0] =~ /^[a-z#!]/i) { }
2 4 elsif ($clr[0] =~ /^%/) { }
2 2 elsif ($clr[0] =~ /^[\$\&]/) { }
2412 0 0 $sf ? :
0 0 $sf ? :
2418 14 9 $sf ? :
2423 1 1 $sf ? :
2428 2 0 unless (defined $self->resource('ColorSpace', 'LabS'))
2436 1 1 $sf ? :
1 1 $sf ? :
2441 1 1 $sf ? :
2448 1 4 if (ref $clr[0]) { }
2 2 elsif (scalar @clr == 3) { }
2 0 elsif (scalar @clr == 4) { }
2452 0 1 $sf ? :
0 1 $sf ? :
2468 1 1 $sf ? :
2476 1 1 $sf ? :
2492 0 16 unless (&Scalar::Util::looks_like_number($val))
2493 1 15 if ($val < $min) { }
2 13 elsif ($val > $max) { }
2505 0 19 if (ref($clrs[0]) =~ /^PDF::Builder::Resource::ColorSpace/) { }
0 19 elsif (ref($clrs[0]) =~ /^PDF::Builder::Resource::Pattern/) { }
2517 19 0 if (scalar @_) { }
2531 1 14 if (ref($clrs[0]) =~ /^PDF::Builder::Resource::ColorSpace/) { }
0 14 elsif (ref($clrs[0]) =~ /^PDF::Builder::Resource::Pattern/) { }
2543 15 0 if (scalar @_) { }
2627 0 6 unless (defined $y)
2628 0 6 unless (defined $x)
2630 0 6 if (defined $img->{'Metadata'})
2634 0 6 if (not defined $w) { }
0 6 elsif (not defined $h) { }
2647 0 6 if (defined $img->{'Metadata'})
2685 0 2 unless (defined $y)
2686 0 2 unless (defined $x)
2690 0 2 unless (defined $sx)
2691 2 0 unless (defined $sy)
2745 11 5 if (defined $space) { }
2781 14 5 if (defined $space) { }
2818 9 16 if (defined $scale) { }
2873 11 36 if (defined $leading) { }
2922 1 0 if (defined $mode) { }
2956 1 0 if (defined $dist) { }
2981 0 0 if (scalar @_) { }
2984 0 0 unless $state{$k}
2987 0 0 if ($state{'font'} and $state{'fontsize'})
2990 0 0 if ($state{'textmatrix'})
2997 0 0 if ($state{'fillcolor'})
3000 0 0 if ($state{'strokecolor'})
3036 1 16 if ($font->isvirtual) { }
3046 1 17 unless ($size)
3063 1 16 if ($font->isvirtual) { }
3128 3 1 if (defined $offset) { }
3161 1 22 if (defined $indent and $indent != 0)
3257 0 190 unless defined $text and length $text
3260 948 2 unless defined $opts{$k}
3355 0 0 if (ref $underline eq 'ARRAY') { }
3358 0 0 if ($underline eq 'none')
3361 0 0 if @underline % 2
3373 0 0 if (ref $thickness)
3377 0 0 if ($distance eq 'auto')
3380 0 0 if ($thickness eq 'auto')
3386 0 0 if (scalar @{$xy1;} > 2) { }
3414 0 0 if (ref $strikethru eq 'ARRAY') { }
3417 0 0 if ($strikethru eq 'none')
3420 0 0 if @strikethru % 2
3436 0 0 if (ref $thickness)
3440 0 0 if ($distance eq 'auto')
3443 0 0 if ($thickness eq 'auto')
3449 0 0 if (scalar @{$xy1;} > 2) { }
3476 1 30 if ($self->{' fontset'} == 0)
3477 1 0 unless (defined $self->{' font'} and $self->{' fontsize'})
3483 12 18 if (defined $opts{'-indent'})
3489 12 18 if (defined $opts{'-indent'}) { }
3502 0 30 if (defined $opts{'-underline'})
3506 0 30 if (defined $opts{'-strikethru'})
3517 0 0 if (defined $obj) { }
3705 0 0 if (defined $settings->{'language'})
3713 0 0 if ($feature ne '-kern')
3717 0 0 if ($dir eq 'T' or $dir eq 'B')
3720 0 0 if ($self->{' fontset'} == 0)
3721 0 0 unless (defined $self->{' font'} and $self->{' fontsize'})
3746 0 0 if ($dir eq 'L' or $dir eq 'T') { }
3747 0 0 if ($align eq 'B') { }
0 0 elsif ($align eq 'C') { }
3755 0 0 if ($align eq 'B') { }
0 0 elsif ($align eq 'C') { }
3763 0 0 if ($mult != 0)
3764 0 0 if ($dir eq 'L' or $dir eq 'R') { }
3786 0 0 if ($dokern)
3795 0 0 if ($kernPts != 0)
3796 0 0 if (int abs($kernPts * 1000 / $fontsize) + 0.5 <= $minKern)
3802 0 0 if ($dump and $cw != $ax)
3810 0 0 if ($dump)
3812 0 0 if ($glyph->{'name'} ne '')
3818 0 0 if (defined $glyph->{'axs'}) { }
0 0 elsif (defined $glyph->{'axsp'}) { }
0 0 elsif (defined $glyph->{'axr'}) { }
0 0 elsif (defined $glyph->{'axrp'}) { }
3828 0 0 if ($dump)
3831 0 0 if ($ay != 0 or $dx != 0 or $dy != 0)
3834 0 0 if ($kernPts != 0)
3845 0 0 if ($dy != 0) { }
3886 0 0 if ($dir eq 'L' or $dir eq 'T') { }
3887 0 0 if ($align eq 'B') { }
0 0 elsif ($align eq 'C') { }
3896 0 0 if ($align eq 'B') { }
0 0 elsif ($align eq 'C') { }
3903 0 0 if ($dir eq 'L' or $dir eq 'R') { }
3909 0 0 if ($dir eq 'L' or $dir eq 'R') { }
3917 0 0 if ($dir eq 'L' || $dir eq 'R' and $ulxy1[1] > $ulxy2[1] or $dir eq 'T' || $dir eq 'B' and $ulxy1[2] < $ulxy2[2])
3925 0 0 if (defined $opts{'-underline'})
3928 0 0 if (defined $opts{'-strikethru'})
3937 0 0 if ($self->{' openglyphlist'})
3944 0 0 unless ($self->{' openglyphlist'})
3959 0 0 unless ($self->{' openglyphlist'})
3965 0 0 if ($dx == $kern) { }
4046 0 0 if ($self->{' fontset'} == 0)
4047 0 0 unless (defined $self->{' font'} and $self->{' fontsize'})
4057 0 0 if ($dir eq 'T' or $dir eq 'B')
4079 0 0 if ($dir eq 'T' or $dir eq 'B')
4083 0 0 if (defined $glyph->{'axs'}) { }
0 0 elsif (defined $glyph->{'axsp'}) { }
0 0 elsif (defined $glyph->{'axr'}) { }
0 0 elsif (defined $glyph->{'axrp'}) { }
4092 0 0 if ($doKern)
4102 0 0 if ($kernPts > 0)
4103 0 0 if (int abs($kernPts * 1000 / $fontsize) + 0.5 <= $minKern)
4247 0 0 if (scalar @_)
4248 0 0 $self->{' poststream'} =~ /\s$/o ? :
4257 779 0 if (scalar @_)
4258 661 118 $self->{' stream'} =~ /\s$/o ? :
4267 0 0 if (scalar @_)
4316 21 0 unless ($self->_in_text_object)
4355 17 94 if ($self->_in_text_object)
4372 30 2 if ($self->{' apipage'}) { }
4380 0 2 if ref($dict) =~ /Objind$/
4383 0 2 if ref($dict->{$type}) =~ /Objind$/
4384 2 0 if (defined $obj) { }
4387 0 2 if ($force) { }