Skip to content

The purpose of this script is to get image files of each individual character of any .ttf format fonts automatically on multiple fonts

Notifications You must be signed in to change notification settings

YourFriendlyNeighborhoodMONKE/Bulk-font2image-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Bulk-font2image-tool

image

About:

The purpose of this script is to create image files of each individual character of any .ttf format fonts automatically on multiple fonts at the same time just by running the script

With this script, you will get 600x600 pixel PNG files of the following images:

  • English alphabet letters
  • Numbers 0-9
  • Special characters: !"#$%&'()*+, -./:;<=>?@[]^_`{|}~

By default the images are captioned (named) in the following format:

letter/number/abbreviated name of special character, char, whitebg, name of the font

For example:

  • 4, char, whitebg, Arial
  • d, char, whitebg, TimesNewRoman
  • semicolon, whitebg, ComicSans (hehe)

The caption formatting can be changed in the last line of code, marked by the comment pointing to the segment {symbol_name}, char, whitebg, {font-path}.png

  • If you refer this to the above examples, it is easy to figure out which part does what

For example, if you want to remove everything but the name of the character, remove ", char, whitebg, {font_path}" portion from the code

The naming for the special characters have been abbreviated on purpose

  • If you wish to change any of the abbreviated names for special characters, you can just edit the fonts.py file where you find the list
  • Be aware that you cannot use many of those characters in the filename itself, which is the reason for giving them English names

Instructions:

  • Make an empty folder, name it whatever you want
  • Paste the fonts.py script into that folder
  • Go to C:\Windows\Fonts/ and select which fonts you would like to use
  • Copy these fonts into the folder you just created
  • Open Command Prompt into this directory
  • Type: python fonts.py
  • Hit Enter key

The script will automatically make subfolders based on the filename of each font and save images of each character into the subfolders.

  • You might want to edit the names of the fonts separately if you want the output filenames to be cleaner
  • Alternatively just remove the {font_path} portion to remove the font names from the filename as described above

This process might take a while if you have a lot of fonts so please be patient

Final Thoughts:

  • Please review the results keeping in mind that some fonts might escape the boundaries of the image. This usually doesn't happen with most fonts

  • Also remember that you are liable and responsible to check the license and terms of use for each font

  • Have a banana and enjoy!

Examples:

Times New Roman:

h, char, whitebg, Times 4, char, whitebg, Times underscore, char, whitebg, Times percent, char, whitebg, Times

Courier New:

b, char, whitebg, CourierNew ltsign, char, whitebg, CourierNew 4, char, whitebg, CourierNew rcurly, char, whitebg, CourierNew

About

The purpose of this script is to get image files of each individual character of any .ttf format fonts automatically on multiple fonts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages