tchapi / Adafruit-GFX-Font-Customiser

A little utility to customise pixel fonts for the Adafruit GFX library
https://tchapi.github.io/Adafruit-GFX-Font-Customiser/
MIT License
94 stars 48 forks source link

Basline display... #42

Open RaisonRed opened 3 months ago

RaisonRed commented 3 months ago

Looks like the baseline is always drawn one pixel below its real position...

tchapi commented 3 months ago

Hi @RaisonRed and thanks for raising

Could you elaborate, with an example 🙏🏼 and the expected output?

thanks!

RaisonRed commented 2 months ago

Firefox_Screenshot_2024-08-08T19-04-16 509Z

tchapi commented 2 months ago

Thanks for the example.

In my understanding, the baseline is correctly drawn. Its value starts at the base of the first top pixel, ie base = 0 means the top pixel is above the baseline, not under. Said otherwise, zero indicates the first row (like a zero-based array). You can look at a standard uppercase char for a standard font like Roboto to see that the baseline is correctly drawn (the character stands on the baseline).

We could tweak the display and make it "1-based" (so it would be base: -14 in your example) but it's not the way it's encoded in the font so I'd rather keep it like this.

Hope it helps