Branch Coverage

lib/ChordPro/Output/PDF/Writer.pm
Criterion Covered Total %
branch 84 296 28.3


line true false branch
38 0 8 if $regtest
42 0 8 if $ps->{'page_layout'}
51 8 0 if ($pdfapi eq 'PDF::API2') { }
0 0 elsif ($pdfapi eq 'PDF::Builder') { }
57 0 8 if $apiversion < "2.045"
61 8 0 if $apiversion < 999
66 8 0 if $apiversion < 999
75 0 0 if $apiversion < 999
93 8 0 if ($self->{'pdf'}->can('info_metadata')) { }
97 8 0 if ($main::config->{'debug'}{'runtimeinfo'})
110 0 8 $regtest ? :
133 0 0 unless defined $s
135 0 0 if ($s =~ /\S/)
149 497 0 if (not defined $col or $col =~ /^foreground(?:-medium|-light)?$/) { }
0 0 elsif ($col eq 'background') { }
0 0 elsif (not $col) { }
163 545 48 if (not defined $col or $col eq 'background') { }
48 0 elsif ($col =~ /^foreground(?:-medium|-light)?$/) { }
0 0 elsif (not $col) { }
179 0 1182 if (/\x{266f}/)
180 0 0 unless ($font->{'has_sharp'} //= $font->{'fd'}{'font'}->glyphByUni(9839) ne ".notdef")
185 0 1182 if (/\x{266d}/)
186 0 0 unless ($font->{'has_flat'} //= $font->{'fd'}{'font'}->glyphByUni(9837) ne ".notdef")
191 0 1182 if (/\x{394}/)
192 0 0 unless ($font->{'has_delta'} //= $font->{'fd'}{'font'}->glyphByUni(916) ne ".notdef")
213 0 497 if ($nomarkup) { }
220 0 497 unless $_->{'type'} eq "text"
232 497 0 if $bgcol and $bgcol =~ /^no(?:ne)?$/i
233 0 497 $ENV{'CHORDPRO_DEBUG_TEXT'} ? :
235 0 497 if $frame and $frame =~ /^no(?:ne)?$/i
236 0 497 if ($bgcol or $frame)
237 0 0 if $debug
240 0 0 $debug ? :
241 0 0 if $frame
258 0 449 unless $size ||= $font->{'size'}
284 0 685 if (wantarray) { }
297 0 0 if (wantarray) { }
345 0 0 if $strokecolor
346 0 0 if $fillcolor
350 0 0 if $fillcolor and not $strokecolor
351 0 0 if $fillcolor and $strokecolor
352 0 0 if $strokecolor and not $fillcolor
358 0 0 unless $lw
361 0 0 if $strokecolor
362 0 0 if $fillcolor
367 0 0 if $fillcolor and not $strokecolor
368 0 0 if $fillcolor and $strokecolor
369 0 0 if $strokecolor and not $fillcolor
377 0 0 if $strokecolor
378 0 0 if $fillcolor
381 0 0 if $fillcolor and not $strokecolor
382 0 0 if $fillcolor and $strokecolor
383 0 0 if $strokecolor and not $fillcolor
391 0 0 if $strokecolor
396 0 0 if $strokecolor
399 0 0 if $strokecolor
413 0 0 if ($subtype eq "delegate")
417 0 0 if ($elt->{'data'})
420 0 0 if $main::config->{'debug'}{'images'}
425 0 0 if (not $subtype and $uri =~ /\.(\w+)$/)
429 0 0 if ($subtype =~ /^(jpg|png|gif)$/) { }
0 0 elsif ($subtype =~ /^(xform)$/) { }
432 0 0 if $main::config->{'debug'}{'images'}
440 0 0 if $main::config->{'debug'}{'images'}
474 0 0 if $main::config->{'debug'}{'images'}
476 0 0 if $main::config->{'debug'}{'images'}
477 0 0 if ($va eq 'top') { }
0 0 elsif ($va eq 'middle') { }
483 0 0 if ($ha eq 'right') { }
0 0 elsif ($ha eq 'center') { }
490 0 0 if $main::config->{'debug'}{'images'}
492 0 0 if (ref($o) =~ /::Resource::XObject::Image::/) { }
503 0 0 if ($options{'border'})
509 0 0 unless ($trbl =~ /^[trbl]*$/)
513 0 0 if $bc
514 0 0 if ($trbl =~ /t/ and $trbl =~ /r/ and $trbl =~ /b/ and $trbl =~ /l/) { }
0 0 elsif ($trbl) { }
523 0 0 if $trbl =~ /l/
524 0 0 if $trbl =~ /b/
525 0 0 if $trbl =~ /r/
526 0 0 if $trbl =~ /t/
531 0 0 if ($options{'href'})
579 10 54 if $page == $self->{'pdf'}->pages + 1
587 0 64 unless ($ps->{'theme'}{'background'} =~ /^white|none|#ffffff$/i)
616 0 0 defined $even ? :
0 0 if exists $main::config->{'debug'}{'pagealign'} and $main::config->{'debug'}{'pagealign'}
625 29 29 if $even xor is_odd($page)
626 4 25 unless $pagectrl->{'dual_pages'}
627 1 24 unless $pagectrl->{'align_songs'}
634 0 24 if ($bg = $ps->{'formats'}{'filler'}{'background'} and $ffile = expand_tilde($bg) and $filler = $self->{'pdfapi'}->open($ffile)) { }
642 0 0 if ($file ne $ffile or not @pages)
661 0 40 unless $self->{'pdfpage'}
669 0 0 unless $bg
670 0 0 if $pg > $bg->pages
680 0 0 unless $pdf
694 30 0 if ($c) { }
695 0 22 $style eq 'alpha' ? :
0 22 $style eq 'Alpha' ? :
8 22 $style eq 'roman' ? :
0 30 $style eq 'Roman' ? :
22 8 defined $prefix ? :
704 0 0 defined $prefix ? :
713 0 8 unless $bk and @$bk
721 8 16 if is_true($ctl->{'omit'} // 0)
724 0 16 if (@{$ctl->{'fields'};} == 1 and $ctl->{'fields'}[0] eq 'bookmark') { }
738 0 16 unless @$book
746 0 16 if (@{$self->{'ps'}{'outlines'};} == 1) { }
748 0 0 if $ctl->{'collapse'}
753 0 16 if $ctl->{'collapse'}
758 16 0 if ($ctl->{'letter'} > 0)
771 0 16 if ($needlh) { }
777 0 0 unless (defined $cur_ol and $let eq $cur_let)
788 0 0 unless ref $p
796 0 16 if (@$book == 1 and ref $book->[0] eq "ChordPro::Song")
806 48 0 unless ref $p
847 0 8 if $main::config->{'debug'}{'pages'} & 4
849 8 0 if ($file and $file ne '-') { }
872 0 40 if $d[-2] eq "fonts/"
874 40 40 unless $fontdir
876 40 0 if (fs_test('d', $fontdir)) { }
893 0 40 if CP()->packager
895 40 0 unless (defined $remap)
913 0 480 unless fs_test("fs", "$dir/$font")
915 40 0 if $have
918 40 0 if $remap
925 0 1640 if (is_hashref($v)) { }
933 0 440 if @fam > 1
937 0 880 unless $self->init_font($ff)
940 0 40 if $fail
947 40 840 if ($ps->{'fonts'}{$ff}{'file'}) { }
80 760 elsif ($ps->{'fonts'}{$ff}{'description'}) { }
760 0 elsif ($ps->{'fonts'}{$ff}{'name'}) { }
956 0 880 unless $fd
967 0 80 unless eval { do { $font->{'fd'} = $fc->from_string($font->{'description'}); $font->{'fd'}->get_font($self->{'layout'}); $font->{'fd'}{'font'}{'Name'}{'val'} =~ s/~.*/~$faketime/ if $regtest; $font->{'_ff'} = $ff; $font->{'fd'}->set_shaping(($font->{'fd'}->get_shaping || $font->{'shaping'}) // 0); $font->{'size'} = $font->{'fd'}->get_size if $font->{'fd'}->get_size; 1 } }
970 0 80 if $regtest
973 40 40 if $font->{'fd'}->get_size
989 0 40 if $regtest
1002 0 760 unless $cf
1020 0 0 unless fs_test("f", $file)
1061 0 54 if is_arrayref($name)
1072 0 54 unless defined $name
1079 0 0 $name eq 'top' ? :
1093 0 0 if ($_[0] and $_[0] =~ /^-/) { }
1106 0 0 if (%options) { }
1107 0 0 if ($dest =~ m[^/(.+)]) { }
1118 0 0 if defined $options{'-rect'}
1119 0 0 if defined $options{'-border'}
1134 0 4522 unless ($obj =~ /^PDF::API2/)