lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
388 stars 55 forks source link

Set font character spacing #8

Closed octave closed 4 years ago

octave commented 4 years ago

Hi,

First of all thank you for this great library! I was wondering if there is a way to set the font character spacing when using setFreeFont or setFixedFont ?

Thank you!

lexus2k commented 4 years ago

Hello,

Unfortunately, there is no such method for now. But I've learned that it is easy to add method setSpacing() to NanoFont class and setFontSpacing() to display class to have something like this:

    display.setFreeFont( free_calibri11x12, free_calibri11x12_cyrillic );
    display.setFontSpacing(2);
    display.printFixed(0,  8, u8"This is Русский", STYLE_NORMAL);

What do you think?

Best regards.

octave commented 4 years ago

That would be awesome!

lexus2k commented 4 years ago

Please, find my commit above. Let me know if it works for you as expected.

    display.setFreeFont(...)
    display.setFontSpacing(2);
    // or
    display.getFont().setSpacing(2);
octave commented 4 years ago

It works!! Thank you that was super fast!