Posts: 10
Joined: Sun Nov 01, 2015 7:25 pm

Adafruit RGB LED HAT - Modify it for FONTS?

Fri Aug 25, 2017 1:50 pm

I am very new to the raspberry pi and I have a couple of Adafruit 64x32 RGB LED displays along with the Adafruit RGB LED HAT kit.

I have followed the steps to install and run the linux and python scripts so that I can see the demos on the display. Currently I have only 1 64x32 RGB LED matrix display connected to the HAT.

I have been trying to modify the example "" code to add in Font Text but I either get errors or nothing gets displayed.

I have added in the "import ImageFont" line under the other import lines (i.e. "import Image, Import ImageDraw, Import time").

I have "draw.text" commands in such as: "draw.text((10, 10), "test", font=ImageFont.load("arial.pil")
also tried:

"draw.text((10, 10), "hello", font=ImageFont.load_default())"


"font = ImageFont.truetype("FreeMono.ttf", 15)"
"draw.text((10, 10), "hello", font=font)"

then I have the "matrix.Clear" which causes an error. I can remove and continue on but nothing gets displays other than the rest of the example code.

matrix.SetImage(, 0, 0)

Can someone help out a new beginer out?
Thank you - Tim

Posts: 10
Joined: Sun Nov 01, 2015 7:25 pm

Re: Adafruit RGB LED HAT - Modify it for FONTS?

Sun Aug 27, 2017 2:34 am

I have made some progress modifying the "" to display text on my 64x32 RGB LED matrix by Adafruit. The biggest problem I have not that the errors are being able to display a color for the text. No mater what value I make "Fill=", it always shows up as white (unless I use the option "Fill=0" or "Fill=None" then they entire text is blanked out as it should. How to I set a color for the text? I have researched on the web so much and run out of ideas to try next on my Raspberry Pi 3.

Please help me - Thank you - Tim

Code: Select all

import Image
import ImageDraw
import time
import ImageFont

from rgbmatrix import Adafruit_RGBmatrix

matrix = Adafruit_RGBmatrix(32, 2)

image ="1", (64, 32))
draw = ImageDraw.Draw(image)

font = ImageFont.truetype("Lato-Thin.ttf", 10)

draw.text((0, -3), "ABCDEFGHUJKLMNO", font=font1, fill=1)
draw.text((0, 20), "abcdefghijklmno", font=font1, fill=1)

matrix.SetImage(, 0, 0)


Posts: 1
Joined: Fri Feb 09, 2018 8:42 pm

Re: Adafruit RGB LED HAT - Modify it for FONTS?

Fri Feb 09, 2018 8:45 pm


for color : fill = (255, 255, 255) for black or ( 0, 0, 255) for red, you can change value.

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 2 guests