line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Xorg::XLFD; |
2
|
1
|
|
|
1
|
|
56639
|
no warnings 'experimental::smartmatch'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
BEGIN { |
6
|
1
|
|
|
1
|
|
4
|
use Exporter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
7
|
1
|
|
|
1
|
|
4
|
use vars qw($VERSION @ISA @EXPORT_OK); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
89
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
$VERSION = '0.132'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
19
|
@ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
432
|
@EXPORT_OK = qw(get_xlfd); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get_xlfd { |
18
|
0
|
|
|
0
|
1
|
|
my $fam = shift; # fixed |
19
|
0
|
|
|
|
|
|
my %fonts; |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
open(my $fh, '-|', 'xlsfonts') or croak("xlsfonts: $!\n"); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
while(<$fh>) { |
24
|
0
|
|
|
|
|
|
chomp; |
25
|
0
|
|
|
|
|
|
$_ =~ s/^-//; |
26
|
0
|
|
|
|
|
|
my($foundary, $family, $weight, $slant, $set_width, $pixels, $tenths, |
27
|
|
|
|
|
|
|
$h_dpi, $v_dpi, $spacing, $avg_width, $charset) |
28
|
|
|
|
|
|
|
= split(/--?/, $_); |
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
0
|
|
|
|
if( ($family =~ /^\d+$/m) or ($family eq '') ) { |
31
|
0
|
|
|
|
|
|
next; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{weight}}, $weight) |
35
|
0
|
0
|
|
|
|
|
unless $weight ~~ @{$fonts{family}->{$family}->{weight}}; |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{width}}, $avg_width) |
38
|
0
|
0
|
|
|
|
|
unless $avg_width ~~ @{$fonts{family}->{$family}->{width}}; |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{vert_dpi}}, $v_dpi) |
41
|
0
|
0
|
|
|
|
|
unless $v_dpi ~~ @{$fonts{family}->{$family}->{vert_dpi}}; |
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{horiz_dpi}}, $h_dpi) |
44
|
0
|
0
|
|
|
|
|
unless $h_dpi ~~ @{$fonts{family}->{$family}->{horiz_dpi}}; |
|
0
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{tenths}}, $tenths) |
47
|
0
|
0
|
|
|
|
|
unless $tenths ~~ @{$fonts{family}->{$family}->{tenths}}; |
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{spacing}}, $spacing) |
50
|
0
|
0
|
|
|
|
|
unless $spacing ~~ @{$fonts{family}->{$family}->{spacing}}; |
|
0
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{slant}}, $slant) |
53
|
0
|
0
|
|
|
|
|
unless $slant ~~ @{$fonts{family}->{$family}->{slant}}; |
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{'set width'}}, $set_width) |
56
|
0
|
0
|
|
|
|
|
unless $set_width ~~ @{$fonts{family}->{$family}->{'set width'}}; |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{pixels}}, $pixels) |
59
|
0
|
0
|
|
|
|
|
unless $pixels ~~ @{$fonts{family}->{$family}->{pixels}}; |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{charset}}, $charset) |
62
|
0
|
0
|
|
|
|
|
unless $charset ~~ @{$fonts{family}->{$family}->{charset}}; |
|
0
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
push(@{$fonts{family}->{$family}->{foundary}}, $foundary) |
65
|
0
|
0
|
|
|
|
|
unless $foundary ~~ @{$fonts{family}->{$family}->{foundary}}; |
|
0
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
return (exists($fonts{family}{$fam})) |
69
|
0
|
0
|
|
|
|
|
? $fonts{family}{$fam} |
70
|
|
|
|
|
|
|
: \%fonts |
71
|
|
|
|
|
|
|
; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |