14 lines
302 B
Python
14 lines
302 B
Python
import base64
|
|
|
|
|
|
def font_to_base64(path) -> str:
|
|
with open(path, "rb") as f:
|
|
encoded = base64.b64encode(f.read()).decode("utf-8")
|
|
return encoded
|
|
|
|
|
|
if __name__ == '__main__':
|
|
font = font_to_base64("puffy.otf")
|
|
with open("font_as_base.txt", "w") as file:
|
|
file.write(font)
|