my ($w,$h,$xo,$yo,$y,$bitmap,$glyph);
my $modified=0;
%props = ();
+ my $anyinput=0;
while (<$inbdf>) {
+ $anyinput=1;
if ($state eq 'bitmap' && $y==$h) {
$glyph = uc $glyph;
$glyph =~ s/\;$//;
local ($_) = $glyph;
my $key= sprintf "%s,%d,%d,%d,%d", $foundry,$w,$h,$xo,$yo;
my $rules= loadrules($key);
- return (0,'no rules') if !$rules;
+ return 'no rules' if !$rules;
$rules->();
$modified += ($_ ne $glyph);
print $outbdf $_,"\n" or die $!
}
if ($state eq 'idle' && m/^FOUNDRY\s+/) {
die if defined $foundry;
- return (0,'foundry syntax') unless m/^FOUNDRY\s+\"(\w+)\"\s+/;
+ return 'foundry syntax' unless m/^FOUNDRY\s+\"(\w+)\"\s+/;
$foundry = $foundrymap{lc $1};
- return (0,'no foundry') unless defined $foundry;
+ return 'no foundry' unless defined $foundry;
$_ = "FOUNDRY \"$foundry\"\n";
}
if ($state eq 'idle' && m/^FONT\s+/) {
die if defined $font;
- return (0,'simple font name') unless m/^(FONT\s+)\-(\w+)\-/;
+ return 'simple font name' unless m/^(FONT\s+)\-(\w+)\-/;
$font = $foundrymap{lc $2};
- return (0,'no foundry') unless defined $font;
+ return 'no foundry' unless defined $font;
$_ = "FONT -$font-$'";
}
if ($state eq 'idle' && m/^STARTCHAR\s/) {
die unless defined $foundry;
die unless defined $font;
- return (0,'foundry != font') unless $foundry eq $font;
+ return 'foundry != font' unless $foundry eq $font;
$state='startchar';
$w=undef;
}
die $! if $inbdf->error;
die $! if $outbdf->error or !$outbdf->flush;
die unless $state eq 'idle';
+ return 'no bdf data' # also special cased in processpcfgz
+ if !$anyinput;
if ($modified) {
printf $logfile "%s: %d glyphs changed\n", $what, $modified
or die $!;