2015-11-04 00:16:12 +03:00
|
|
|
#!/usr/bin/env python
|
2015-05-23 13:28:41 +03:00
|
|
|
from __future__ import print_function
|
2019-07-06 23:40:53 +03:00
|
|
|
|
2014-07-07 23:31:20 +04:00
|
|
|
import base64
|
|
|
|
import os
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
# create font data chunk for embedding
|
|
|
|
font = "Tests/images/courB08"
|
|
|
|
print(" f._load_pilfont_data(")
|
|
|
|
print(" # %s" % os.path.basename(font))
|
|
|
|
print(" BytesIO(base64.decodestring(b'''")
|
2018-11-13 13:45:52 +03:00
|
|
|
with open(font + ".pil", "rb") as fp:
|
|
|
|
print(base64.b64encode(fp.read()).decode())
|
2014-07-07 23:31:20 +04:00
|
|
|
print("''')), Image.open(BytesIO(base64.decodestring(b'''")
|
2018-11-13 13:45:52 +03:00
|
|
|
with open(font + ".pbm", "rb") as fp:
|
|
|
|
print(base64.b64encode(fp.read()).decode())
|
2014-07-07 23:31:20 +04:00
|
|
|
print("'''))))")
|