Skip to content

Commit

Permalink
Merge pull request #157 from thigger/master
Browse files Browse the repository at this point in the history
Handle larger fonts
  • Loading branch information
vroland committed Feb 27, 2022
2 parents 4ca0a2b + 19481ef commit f6623a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/epd_driver/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static enum EpdDrawError IRAM_ATTR draw_char(const EpdFont *font, uint8_t *buffe
}

uint32_t offset = glyph->data_offset;
uint8_t width = glyph->width, height = glyph->height;
uint16_t width = glyph->width, height = glyph->height;
int left = glyph->left;

int byte_width = (width / 2 + width % 2);
Expand Down
8 changes: 4 additions & 4 deletions src/epd_driver/include/epd_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ extern const EpdWaveform epdiy_ED133UT2;

/// Font data stored PER GLYPH
typedef struct {
uint8_t width; ///< Bitmap dimensions in pixels
uint8_t height; ///< Bitmap dimensions in pixels
uint8_t advance_x; ///< Distance to advance cursor (x axis)
uint16_t width; ///< Bitmap dimensions in pixels
uint16_t height; ///< Bitmap dimensions in pixels
uint16_t advance_x; ///< Distance to advance cursor (x axis)
int16_t left; ///< X dist from cursor pos to UL corner
int16_t top; ///< Y dist from cursor pos to UL corner
uint16_t compressed_size; ///< Size of the zlib-compressed font data.
uint32_t compressed_size; ///< Size of the zlib-compressed font data.
uint32_t data_offset; ///< Pointer into EpdFont->bitmap
} EpdGlyph;

Expand Down

0 comments on commit f6623a4

Please sign in to comment.