summaryrefslogtreecommitdiff
path: root/src/compile-unifont.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile-unifont.py')
-rwxr-xr-xsrc/compile-unifont.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/compile-unifont.py b/src/compile-unifont.py
index b4b8aca..4cc085d 100755
--- a/src/compile-unifont.py
+++ b/src/compile-unifont.py
@@ -29,10 +29,11 @@ def write_bin_entry(entry):
def write_bin(bits):
# write header-size
- sys.stdout.buffer.write(struct.pack('<I', 4))
+ sys.stdout.buffer.write(struct.pack('<I', 8))
# write header
- sys.stdout.buffer.write(struct.pack('<I', 33))
+ sys.stdout.buffer.write(struct.pack('<I', 1))
+ sys.stdout.buffer.write(struct.pack('<I', 32))
# write glyphs
for idx in range(len(bits)):
@@ -99,7 +100,8 @@ def parse_bin_entry(bits, chunk):
def parse_bin():
bits = []
- glyph_size = 33
+ glyph_header_size = 1
+ glyph_data_size = 32
# read header-size
chunk = sys.stdin.buffer.read(4)
@@ -114,11 +116,12 @@ def parse_bin():
if not chunk:
sys.exit("error: corrupted header");
- glyph_size = struct.unpack('<I', chunk[0:4])[0]
+ glyph_header_size = struct.unpack('<I', chunk[0:4])[0]
+ glyph_data_size = struct.unpack('<I', chunk[4:8])[0]
# read glyphs
while True:
- chunk = sys.stdin.buffer.read(glyph_size)
+ chunk = sys.stdin.buffer.read(glyph_header_size + glyph_data_size)
if chunk:
parse_bin_entry(bits, chunk)
else: