You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/ExternalResources.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,18 +53,17 @@ lv_obj_t* logo = lv_img_create(lv_scr_act(), nullptr);
53
53
lv_img_set_src(logo, "F:/images/logo.bin");
54
54
```
55
55
56
-
Load a font from the external resources: you first need to check that the file actually exists. LVGL will crash when trying to open a font that doesn't exist.
56
+
Load a font from the external resources.
57
+
58
+
You don't need to check if it exists in the constructor as LVGL can handle the font not existing gracefully (nothing will render).
59
+
However, do check that it exists in the `IsAvailable()` method so users can see when resources are missing (the watchface will not be selectable in the list if `IsAvailable()` returns `false`).
60
+
Remember to free any loaded fonts (with `free()`) in the screen destructor.
57
61
58
62
```
59
63
lv_font_t* font_teko = nullptr;
60
-
if (filesystem.FileOpen(&f, "/fonts/font.bin", LFS_O_RDONLY) >= 0) {
Copy file name to clipboardExpand all lines: doc/buildAndProgram.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ To build this project, you'll need:
7
7
- A cross-compiler : [ARM-GCC (10.3-2021.10)](https://developer.arm.com/downloads/-/gnu-rm)
8
8
- The NRF52 SDK 15.3.0 : [nRF-SDK v15.3.0](https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/nrf5sdk153059ac345.zip)
9
9
- The Python 3 modules `cbor`, `intelhex`, `click` and `cryptography` modules for the `mcuboot` tool (see [requirements.txt](../tools/mcuboot/requirements.txt))
10
+
- The Python 3 module `pyelftools` to build external resources
10
11
- To keep the system clean, you can install python modules into a python virtual environment (`venv`)
0 commit comments