Lv_freetype: bold/italic rendering

It’s not only the length of the code. Once a feature is there it can be bugs, it can be improved (quality, speed, etc).

I have no problem with that. These “external modules” are less strict.
If you already know how this transformation can be implemented in FreeType can you send a PR for lv_lib_freetype?

I can not send PR for lv_lib_freetype before you make lvgl support providing external font engine handling text decorations. That is the point. For now everything I can is make 4 fonts based on lv_lib_freetype: with no decorations, italic/oblique, bold and italic/oblique+bold to handle all cases I need. But it will increase memory usage. Or you can provide mechanism for completely external text engine to be used in lv_label. And this external engine will handle everything but blending which is done by lvgl.

Ah got it. So you want LVGL to pass flags (italic, bold, etc) to the font engine to return the metrics and bitmaps accordingly?

If so it’s not that trivial and requires careful planning as this feature is completely missing from LVGL.

I suggest the following:

  1. creating a font normally with freetype
  2. copy it with memcpy into 3 other lv_font_ts
  3. use the fonts’s user_data filed to set the transformation type
  4. use different font in labels

Not exactly. For now we can add module to render images and fonts and anythyng else. I want to make LVGL being able to use external modules to render fonts, not only open font formats i.e. to use external lv_draw_label implementation. And make it able to accept such attributes as bold, italic, underline, strikethrough, etc…

lv_draw_label needs to be consistent with the other string processing parts. E.g. word wrapping to make it possible for LVGL to determine for text’s dimensions.
Using an arbitrary custom rendering engine might break this compatibility.

Anyway, it’s certainly possible to make the text engine more abstract but it’s not on the roadmap now. :frowning: