Category Archives: fonts

Adafruit GFX

I’m hoping someone can save me a learning curve here.  I’m messing with the Adafruit GFX library here with a view to making a subset of my normal MQTT-based code supporting the little 160*128 LCD displays. All of this is working – I can put text up directly from an MQTT message – no problem.

But I’m having trouble getting my head around the GFX fonts.

Firstly – there seems to be a source code command line tool for generating fonts – and I need an LCD-type font… but I cannot find a precompiled version of the tool or similar for Windows and reference to Windows is so vague in the GFX info I’m not sure I want to go experimenting. Has anyone successfully made fonts in Windows for this library?

Secondly font height. The cursor positioning is based on pixels – and it seems that if you want to go to line X of text you have to guess how many pixels you need to use as a multiplier – that can’t be right surely?  There is a function for figuring out the XY bounds of a string so you can use a block erase before writing but that too is in pixels and assumes you know the height of the font. Surely there must be a function somewhere that simply returns the height of the current font?