peterhinch / micropython-font-to-py

A Python 3 utility to convert fonts to Python source capable of being frozen as bytecode
MIT License
368 stars 67 forks source link

Not able to create font #27

Closed pynadjim closed 4 years ago

pynadjim commented 4 years ago

Hi I am not able to create font using the font_to_py.py. I want to create freesans24.py and freesans36.py

peterhinch commented 4 years ago

It would help if you explained the nature of your difficulty. This works here:

[adminpete@capybara]: /mnt/qnap2/data/Projects/MicroPython/micropython-font-to-py
$ ./font_to_py.py -x FreeSans.otf 24 freesans24.py
Writing Python font file.
Height set in 2 passes. Actual height 24 pixels.
Max character width 25 pixels.
freesans24.py written successfully.
Down10 commented 4 years ago

I was having problems with this same issue myself, but the script worked once I changed the first line of _font_topy.py (and _fonttest.py) from this: #! /usr/bin/python3 to this: #!/usr/bin/env python3

So perhaps those files ought to be updated, to allow for alternate Python install environments.

peterhinch commented 4 years ago

Thanks for that. Now done.