Add characters to a font on the fly

would it be possible to add characters after the fact?

something like:
lv_font_add_char(font, char, bytearray)? or lv_font_add_chars(font, chars, bytearray)

this would also be handy for MicroPython, where users probably play with more than one program.

see also: German umlauts

Unfortunately, I can’t imagine a good was for it as all the arrays are const.

Maybe loading fonts runtime can help:

I was thinking of a linked list of (const) arrays or collections.
like if there is an override collection, search there first, otherwise search in the original font collection.

of coarse this functionality is only needed in situations where you are running different programs often. for a single solution, an updated font will do.

for the maker/hobby world that uses MicroPython, using a default font and add chars as needed would be a great improvement i think.

To support effective searches, kerning and other features the fonts are quite compliceted.
See this for example.

The add a new font the followings needs to be updated:

  • glyph_bitmap
  • glyph_dsc to describe the the properties of the gylph
  • cmaps to organize glyphs into ranges for faster search
  • kern_left/right_class_mapping and kern_class_values for kering

So I believe it’s rather complicated. :frowning: