docs: add lv_example_tiny_ttf_2 to index.rst

This commit is contained in:
Gabor Kiss-Vamosi
2022-10-02 18:22:30 +02:00
parent eae7e6c313
commit 0a9772bcdf
3 changed files with 10 additions and 3 deletions

View File

@@ -1,6 +1,13 @@
Open a front with Tiny TTF Open a front with Tiny TTF from data array
""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""
.. lv_example:: libs/tiny_ttf/lv_example_tiny_ttf_1 .. lv_example:: libs/tiny_ttf/lv_example_tiny_ttf_1
:language: c :language: c
Load a font with Tiny_TTF from file
"""""""""""""""""""""""""""""""""""""""""""""""
.. lv_example:: libs/tiny_ttf/lv_example_tiny_ttf_2
:language: c

View File

@@ -18,7 +18,7 @@ void lv_example_tiny_ttf_1(void)
/*Create a label with the new style*/ /*Create a label with the new style*/
lv_obj_t * label = lv_label_create(lv_scr_act()); lv_obj_t * label = lv_label_create(lv_scr_act());
lv_obj_add_style(label, &style, 0); lv_obj_add_style(label, &style, 0);
lv_label_set_text(label, "Hello world\nI'm a font created with Tiny TTF"); lv_label_set_text(label, "Hello world\nI'm a font\ncreated\nwith Tiny TTF");
lv_obj_center(label); lv_obj_center(label);
} }
#endif #endif

View File

@@ -16,7 +16,7 @@ void lv_example_tiny_ttf_2(void)
/*Create a label with the new style*/ /*Create a label with the new style*/
lv_obj_t * label = lv_label_create(lv_scr_act()); lv_obj_t * label = lv_label_create(lv_scr_act());
lv_obj_add_style(label, &style, 0); lv_obj_add_style(label, &style, 0);
lv_label_set_text(label, "Hello world\nI'm a font created with Tiny TTF"); lv_label_set_text(label, "Hello world\nI'm a font\ncreated\nwith Tiny TTF");
lv_obj_center(label); lv_obj_center(label);
} }
#endif #endif