Created
March 3, 2012 16:43
-
-
Save take-cheeze/1966931 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import sys | |
import zlib | |
import Image | |
print "// openning", sys.argv[1] | |
img = Image.open(sys.argv[1]) | |
width, height = img.size | |
assert(width == 12*13) | |
assert(height == 12*4) | |
print "uint16_t const EXFONT[26*2][12][12] {" | |
for base_y in xrange(4): | |
for base_x in xrange(13): | |
print "{" | |
for y in xrange(12): | |
mask = 0; | |
for x in xrange(12): | |
if img.getpixel((12 * base_x + x, 12 * base_y + y)): | |
mask |= 0x01 << x | |
print mask, "," | |
print "}," | |
print "}; // EXFONT" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment