0
|
1 #!/usr/bin/perl
|
|
2 use strict;
|
|
3
|
|
4 my ($name,$encoding,@bitmap);
|
|
5
|
|
6 while(<>) {
|
|
7 last if (/^ENDPROP/);
|
|
8 }
|
|
9
|
|
10 my $dum = <>; # skip CHARS
|
|
11
|
|
12 while(<>) {
|
|
13 if(/^STARTCHAR\s+(.*)/) { &init(); $name=$1; print;
|
|
14 } elsif (/^ENCODING\s+(\d+)/) { $encoding=$1; print;
|
|
15 } elsif (/^SWIDTH (\d+) (\d+)/) { print;
|
|
16 } elsif (/^DWIDTH (\d+) (\d+)/) { print;
|
|
17 } elsif (/^BBX ([-+\d]+) ([-+\d]+) ([-+\d]+) ([-+\d]+)/) { print;
|
|
18 } elsif (/^BITMAP/) { print;
|
|
19 } elsif (/^ENDCHAR/) { &display();
|
|
20 } elsif (/^[0-9a-zA-Z]/) { chop; push(@bitmap,$_);
|
|
21 }
|
|
22 }
|
|
23
|
|
24 sub display {
|
|
25 for my $hex (@bitmap) {
|
|
26 my $h = pack("H*",$hex);
|
|
27 my $b = unpack("B*",$h);
|
|
28 $b =~ s/./$&$&/g;
|
|
29 $b =~ tr/01/ */;
|
|
30 print "$b\n";
|
|
31 }
|
|
32 print "\n";
|
|
33 }
|
|
34
|
|
35 sub init {
|
|
36 $name = '';
|
|
37 $encoding = 0;
|
|
38 @bitmap= ();
|
|
39 }
|