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