7 static const uint8_t *get_glyph_bitmap(
const lv_font_t *font, uint32_t unicode_letter) {
9 const auto *gd = fe->get_glyph_data(unicode_letter);
17 static bool get_glyph_dsc_cb(
const lv_font_t *font, lv_font_glyph_dsc_t *dsc, uint32_t unicode_letter, uint32_t next) {
19 const auto *gd = fe->get_glyph_data(unicode_letter);
22 dsc->adv_w = gd->offset_x + gd->width;
23 dsc->ofs_x = gd->offset_x;
24 dsc->ofs_y = fe->height - gd->height - gd->offset_y - fe->baseline;
25 dsc->box_w = gd->width;
26 dsc->box_h = gd->height;
27 dsc->is_placeholder = 0;
33 this->
bpp = esp_font->get_bpp();
35 this->
lv_font_.line_height = this->
height = esp_font->get_height();
37 this->
lv_font_.get_glyph_dsc = get_glyph_dsc_cb;
38 this->
lv_font_.get_glyph_bitmap = get_glyph_bitmap;
39 this->
lv_font_.subpx = LV_FONT_SUBPX_NONE;
40 this->
lv_font_.underline_position = -1;
41 this->
lv_font_.underline_thickness = 1;
50 memset(unicode, 0,
sizeof unicode);
51 if (unicode_letter > 0xFFFF) {
52 unicode[0] = 0xF0 + ((unicode_letter >> 18) & 0x7);
53 unicode[1] = 0x80 + ((unicode_letter >> 12) & 0x3F);
54 unicode[2] = 0x80 + ((unicode_letter >> 6) & 0x3F);
55 unicode[3] = 0x80 + (unicode_letter & 0x3F);
56 }
else if (unicode_letter > 0x7FF) {
57 unicode[0] = 0xE0 + ((unicode_letter >> 12) & 0xF);
58 unicode[1] = 0x80 + ((unicode_letter >> 6) & 0x3F);
59 unicode[2] = 0x80 + (unicode_letter & 0x3F);
60 }
else if (unicode_letter > 0x7F) {
61 unicode[0] = 0xC0 + ((unicode_letter >> 6) & 0x1F);
62 unicode[1] = 0x80 + (unicode_letter & 0x3F);
64 unicode[0] = unicode_letter;
67 int glyph_n = this->
font_->match_next_glyph(unicode, &match_length);
76 #endif // USES_LVGL_FONT
const lv_font_t * get_lv_font()
const font::GlyphData * get_glyph_data(uint32_t unicode_letter)
const font::GlyphData * last_data_
Implementation of SPI Controller mode.
FontEngine(font::Font *esp_font)