Skip to content

Bug in that drawChar reads glyph->bitmapOffset as uint16_t instead of uint32_t #3919

@jacksonbasil2

Description

@jacksonbasil2

In the TFT_eSPI library, in

void TFT_eSPI::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t size)

the bitmapOffset is incorrectly read as uint16_t with:
uint32_t bo = pgm_read_word(&glyph->bitmapOffset);

the bitmapOffset is only being read as a uint16_t and the only reason it normally works (for smaller fonts) is that the ESP32 is little endian.

This needs to be changed to:

uint32_t bo = pgm_read_dword(&glyph->bitmapOffset);

NOTE: Using dword instead of word in pgm_read_dword().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions