Typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts.

Overview

typesheet

typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts.

I made it because I couldn't find an easy option online while developing a game.

I welcome contributions, but I don't plan to spend more than a few minutes a month maintaining this repo.

an example of a generated image

an example image. switch to dark mode if you can't see it.

How to use

1. Install

pip install pillow tcod numpy

2. Use

See the usage string:

$ ./make_tileset.py -h
$ python3 make_tileset.py -h
usage: make_tileset.py [-h] --height HEIGHT [--width WIDTH] [-o OUT] input_file

positional arguments:
  input_file         A truetype (.ttf) font file.

options:
  -h, --help         show this help message and exit
  --height HEIGHT    Height of each glyph (bounding box) in pixels.
  --width WIDTH      Width of each glyph (bounding box) in pixels. (Optional)
  -o OUT, --out OUT  The output file. (Defaults to .png)

Exact command used to generate the example image:

python make_tileset.py Px437_IBM_Model3x_Alt3.ttf --width 8 --height 16

Font file was found at https://int10h.org/oldschool-pc-fonts

You might also like...
A simple programme for converting url into a qr code (.png file)
A simple programme for converting url into a qr code (.png file)

QrTk A simple lightweight programme for converting url into a qr code (.png file) Pre-Requisites Before installing the programme , you need to run the

Png2Jpg tool will help you convert from png image format to jpg images format.

PNG 2 JPG All codes assume running from root directory. Please update the sys path at the beginning of the codes before running. Over View Png2Jpg too

A proof-of-concept implementation of a parallel-decodable PNG format
A proof-of-concept implementation of a parallel-decodable PNG format

mtpng A parallelized PNG encoder in Rust by Brion Vibber [email protected] Background Compressing PNG files is a relatively slow operation at large imag

Convert bitmap images to seeds for Tiny-83 NFT project.
Convert bitmap images to seeds for Tiny-83 NFT project.

What is this? This tool allows you to convert any 14p high and 22p wide Bitmap (.bmp) to the seed needed for the Tiny-83 NFT project. Project Twitter:

Python framework for creating and scaling up production of vector graphics assets.

Board Game Factory Contributors are welcome here! See the end of readme. This is a vector-graphics framework intended for creating and scaling up prod

A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.

django-versatileimagefield A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for creat

Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation.

Description Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation. Double cl

Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures.
Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures.

WADs Out For [The] Ladies Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures. Development mostly focused on L

Hacking github graph with a easy python script
Hacking github graph with a easy python script

Hacking-Github-Graph Hacking github graph with a easy python script Requirements git latest version installed. A text editor (eg: vs code, sublime tex

Comments
  • Makes the ownership disclaimer official.

    Makes the ownership disclaimer official.

    Disclaiming ownership is not enough. The project must be licensed to grant the rights you want to give.

    If you don't care about attribution then The Unlicense is a good choice. This PR will apply that license.

    opened by HexDecimal 2
  • Clean up and refactor the entire project.

    Clean up and refactor the entire project.

    No longer creates a character map from tcod in a roundabout way. The character map is now made directly from tcod.tileset.CHARMAP_CP437.

    Several assumptions were removed from the render function. This now supports alternative character maps easily, or tilesets with different shapes and sizes.

    CLI options were refactored. The width and output file and now optional. The readme has been updated for the new options.

    Set the executable flag on make_tileset.py in Git.

    Cleaned up requirements. PIL isn't needed when pillow is installed. The requirements.txt file is standard.

    The code has been reformatted using Black and isort.

    opened by HexDecimal 1
Owner
Grayson Chao
If you're looking for OSINT you're in the wrong DOM element my friend
Grayson Chao
A Python Script to convert Normal PNG Image to Apple iDOT PNG Image.

idot-png-encoder A Python Script to convert Normal PNG Image to Apple iDOT PNG Image (Multi-threaded Decoding PNG). Usage idotpngencoder.py -i <inputf

Lrdcq 2 Feb 17, 2022
Png-to-stl - Converts PNG and text to SVG, and then extrudes that based on parameters

have ansible installed locally run ansible-playbook setup_application.yml this sets up directories, installs system packages, and sets up python envir

null 1 Jan 3, 2022
Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

null 1 Jan 16, 2022
With this simple py script you will be able to get all the .png from a folder and generate a yml for Oraxen

Oraxen-item-to-yml With this simple py script you will be able to get all the .png from a folder and generate a yml for Oraxen How to use Install the

Akex 1 Dec 29, 2021
Computer art based on joining transparent images

Computer Art There is no must in art because art is free. Introduction The following tutorial exaplains how to generate computer art based on a series

Computer Art 12 Jul 30, 2022
Transfers a image file(.png) to an Excel file(.xlsx)

Transfers a image file(.png) to an Excel file(.xlsx)

Junu Kwon 7 Feb 11, 2022
An API that renders HTML/CSS content to PNG using Chromium

html_png An API that renders HTML/CSS content to PNG using Chromium Disclaimer I am not responsible if you happen to make your own instance of this AP

null 10 Aug 8, 2022
Convert the SVG code to PNG and replace the line by a call to the image in markdown

Convert the SVG code to PNG and replace the line by a call to the image in markdown

null 6 Sep 6, 2022
Fast batch image resizer and rotator for JPEG and PNG images.

imgp is a command line image resizer and rotator for JPEG and PNG images.

Terminator X 921 Dec 25, 2022