forked from dhepper/font8x8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GNU Unifont format hex font conversions
- Loading branch information
Showing
14 changed files
with
1,509 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
all: parts latin full | ||
|
||
parts: | ||
./convert_h_to_hexfont.pl ../font8x8_basic.h > font8x8_basic.hex | ||
./convert_h_to_hexfont.pl ../font8x8_box.h > font8x8_box.hex | ||
./convert_h_to_hexfont.pl ../font8x8_block.h > font8x8_block.hex | ||
./convert_h_to_hexfont.pl ../font8x8_control.h > font8x8_control.hex | ||
./convert_h_to_hexfont.pl ../font8x8_ext_latin.h > font8x8_ext_latin.hex | ||
./convert_h_to_hexfont.pl ../font8x8_greek.h > font8x8_greek.hex | ||
./convert_h_to_hexfont.pl ../font8x8_hiragana.h > font8x8_hiragana.hex | ||
./convert_h_to_hexfont.pl ../font8x8_misc.h > font8x8_misc.hex | ||
./convert_h_to_hexfont.pl ../font8x8_sga.h > font8x8_sga.hex | ||
|
||
latin: | ||
./convert_h_to_hexfont.pl ../font8x8_basic.h > font8x8_latin.hex | ||
./convert_h_to_hexfont.pl ../font8x8_control.h >> font8x8_latin.hex | ||
./convert_h_to_hexfont.pl ../font8x8_ext_latin.h >> font8x8_latin.hex | ||
|
||
full: | ||
./convert_h_to_hexfont.pl ../font8x8_basic.h > font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_control.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_ext_latin.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_greek.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_misc.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_box.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_block.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_hiragana.h >> font8x8.hex | ||
./convert_h_to_hexfont.pl ../font8x8_sga.h >> font8x8.hex | ||
|
||
clean: | ||
rm *.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Hexfont format conversions for the font8x8 | ||
============================================================================== | ||
|
||
Author: Konrad Markus <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
|
||
my $reversebytestr = sub { | ||
my $bs = shift(@_); | ||
return sprintf "%02X", ord pack "B*", scalar reverse sprintf("%b", hex($bs)) | ||
}; | ||
|
||
for (<>) { | ||
if (my @matches = /\s*{\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2}),\s*0x([0-9A-Fa-f]{2})\s*}[^\/]*\/\/\s*U\+([0-9A-Fa-f]{4})/g) { | ||
my $index = $matches[8]; | ||
my @bytes = @matches[0,1,2,3,4,5,6,7]; | ||
my @revbytes = map $reversebytestr->($_), @bytes; | ||
print "$index:", join("", @revbytes), "\n"; | ||
} | ||
} |
Oops, something went wrong.