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
- Freeware 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!
Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground” – Adafruit’s Apps!
No comments yet.
Sorry, the comment form is closed at this time.