More on user defined Fonts


I want to get to know the structure of the output .c file of the online font converter.
what are its components?
and where can I learn more about the subject?

because I have a font that doesn’t print a certain Arabic letter.
the Alef Makthura isolated and final form.
although, I can find them at the font .c file.
Yet it outputs a glyph dsc. not found error.
So I just want to be able to debug this by myself if possible.

1 Like

the glyph conversion (contexual analysis) is done in function _lv_txt_ap_proc in lv_misc/lx_txt_ap.c.
it takes the shapes from ap_chars_map array.

i did not have the chance to look for correctness.

did you face a similar problem?

yes. i faced similar but did not look further as I switched to another font.
The conversion/contexual is staight forward.

1 Like

you can use as many fonts as you want.
If your memory allows, you can generate the .c file from online tool then embed it in your code.
You can also load font dynamically using font_load function (you need to use font convert program from LVGL github to generate the font in bin format).

1 Like

Thanks @alsaleem00
but it doesn’t feel convenient to add a full other font for one letter.
and I don’t know how would I merge more than one font actually.
I added all of the different font sizes in the default theme.
I think I can apply certain fonts for certain items.
I have to make a new style for each, right?
that is so memory consuming.

thanks again,
can you have a look at my other thread I just created?
it is about tab names

you can’t do anything about a font that has a problem except substituting that character or combine with other font file. The font converter program has a debug feature where it generates image of each glyph in the font file.

you don’t have to generate font for some characters. please take a look at the top of file lv_font/lv_font_dejavu_16_persian_hebrew.c. there, he is mixing different font files to generate ONE font. There is no limit (except command line!).
please note that you should generate ONE font per size.

1 Like

so when I add fonts at the font converter,
the converter adds the messing letters like “ى” in my current issue, from the second font to the first one.
Thanks <3

If you want to deep inspect a font, you need to install the font convert.
with –debug switch it will generate every character (shape & code) in the file. You can then compare with standard codes/shapes in lv_font_dejavu_16_persian_hebrew.
note: it requires to install node.js.

1 Like

Many thanks @alsaleem00,
I only used the online converter.
I will give it a look for sure,
Many thanks.
can you have a look at this thread?
I will really appreciate it.