feat(freetype): add colored glyphs support (#6686)
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
FreeType support
|
||||
================
|
||||
|
||||
Interface to FreeType library to generate font bitmaps run time.
|
||||
Interface to FreeType library to generate font bitmap at run time.
|
||||
|
||||
Detailed introduction: https://www.freetype.org
|
||||
|
||||
@@ -89,14 +89,18 @@ software, and can be set with reference to the following values:
|
||||
They can be combined.eg:
|
||||
:cpp:expr:`LV_FREETYPE_FONT_STYLE_BOLD | LV_FREETYPE_FONT_STYLE_ITALIC`.
|
||||
|
||||
The FreeType extension also supports colored bitmap glyphs such as emojis. Note
|
||||
that only bitmaps are supported at this time. Colored vector graphics cannot be
|
||||
rendered. An example on how to draw a colored bitmap glyph is shown below.
|
||||
|
||||
Use the :cpp:func:`lv_freetype_font_create` function to create a font. To
|
||||
delete a font, use :cpp:func:`lv_freetype_font_delete`. For more detailed usage,
|
||||
please refer to example code.
|
||||
|
||||
.. _freetype_example:
|
||||
|
||||
Example
|
||||
-------
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. include:: ../examples/libs/freetype/index.rst
|
||||
|
||||
|
||||
@@ -428,12 +428,9 @@ LVGL's font interface is designed to be very flexible but, even so, you
|
||||
can add your own font engine in place of LVGL's internal one. For
|
||||
example, you can use `FreeType <https://www.freetype.org/>`__ to
|
||||
real-time render glyphs from TTF fonts or use an external flash to store
|
||||
the font's bitmap and read them when the library needs them.
|
||||
the font's bitmap and read them when the library needs them. FreeType can be used in LVGL as described in :ref:`Freetype <freetype>`.
|
||||
|
||||
A ready to use FreeType can be found in
|
||||
`lv_freetype <https://github.com/lvgl/lv_lib_freetype>`__ repository.
|
||||
|
||||
To do this, a custom :cpp:type:`lv_font_t` variable needs to be created:
|
||||
To add a new font engine, a custom :cpp:type:`lv_font_t` variable needs to be created:
|
||||
|
||||
.. code:: c
|
||||
|
||||
|
||||
Reference in New Issue
Block a user