Skip to content

Python script to split one single Aseprite export into several PNG files, then convert the PNGs to SVG format, then convert those SVGs into a TTF font.

License

Notifications You must be signed in to change notification settings

kraasch/png2ttf

Repository files navigation

png2ttf

instructions

Will follow, but the idea is this:

  1. Use the aseprite template to design your own font in a pixel editor (export to .aseprite or to .png file).
  2. Run the script on your file.
  • Like this python3 png2ttf.py in_file.png or
  • like this python3 png2ttf.py in_file.svg.
  1. Receive a .ttf font as output.

todo

Basics:

  • chop png automatically.
  • create svgs automatically.
  • create ttf automatically.
  • add python REQUIREMENTS file.

Polish:

  • export to otf format too.
  • implement the whole thing for windows environments too.
  • deal with sub repo that converts png to svg (find essential code and replace. or integrate into this project).
  • modular tests in python, eg with cucumber or similar.
  • automatically export aseprite to png using python: eg with https://github.com/Eiyeron/py_aseprite

how it works (or will work)

Step one -- from aseprite to PNG: The user creates a new font using the template and saves it with a transparent background. After run by the user, png2ttf detects if it is run on a .png or an .aseprite file. Aseprite files are automatically converted into PNGs.

Step two -- chop chop: Then png2ttf chops the PNG into single file PNGs per glyph. The template's grid is used as the basis of where to split the PNG. Each cell in the template is associated with a specific glyph.

Step three -- from PNG to SVG: Each PNG file containing one glyph then is converted into a respective SVG file.

Step four -- from SVG to TTF: Each SVG file containing one glyph is compiled into a single TTF file using the FontForge project. Note: The FontForge project includes a python interpreter.

credits and license

Credits:

License:

resources

Interesting:

Misc:

About

Python script to split one single Aseprite export into several PNG files, then convert the PNGs to SVG format, then convert those SVGs into a TTF font.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published