Skip to content

Commit 6ca62b4

Browse files
authored
Update the bitmap offset to 32-bit word to match the GFXglyph (#126)
The GFXglyph bitmapOffset field was modified to 32 bit for large bitmaps. However, when reading the word, only the lower 16-bit are read, resulting in bad offsets for bitmaps greater than 65535.
1 parent f9c16d1 commit 6ca62b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libs/Adafruit-GFX-Library/Adafruit_GFX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ void Adafruit_GFX::drawChar(int16_t x, int16_t y, unsigned char c,
11821182
GFXglyph *glyph = pgm_read_glyph_ptr(gfxFont, c);
11831183
uint8_t *bitmap = pgm_read_bitmap_ptr(gfxFont);
11841184

1185-
uint16_t bo = pgm_read_word(&glyph->bitmapOffset);
1185+
uint32_t bo = pgm_read_dword(&glyph->bitmapOffset);
11861186
uint8_t w = pgm_read_byte(&glyph->width), h = pgm_read_byte(&glyph->height);
11871187
int8_t xo = pgm_read_byte(&glyph->xOffset),
11881188
yo = pgm_read_byte(&glyph->yOffset);

0 commit comments

Comments
 (0)