You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.3 KiB
61 lines
1.3 KiB
/* epd.h - E-Paper Display library API */ |
|
|
|
#ifndef EPD_FONT_H_ |
|
#define EPD_FONT_H_ |
|
|
|
/* Includes */ |
|
#include "epd.h" |
|
#include "epd_fonts.h" |
|
|
|
/* Definitions */ |
|
#define EPD_FONT_HEIGHT_MODE_TEXT 0 |
|
#define EPD_FONT_HEIGHT_MODE_XTEXT 1 |
|
#define EPD_FONT_HEIGHT_MODE_ALL 2 |
|
|
|
/* Data Structures */ |
|
typedef struct epd_s epd_t; |
|
typedef struct epd_fontcfg_s |
|
{ |
|
/* offset 0 */ |
|
uint8_t glyph_cnt; |
|
uint8_t bbx_mode; |
|
uint8_t bits_per_0; |
|
uint8_t bits_per_1; |
|
|
|
/* offset 4 */ |
|
uint8_t bits_per_char_width; |
|
uint8_t bits_per_char_height; |
|
uint8_t bits_per_char_x; |
|
uint8_t bits_per_char_y; |
|
uint8_t bits_per_delta_x; |
|
|
|
/* offset 9 */ |
|
int8_t max_char_width; |
|
int8_t max_char_height; /* overall height, NOT ascent. Instead ascent = max_char_height + y_offset */ |
|
int8_t x_offset; |
|
int8_t y_offset; |
|
|
|
/* offset 13 */ |
|
int8_t ascent_A; |
|
int8_t descent_g; /* usually a negative value */ |
|
int8_t ascent_para; |
|
int8_t descent_para; |
|
|
|
/* offset 17 */ |
|
uint16_t start_pos_upper_A; |
|
uint16_t start_pos_lower_a; |
|
|
|
/* offset 21 */ |
|
#ifdef EPD_WITH_UNICODE |
|
uint16_t start_pos_unicode; |
|
#endif |
|
} epd_fontcfg_t; |
|
|
|
/* Exported Variables */ |
|
|
|
/* Function Prototypes */ |
|
void epd_font_set(epd_t *epd, epd_font_t *font); |
|
uint8_t epd_draw_str(epd_t *epd, uint32_t x, uint32_t y, const char *str); |
|
uint8_t epd_draw_utf8(epd_t *epd, uint32_t x, uint32_t y, const char *str); |
|
|
|
#endif /* EPD_FONT_H_ */
|
|
|