Scroll pHAT special characters

Hello,

how can I add special characters to the Scroll pHAT?

For example:

  • Accented words like: “Huracán”
  • Spanish characters like: “Otoño”
  • Degree symbol for temperature like: 24 ºC

Thanks in advance!

I see no reason why not, although support for them is currently a little limited.

The font lives in this file: https://github.com/pimoroni/scroll-phat/blob/master/library/scrollphat/font.py

The file is a dictionary keyed upon the characters codepoint, currently only in the basic ASCII range, but there’s no reason why you can’t extend it beyond that.

You can ask Python for the correct codepoint for each charatcer like so:

>>> ord(u"á")
225

The values map straight into Scroll pHAT’s buffer. Each number represents a column, and each bit in that number represents a pixel (or row) in that column.

Since you’re limited to 5 pixels tall, you may have some difficulty representing characters with accents, etc, but there’s no harm trying.

I’ve solved it using this tool https://github.com/pimoroni/scroll-phat/tree/master/tools

Thanks!