summaryrefslogtreecommitdiffstatshomepage
path: root/src/build/png2bdc.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/png2bdc.py')
-rw-r--r--src/build/png2bdc.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/build/png2bdc.py b/src/build/png2bdc.py
index 7d4d7df5d3e..9609b1d761b 100644
--- a/src/build/png2bdc.py
+++ b/src/build/png2bdc.py
@@ -121,22 +121,23 @@ def renderFontSaveCached(font, filename, hash32):
fp.write('o')
fp.write('n')
fp.write('t')
- fp.write(bytearray([hash32 >> 24 & 0xff]))
- fp.write(bytearray([hash32 >> 16 & 0xff]))
- fp.write(bytearray([hash32 >> 8 & 0xff]))
- fp.write(bytearray([hash32 >> 0 & 0xff]))
- fp.write(bytearray([font.height >> 8 & 0xff]))
- fp.write(bytearray([font.height >> 0 & 0xff]))
- fp.write(bytearray([font.yOffs >> 8 & 0xff]))
- fp.write(bytearray([font.yOffs >> 0 & 0xff]))
- fp.write(bytearray([numChars >> 24 & 0xff]))
- fp.write(bytearray([numChars >> 16 & 0xff]))
- fp.write(bytearray([numChars >> 8 & 0xff]))
- fp.write(bytearray([numChars >> 0 & 0xff]))
+ fp.write(chr(hash32 >> 24 & 0xff))
+ fp.write(chr(hash32 >> 16 & 0xff))
+ fp.write(chr(hash32 >> 8 & 0xff))
+ fp.write(chr(hash32 >> 0 & 0xff))
+ fp.write(chr(font.height >> 8 & 0xff))
+ fp.write(chr(font.height >> 0 & 0xff))
+ fp.write(chr(font.yOffs >> 8 & 0xff))
+ fp.write(chr(font.yOffs >> 0 & 0xff))
+ fp.write(chr(numChars >> 24 & 0xff))
+ fp.write(chr(numChars >> 16 & 0xff))
+ fp.write(chr(numChars >> 8 & 0xff))
+ fp.write(chr(numChars >> 0 & 0xff))
# Write a blank table at first (?)
charTable = [0]*(numChars * CACHED_CHAR_SIZE)
- fp.write(bytearray(charTable))
+ for i in range(numChars * CACHED_CHAR_SIZE):
+ fp.write(chr(charTable[i]))
# Loop over all characters
tableIndex = 0
@@ -171,7 +172,8 @@ def renderFontSaveCached(font, filename, hash32):
dBuffer.append(accum)
# Write the data
- fp.write(bytearray(dBuffer))
+ for j in range(len(dBuffer)):
+ fp.write(chr(dBuffer[j]))
destIndex = tableIndex * CACHED_CHAR_SIZE
charTable[destIndex + 0] = i >> 8 & 0xff
@@ -190,7 +192,8 @@ def renderFontSaveCached(font, filename, hash32):
# Seek back to the beginning and rewrite the table
fp.seek(CACHED_HEADER_SIZE, 0)
- fp.write(bytearray(charTable))
+ for i in range(numChars * CACHED_CHAR_SIZE):
+ fp.write(chr(charTable[i]))
fp.close()
return 0