|
|
|
@ -80,22 +80,22 @@ class TFT_String {
|
|
|
|
|
|
|
|
|
|
static font_t *font() { return font_header; };
|
|
|
|
|
static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; }
|
|
|
|
|
static glyph_t *glyph(uint8_t character) { return glyphs[character] == NULL ? glyphs[0x3F] : glyphs[character]; } /* Use '?' for unknown glyphs */
|
|
|
|
|
static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */
|
|
|
|
|
static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); }
|
|
|
|
|
|
|
|
|
|
static void set();
|
|
|
|
|
static void add(uint8_t character) { add_character(character); eol(); }
|
|
|
|
|
static void add(uint8_t *string);
|
|
|
|
|
static void add(uint8_t *string, int8_t index, uint8_t *itemString = NULL);
|
|
|
|
|
static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr);
|
|
|
|
|
static void set(uint8_t *string) { set(); add(string); };
|
|
|
|
|
static void set(uint8_t *string, int8_t index, const char *itemString = NULL) { set(); add(string, index, (uint8_t *)itemString); };
|
|
|
|
|
static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); };
|
|
|
|
|
static inline void set(const char *string) { set((uint8_t *)string); }
|
|
|
|
|
static inline void set(const char *string, int8_t index, const char *itemString = NULL) { set((uint8_t *)string, index, itemString); }
|
|
|
|
|
static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
|
|
|
|
|
static inline void add(const char *string) { add((uint8_t *)string); }
|
|
|
|
|
|
|
|
|
|
static void trim(uint8_t character = 0x20);
|
|
|
|
|
static void rtrim(uint8_t character = 0x20);
|
|
|
|
|
static void ltrim(uint8_t character = 0x20);
|
|
|
|
|
static void trim(uint8_t character=0x20);
|
|
|
|
|
static void rtrim(uint8_t character=0x20);
|
|
|
|
|
static void ltrim(uint8_t character=0x20);
|
|
|
|
|
static uint16_t width() { return span; }
|
|
|
|
|
static uint8_t *string() { return data; }
|
|
|
|
|
static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; }
|
|
|
|
|