Skip to content

Instantly share code, notes, and snippets.

@DatanoiseTV
Created August 6, 2014 13:20
Show Gist options
  • Save DatanoiseTV/9c38c46be3e66ee2a38b to your computer and use it in GitHub Desktop.
Save DatanoiseTV/9c38c46be3e66ee2a38b to your computer and use it in GitHub Desktop.
import ImageFont, ImageDraw, Image
fontSize = 32
fontWidth = 20
numFonts = 3
image = Image.new( 'RGB', (fontWidth*127,fontSize*numFonts), "black")
draw = ImageDraw.Draw(image)
font = ImageFont.truetype("whitrabt.ttf", fontSize)
font2 = ImageFont.truetype("saxmono.ttf", fontSize)
font3 = ImageFont.truetype("MODENINE.TTF", fontSize)
# ASCII Characters from 32 DEC to 127 are visible
for x in range(32,127):
draw.text(((x)*20, 0),chr( x), font=font)
draw.text(((x)*20, 32),chr( x), font=font2)
draw.text(((x)*20, 64),chr( x), font=font3)
image = image.convert('L')
image.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment