German umlauts?

Hello,

has anybody already used german umlauts? Any hints how to get them displayed?

Take the fontconverter (https://lvgl.io/tools/fontconverter)
Create a font file for including in C source from a preferred TTF font
Set an appropriate style for using this font.
Assign this style to where you need the german text.
Write your german text (source file is UTF8).

That should do it.

Sorry, but I’ somewhat lost on this.

The original Montserrat fonts DO contain german umlauts. Where did they go lost?

When I convert those fonts from github, then the fontawesome symbols will be lost? Or is there a way to combine two fonts? In the style, I can choose only ONE font. So all the symbols and letters and umlauts have to be in the same font?

Only the basic ASCII character set (and some symbols) are included in the default fonts, otherwise the flash consumption would be huge. The expectation is that you will re-convert the font for your project if you need additional characters.

Yes. However, our converter lets you merge fonts together (that’s how we are able to mix FontAwesome symbols with Montserrat characters).

1 Like

I don’t buy this point for two reasons:

  1. Fonts can be activated/deactivated at compile time individually.
  2. Do you really think those seven german umlauts use more flash than the “font with normal range + Hebrew, Arabic, Perisan letters and all their forms” or the “CJK Radicals” which are already built in? It is OK to include almost all of the world, but including those seven umlauts would overflow the flash? Really?

But it won’t let me add just those seven letters to the existing built-in fonts. I’d have to re-generate everything from scratch and possibly mess up something that has already been done properly for the built-in fonts.

Maybe it would make sense to “merge” fonts at runtime:
Add multiple font styles to an object. If a glyph is not found in the first style, look it up in the next one. Or maybe a style might have multiple font settings. like this:

lv_style_set_text_font(&my_style, LV_STATE_DEFAULT, &lv_font_montserrat_28);
lv_style_set_text_font(&my_style, LV_STATE_DEFAULT, &lv_font_awesome_28);
lv_style_set_text_font(&my_style, LV_STATE_DEFAULT, &lv_font_my_language_28);
lv_style_set_text_font(&my_style, LV_STATE_DEFAULT, &lv_font_another_language_28);

This way it would be possible to just add those letters for your favorite language without duplicating the whole basic character set. Please note that the basic ASCII characters and also fontawesome are all duplicated in the persian/hebrew/arabic/CJK fonts.

Side-benefit would be that e.g. fontawesome would not be included/generated for every font, but only once. This would help to reduce flash size and maintenance effort.

PS: This “merge” functionality is just a quick-n-dirty idea, far from being thought properly through to the end. Possibly it would make more sense to have such a merge functionality in the font-subsystem instead of the style subsystem.

Maybe something like

lv_font_t lv_merge_fonts (int number_of_fonts, ...);

static lv_font_t my_merged_font_28
    = lv_merge_fonts (4,
        &lv_font_montserrat_28,
        &lv_font_awesome_28,
        &lv_font_my_language_28,
        &lv_font_another_language_28,
);

or something.

@kisvegabor @puzrin Any thoughts on this?