Really simple python script to extract every character of a monospace font from an image
From an image of the characters of a font, which has to be monospace, it will automatically create a folder with an image for each character. Input image exemple :
Output images exemple :
First we need to know exactly what are height dimension in pixel we want for each character's image. For exemple let's say we want images with 128 pixels height and make it very long.
Go to google slide or equivalent.
Then change the dimension of the page as I made for exemple on this slide.
Be sure the font you choose is a monospace one
Then write all the characters you can as above
Be sure the starting block of the first character is bordered the slide and the last character is taking all the horizontal block (for exemple the _ char on the the image)
Then export it to .png image with the {Font Name}_{ALL_THE_CHARS}.png
as instance: {Courier Prime}_{ABCDEFG_}.png
by copy pasting the char written in the slide.
And finally move the image into the font_images/
folder and run the python script.
python3 font_extractor.py
You can change the parameter on the top of the script for example for the SIZE = (64, 128)
by default.