Alternative Text Shaping Engine

I wanted to know if there is a possibility to add a custom text shaping engine to LVGL? I am thinking of something like HarfBuzz or Monotype WorldType Shaper. Yes it would, additionally to a font engine like FreeType, add a lot of overhead, but I can imagine scenario where that might be desired and useful. As I understand, there is currently a custom LVGL text shaper in the background and also a bidi handler.

Would there be a benefit to using a more advanced text shaping engine? Would it be possible to make a generic interface, a bit like the font engine interface, where you could plug in the different text shapers?

I would be interested to hear your opinion :slight_smile:

Hi,

Yes, it’d make a lot of sens actually and I’m also thinking about it. However as it wasn’t really requested so far I treated it with lower priority.

I think it could be the subject of LVGL v10, unless a company comes and says it’s very important for them and we can start working on it as a service.

1 Like

That is very cool to hear! That would elevate LVGL above emWin and a huge step towards Qt for MCU in terms of text rendering capability.

What would you expect in terms of development time for this feature? Are we talking a few days, weeks or even months? Just to get a feeling on how involved this might be :sweat_smile:

The current text shaping algorithm is tightly integrated with LVGL’s code. To phrase it in a more honest way, we haven’t considered that it should be a modular and abstract thing and… yeah… it looks like that… :smiley:

To estimate the required work hours, I’d say it’s 1 week of work for someone who knows LVGL, but to be realistic while we add unit tests, docs, fixes, etc, it will be 2 weeks.

1 Like

Two weeks don’t seem out of this world :slight_smile: With some commercial backing this would certainly be possible!

I agree, but without a real need or commercial support I would rather not jump into it during the development of v9.0. :frowning:

Absolutely! From what I’ve seen you have more than enough work in your v9.0 backlog :sweat_smile: This feature might also fit into a minor release with a bit of careful API design, so there is no need to shoehorn this into v9.0 :+1:

I agree with all the statements in your comment :smiley:

1 Like

I think text shaping is the most fundamental work in most UI frameworks. Please bring up the schedule :sweat_smile:
Or open an issue on the github. Starting from now on, discussing the design.
We used skia which used for all Android devices and Chrome, flutter… there is an good design in skia we can learn from it. BIDI is also an important part. The current design of LVGL is different from Windows, Android, and IOS.

Please keep in mind that the goal of LVGL is quite different to something like Windows, Android or iOS. It sure would be cool to have as much as you can from these experiences, but there will have to be sacrifices in some form.

I also think a Github issue would be a good start to start the discussion, but keep in mind that there are more pressing things than a new text engine for version 9, which should be coming out at the end of this year. But there is always the possibility to do it yourself. If you provide @kisvegabor the solution on a platter, he will probably accept it :yum: I would probably also provide feedback or even do some coding myself, if I find the time.

First on the todo list (which should be in a Github issue) would certainly be to analyze the current text rendering and modularize it somehow. Then think up an interface and what is part of it and so on…

I also found two interesting links that are worth reading for anyone interested in this topic and to keep the language precise :slight_smile:

Modern text rendering with Linux: Overview

The HarfBuzz manual

Oh, yes :slight_smile: But before anyone jumps into it please rally open an issue to align our views and goals.