Page 1 of 1

Importing or converting .ttf font.

Posted: Mon Nov 15, 2021 4:28 am
by Sliff2000
I've noticed all the fonts for the menu end with .pf. I have a few .ttf fonts I would like to bring over to my mister. Is there a tool? I have looked to no avail. I am including the two fonts I would like to add/convert -- maybe someone will sprinkle some faery dust on them ;) . Thanks.

Re: Importing or converting .ttf font.

Posted: Mon Nov 15, 2021 10:19 pm
by bbond007
Sliff2000 wrote: Mon Nov 15, 2021 4:28 am I've noticed all the fonts for the menu end with .pf. I have a few .ttf fonts I would like to bring over to my mister. Is there a tool? I have looked to no avail. I am including the two fonts I would like to add/convert -- maybe someone will sprinkle some faery dust on them ;) . Thanks.

TTF fonts are vector font and MiSTer takes bitmap fonts, but I thought I'd try and make a tool to convert them. Keep in mind that not all vector fonts are going to scale down well to 8x8 pix.
FontConverter.png
FontConverter.png (10.69 KiB) Viewed 3161 times
First step: Convert TFF to PNG

Load TFF file
Make tweaks (size)
Save PNG file

Second step: Convert PNG to PF

Code: Select all

py png2pf.py -i FONT.PNG -o FONT.PF -p PREVIEW.PNG
if you get an error about 'PNG':

Code: Select all

pip install pypng
Hope that helps:
MiSTerFontConverter.zip
(10.42 KiB) Downloaded 142 times
--> https://github.com/bbond007/MiSTerFontConverter
Python --> https://www.python.org/downloads/
png2pf.py --> https://github.com/MiSTer-devel/Fonts_M ... /png2pf.py

Re: Importing or converting .ttf font.

Posted: Tue Nov 16, 2021 12:57 am
by Sliff2000
Wow, pretty awesome. Fantastic start -- Thank you!

Re: Importing or converting .ttf font.

Posted: Tue Nov 16, 2021 12:37 pm
by Sliff2000
I am including in my finds an 8x8 pf editor. You can also open multiple instances and copy and paste between them so you can add the system icons ((status bars, wifi, etc..)).

https://www.min.at/prinz/o/software/pixelfont/