Interstate75 - vector_text.py

Hi, I have a problem with the Pimoroni Interstate75 - vector_text.py. I converted a font called Times_New_Roman_Bolt.ttf into Times_New_Roman_Bold.af and uploaded this font to the Pi Pico. Then I tried to run it. The program works, it doesn’t give me any errors, but it doesn’t show any text on the matrix.

I tried changing the font size and its position on the matrix, but I still couldn’t see the text.
On the other hand, when I use the example font cherry-hq.af, everything works fine and the text shows up correctly.
I also tried fonts from alright-fonts, but they also don’t display any text on the matrix.
I ran the alright-fonts code on a Linux system (Kali Linux).

The link for Pimoroni Interstate75:

The link for Times New Roman:

Here is the code:

"""
Vector font demo! Vector fonts are slower but smoother. They are best used for large text.

You will need to copy the .af font file to your I75.
(this script assumes it is in the /basic directory).

Find out how to convert your own fonts to .af here: https://github.com/lowfatcode/alright-fonts
"""

from interstate75 import Interstate75, DISPLAY_INTERSTATE75_64X32
from picovector import ANTIALIAS_BEST, PicoVector, Transform


i75 = Interstate75(display=DISPLAY_INTERSTATE75_64X32)
display = i75.display

WIDTH = i75.width
HEIGHT = i75.height

# Couple of colours for use later
PINK = display.create_pen(250, 125, 180)
BLACK = display.create_pen(0, 0, 0)

# Pico Vector
vector = PicoVector(display)
vector.set_antialiasing(ANTIALIAS_BEST)

t = Transform()
vector.set_transform(t)

# Set our font, size and spacing.
# Don't forget to transfer the font file to the I75W
vector.set_font("cherry-hq.af", 20)
vector.set_font_letter_spacing(100)
vector.set_font_word_spacing(100)


while True:
    # Clear the display
    display.set_pen(BLACK)
    display.clear()

    # Set the pen colour for our text
    display.set_pen(PINK)

    # Draw our text!
    vector.text("Hello everyone!", 10, 20)

    # Update the display
    i75.update()

The alright-fonts stuff is in a bit of state of flux so it’s currently spread across a couple of different branches / repos!

Try the shiny new GitHub - pimoroni/picovector-fonts: A collection of fonts for use with the RP2040/RP2350 PicoVector library. , which should contain the correct version of everything. There’s also some pre-converted fonts downloadable from the releases tab.

Thank you very much, it worked.

1 Like