Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » Custom Font Problem /w GFX Library

Author: betti54
10/08/2020 10:17:20
Hi,

I'm working on a solution using a 2.4" TFT with Adafruit GFX library. TcMenu works a charm, but I've just switched from default font to custom font and encountered a major issue.

I take over the display render my display using gfx.setFont, then go into the menu. Upon exiting menu, my display fails to render properly using the same code (font size is much larger, and x y positions are shot). The bug only arises when I use custom fonts, if I stick to the default all is good.

Any help would be appreciated.

thanks, Damien

Author: davetcc
10/08/2020 14:06:40
Hi there,

Good to know most things are working for you.

This sounds like a bug in the Adafruit_GFX renderer, please can you raise a bug report in the tcMenu project: https://github.com/davetcc/tcMenu

For the time being until we can fix it when you call give back display, set the font back to the default one. I think that will work as a temporary solution.

Author: betti54
10/08/2020 22:09:04
Hi,

Thanks for the insight.

I had made attempts to reset the font using gfx.setFont() and gfx.setFont(NULL), both without success. Based on your input though, I thought I'd try reset the text size which seemed to do the trick.

A call to gfx.setTextSize(1) seems to reset things, even though I'm using custom font with fixed size anyway.

I've raised an issue on GitHub with reference to this post also. Seems an easy fix now, though one last eluded me earlier.

Thanks for the help, Damien





Register / Login  |  Desktop view  |  Jump to top of page