line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#! perl |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
134169
|
use strict; |
|
2
|
|
|
|
|
24
|
|
|
2
|
|
|
|
|
58
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
5
|
2
|
|
|
2
|
|
1195
|
use utf8; |
|
2
|
|
|
|
|
29
|
|
|
2
|
|
|
|
|
10
|
|
6
|
2
|
|
|
2
|
|
62
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
132
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Text::Layout::Testing; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
802
|
use parent 'Text::Layout'; |
|
2
|
|
|
|
|
682
|
|
|
2
|
|
|
|
|
10
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
108
|
use Text::Layout::FontConfig; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
642
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $fc = Text::Layout::FontConfig->new( corefonts => 1 ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#### API |
17
|
|
|
|
|
|
|
sub new { |
18
|
2
|
|
|
2
|
1
|
174
|
my ( $pkg, @data ) = @_; |
19
|
2
|
|
|
|
|
21
|
my $self = $pkg->SUPER::new; |
20
|
2
|
|
|
|
|
59
|
$self->set_font_description( $fc->from_string("Times 10") ); |
21
|
2
|
|
|
|
|
8
|
$self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#### API |
25
|
|
|
|
|
|
|
sub render { |
26
|
0
|
|
|
0
|
0
|
0
|
my ( $self ) = @_; |
27
|
0
|
|
|
|
|
0
|
my $res = "Testing 1 2 3"; |
28
|
0
|
|
|
|
|
0
|
$res; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#### API |
32
|
|
|
|
|
|
|
sub bbox { |
33
|
0
|
|
|
0
|
0
|
0
|
my ( $self ) = @_; |
34
|
0
|
|
|
|
|
0
|
[ 0, -5, 10, 15 ]; # dummy |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#### API |
38
|
|
|
|
|
|
|
sub load_font { |
39
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $description ) = @_; |
40
|
0
|
|
|
|
|
0
|
return $description; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# For testing. |
44
|
|
|
|
|
|
|
sub _debug_text { |
45
|
19
|
|
|
19
|
|
48
|
my $c = $_[0]->{_content}; |
46
|
19
|
|
|
|
|
39
|
for my $f ( @$c ) { |
47
|
|
|
|
|
|
|
$f->{font} = $f->{font}->{loader_data} . "(" . |
48
|
|
|
|
|
|
|
join(",", $f->{font}->{family}, |
49
|
|
|
|
|
|
|
$f->{font}->{style}, |
50
|
|
|
|
|
|
|
$f->{font}->{weight}, |
51
|
58
|
|
66
|
|
|
282
|
$f->{font}->{size} // $f->{size}) . ")"; |
52
|
58
|
|
|
|
|
231
|
for ( keys %$f ) { |
53
|
|
|
|
|
|
|
$f->{$_} = sprintf("%.3f",$f->{$_}) |
54
|
754
|
100
|
66
|
|
|
1532
|
if $_ eq "size" && defined($f->{$_}) && int($f->{$_}) != $f->{$_}; |
|
|
|
100
|
|
|
|
|
55
|
|
|
|
|
|
|
next if defined($f->{$_}) |
56
|
754
|
100
|
100
|
|
|
2497
|
&& ! ( !$f->{$_} || /col/ && $f->{$_} eq 'black' ); |
|
|
|
100
|
|
|
|
|
57
|
567
|
|
|
|
|
863
|
delete $f->{$_}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
19
|
|
|
|
|
97
|
return $c; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |