New release v5.1 - 4x Faster Anti-aliasing, Sparse Font Support and more

Here is the new v5.1 release of LittelvGL with a lot of updates including 4x faster anti-aliasing, sparse font support to save ROM for Asian fonts, scalable and beautiful font anti-aliasing, pixel level opacity on images, easy to use online font and image converters and significant code size reduction.

4x faster anti-aliasing

Due to a massive rework in the anti-aliasing system it become 4 times faster then it was in v5.0. It means practically no performance loss for anti-aliasing! In v5.1 anti-aliasing is calculated during the rendering process hence the old “draw everything in double size and downscale” is not required anymore. This way only few pixel will be put to the appropriate position to make lines or curves smooth and even.

The diagram below shows some measurement with v5.0 and v5.1 using the benchmark application. The results are expressed in FPS. v5.0 and v5.1 comparison: faster anti-aliasing

Setting v5.0 no AA v5.0 AA v5.1 no AA v5.1 AA
Plain 101 23 125 91
Wallpaper 53 12 91 71
Wp. recolor 30 5 25 23
Opacity 84 16 83 83
Shadows 38 4 39 34
All enabled 19 2 16 15

Sparse font support and new font-anti aliasing system

To generate fonts for v5.1 you can use a brand new online TTF font converter tool. Available here: https://littlevgl.com/ttf-font-to-c-array With this tool you can specify a range of character to convert and optionally you can list the characters to include in the font. It is very useful Asian fonts where only a few characters are used from a big Unicode range.

The former LV_FONT_ANTIALIAS option is removed from lv_conf.h. Instead you can specify a bpp (bit-per-pixel) value for each font (1, 2, 4 or 8 bpp are supported). It result better customization to save memory (high bpp for small fonts, low bpp for larger fonts) and in general gives better result with same font memory footprint. You can enable the built-in fonts with 1, 2, 4 or 8 values to specify their bpp.

Updates on image handling

The old chrma keying (LV_COLOR_TRANSP pixels are transparent) is still available but there is a new feature too: you can assign an Alpha byte to every pixel to realize pixel level opacity. The images with pixel level opacity can have really smooth edges compared to Chroma keying. To convert images for LittlevGL and other online tool is created: https://littlevgl.com/image-to-c-array

In v5.0 you needed to create a file from image data in the RAMFS and then use the file’s path in lv_img_set_file(). Now - in v5.1 - a more general and resource friendly way is introduced. You can use the lv_img_set_src() function to set a new source for an image object. There are 3 image sources:

To learn more check the tutorial about the images: https://github.com/littlevgl/lv_examples/tree/master/lv_tutorial/6_images

Code size reduction

The v5.1 can be compiled in less then 50kB with 10 kB RAM usage. In such a configuration you can use a few object types (a new object type needs ~3kB ROM) and buffer drawing (LV_VDB_SIZE 2048). It makes LittlevGL capable to run on simple cheap devices with only 64kB ROM like STM32F103C8

Migrating from v5.0 to v5.1

However its a minor release you need to do a few things when updating to v5.1:

All new features

Bugfixes

Summary

v5.1 brought a lot of changes to fulfill your needs and we will continue to add new features for you! If you have an idea or have question don’t hesitate to ask on GitHub. Don’t forget to Star the repository to be informed about news and become part of the community!