1# Tiny TTF font engine
2
3## Usage
4
5Use https://github.com/nothings/stb to render TrueType fonts in LVGL.
6
7When enabled in `lv_conf.h` with `LV_USE_TINY_TTF`
8`lv_tiny_ttf_create_data(data, data_size, font_size)` can be used to
9create a TTF font instance at the specified font size. You can then
10use that font anywhere `lv_font_t` is accepted.
11
12By default, the TTF or OTF file must be embedded as an array, either in
13a header, or loaded into RAM in order to function.
14
15However, if `LV_TINY_TTF_FILE_SUPPORT` is enabled,
16`lv_tiny_ttf_create_file(path, font_size)` will also be available,
17allowing tiny_ttf to stream from a file. The file must remain open the
18entire time the font is being used, and streaming on demand may be
19considerably slower.
20
21After a font is created, you can change the font size in pixels by using
22`lv_tiny_ttf_set_size(font, font_size)`.
23
24By default, a font will use up to 4KB of cache to speed up rendering
25glyphs. This maximum can be changed by using
26`lv_tiny_ttf_create_data_ex(data, data_size, font_size, cache_size)`
27or `lv_tiny_ttf_create_file_ex(path, font_size, cache_size)` (when
28available). The cache size is indicated in bytes.
29
30## API
31
32```eval_rst
33.. doxygenfile:: lv_tiny_ttf.h
34  :project: lvgl
35```
36