I am working on displaying text on an 8x8 matrix display and I don't have a .ttf file handy that I know of on my BeagleBone.
According to an example here, I should be able to say font = ImageFont.load_default()
instead of loading a .ttf, but, this is clearly not specifying the dimensions of the font! Any way to do this? Alternatively, is there a place that you know for sure I can find a .ttf font on my BBB version of ubuntu 14.04.1?
import Image
import ImageDraw
import ImageFont
# Create blank image for drawing.
# Make sure to create image with mode '1' for 1-bit color.
width = disp.width
height = disp.height
image = Image.new('1', (width, height))
# Load default font.
font = ImageFont.load_default()
# Alternatively load a TTF font.
# Some other nice fonts to try: http://www.dafont.com/bitmap.php
#font = ImageFont.truetype('Minecraftia.ttf', 8)
# Write two lines of text.
draw.text((x, top), 'Hello', font=font, fill=255)
draw.text((x, top+20), 'World!', font=font, fill=255)