I’ve been enjoying tinkering about with AdaFruit’s PiTFT 2.8″ touchscreen for the Raspberry Pi. Working out how to display text and graphics on the screen using the frame buffer with, Python, my programming language of choice. It took little research to get text to display on the frame buffer. It took a little more to work out how to identify and list installed Truetype fonts. So I thought I’d post the code I used to list the Truetype fonts installed on a Raspberry Pi in case it proves helpful to others.
Truetype fonts are installed in the systems shared directories:
or in the user’s home directory:
A couple of good sources of free TrueType Fonts:
1001 Free Fonts
Code snippet lists the installed Truetype fonts from both locations. It is best run from a SSH login….
Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!