mrcodetastic / ESP32-HUB75-MatrixPanel-DMA

An Adafruit GFX Compatible Library for the ESP32, ESP32-S2, ESP32-S3 to drive HUB75 LED matrix panels using DMA for high refresh rates. Supports panel chaining.
MIT License
886 stars 197 forks source link

Mirroring Text #350

Open JKBusse opened 1 year ago

JKBusse commented 1 year ago

hey, is there a way to mirror text?

Thanks

mrcodetastic commented 1 year ago

Unless the AdafruitGFX library has that, then no. You'll need to write the logic yourself / modify drawPixel() function of that library to calculate 'mirror' coordinates and update as such.

board707 commented 1 year ago

You'll need to modify drawPixel() function of that library

I think one will need to modify drawChar() or drawString()

xemjeff commented 1 year ago

A few ways I can thing of to do this:

1) modify an exiting Arduino GFX font (.h file) - flip each of the characters. using this tool: https://tchapi.github.io/Adafruit-GFX-Font-Customiser/

2) modify an existing TTF font using Glyph Studio (better graphics tools), then convert to Arduino GFX font.

Here's an example in Glyph Studio, where I flipped the first few characters of this TTF that I loaded:

image

3) modify the drawChar function on the Arduino library and the GFX font structure. You could add a bool flag for mirror, and if mirrored, render the character in mirror format. You would also have to supply a print function (right to left) instead of left to right, assuming your are using some left to right char set to start with.

I guess is depends on how badly you want it.