Added script to generate src/zm_bigfont.h
Also added a line to the header of src/zm_bigfont.h on how it is generated.pull/1278/head
parent
cb1514193f
commit
226b77bb63
|
@ -2,6 +2,7 @@
|
|||
/* */
|
||||
/* Font file generated by schrorg */
|
||||
/* based on the font file generated by rthelen */
|
||||
/* using utils/mk_bigfont.pl */
|
||||
/* */
|
||||
/***********************************************************/
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $in_head = 1;
|
||||
|
||||
open F, '<', '../src/zm_font.h';
|
||||
|
||||
print <<EOHEAD;
|
||||
/***********************************************************/
|
||||
/* */
|
||||
/* Font file generated by schrorg */
|
||||
/* based on the font file generated by rthelen */
|
||||
/* using utils/mk_bigfont.pl */
|
||||
/* */
|
||||
/***********************************************************/
|
||||
EOHEAD
|
||||
|
||||
while (my $line = <F>) {
|
||||
$in_head-- if $line =~ /^$/ and $in_head;
|
||||
next while $in_head;
|
||||
unless ($line =~ /^\s+(0x..), \/\* (........)/) {
|
||||
$line =~ s/static unsigned char fontdata/static unsigned int bigfontdata/;
|
||||
print $line;
|
||||
next;
|
||||
}
|
||||
my $code = $1;
|
||||
my $bincode = $2;
|
||||
$bincode = "$1$1$2$2$3$3$4$4$5$5$6$6$7$7$8$8" if $bincode =~ /(.)(.)(.)(.)(.)(.)(.)(.)$/;
|
||||
$bincode =~ s/ /1/g;
|
||||
my $intcode = unpack("N", pack("B32", substr("0" x 32 . $bincode, -32)));
|
||||
my $hexcode = sprintf("%#x", $intcode);
|
||||
$hexcode =~ s/^0$/0x0/;
|
||||
$bincode =~ s/1/ /g;
|
||||
print sprintf("\t%10s, /* %s */\n", $hexcode, $bincode);
|
||||
print sprintf("\t%10s, /* %s */\n", $hexcode, $bincode);
|
||||
}
|
||||
|
||||
close F;
|
Loading…
Reference in New Issue