Adafruit-GFX-Library icon indicating copy to clipboard operation
Adafruit-GFX-Library copied to clipboard

GFXfont elements first and last are of type uint16_t, but accessed with pgm_read_byte

Open bassklampfe opened this issue 3 weeks ago • 0 comments

This will cause issues, when compiling on big-endian architecture.

Should use pgm_read_word(…) instead of pgm_read_byte(…) and functions like drawChar(…) should handle argument c and related variables as uint16_t and not unsigned char.

Became aware of this, when preparing a minimal patch to support UTF8 without big changes to Adafruit-GFX-Library. My Diff has about 89 lines, where about half of the lines is above issue.

bassklampfe avatar Nov 16 '25 11:11 bassklampfe