Description
I generated my own font including characters from 0x20 to 0xff but those from 0x80 upwards are not printed on the display
What MCU/Processor/Board and compiler are you using?
TI TM4C1294, gcc
What LVGL version are you using?
8.3
What do you want to achieve?
I need to display german umlauts.
What have you tried so far?
- Downloaded Montserrat fonts from google
- used the lvgl online converter with Montserrat-Regular.ttf
- size 9
- 1 bpp
- Range 0x20-0xff
- other settings unchanged from default
- put the generated .c file in my application directory
- declared the font using LV_FONT_DECLARE
- lvgl is linked as a lib, it was not recompiled, after the font was put in my app
- added a label to my screen, tried to print characters below and above 0x80
Code to reproduce
An excerpt from the generated font .c file
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
},
{
.range_start = 160, .range_length = 96, .glyph_id_start = 96,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/// snip ...
/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t montserrat_reg_9 = {
#else
lv_font_t montserrat_reg_9 = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 12, /*The maximum line height required by the font*/
.base_line = 2, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
.underline_position = -1,
.underline_thickness = 0,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
Excerpt from my application code:
LV_FONT_DECLARE(montserrat_reg_9)
lv_label_set_text(ui->screen_label_2, "ÄÖÜß?§$%&{[]}²äüö");
lv_obj_set_style_text_font(ui->screen_label_2, &montserrat_reg_9, LV_PART_MAIN|LV_STATE_DEFAULT);
From the binary object file, I can see actual characters being used:
C4 D6 DC DF 3F A7 24 25 26 7B 5B 5D 7D B2 E4 FC F6
Those below 0x80 are displayed, the others are not.
Is there maybe some general setting that I might have missed which prevents characters > 0x80 to be displayed?
Best regards,
Rainer