Skip to content

Commit 2e1c97e

Browse files
committed
Display buffer OK but nothing in canvas
1 parent 8c4fd0c commit 2e1c97e

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,24 @@ https://github.com/daneelsan/Dodgeballz/tree/master/src
880880

881881
https://github.com/daneelsan/zig-wefx/blob/master/wefx/WEFX.zig
882882

883+
TODO: Font
884+
885+
```bash
886+
## Compile LVGL Library from C to WebAssembly with Zig Compiler
887+
compile_lvgl font/lv_font_montserrat_14.c lv_font_montserrat_14
888+
compile_lvgl font/lv_font_montserrat_20.c lv_font_montserrat_20
889+
890+
## Compile the Zig LVGL App for WebAssembly
891+
zig build-lib \
892+
-DLV_FONT_MONTSERRAT_14=1 \
893+
-DLV_FONT_MONTSERRAT_20=1 \
894+
-DLV_FONT_DEFAULT_MONTSERRAT_20=1 \
895+
-DLV_USE_FONT_PLACEHOLDER=1 \
896+
...
897+
lv_font_montserrat_14.o \
898+
lv_font_montserrat_20.o \
899+
```
900+
883901
# TODO
884902

885903
TODO: Call `lv_tick_inc` and `lv_timer_handler`

build.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ function build_zig {
1919
compile_lvgl ../../../../../pinephone-lvgl-zig/display.c display.o
2020

2121
## Compile LVGL Library from C to WebAssembly with Zig Compiler
22+
compile_lvgl font/lv_font_montserrat_14.c lv_font_montserrat_14.o
23+
compile_lvgl font/lv_font_montserrat_20.c lv_font_montserrat_20.o
2224
compile_lvgl widgets/lv_label.c lv_label.o
2325
compile_lvgl core/lv_obj.c lv_obj.o
2426
compile_lvgl misc/lv_mem.c lv_mem.o
@@ -80,10 +82,10 @@ function build_zig {
8082
compile_lvgl draw/lv_draw_layer.c lv_draw_layer.o
8183
compile_lvgl misc/lv_style_gen.c lv_style_gen.o
8284
compile_lvgl misc/lv_gc.c lv_gc.o
85+
compile_lvgl misc/lv_utils.c lv_utils.o
8386

8487
## Compile the Zig LVGL App for WebAssembly
8588
## TODO: Change ".." to your NuttX Project Directory
86-
## TODO: Try `zig build-exe` to fix `strlen` missing
8789
zig build-lib \
8890
--verbose-cimport \
8991
-target wasm32-freestanding \
@@ -123,6 +125,8 @@ function build_zig {
123125
\
124126
lvglwasm.zig \
125127
display.o \
128+
lv_font_montserrat_14.o \
129+
lv_font_montserrat_20.o \
126130
lv_label.o \
127131
lv_mem.o \
128132
lv_obj.o \
@@ -184,6 +188,7 @@ function build_zig {
184188
lv_draw_layer.o \
185189
lv_style_gen.o \
186190
lv_gc.o \
191+
lv_utils.o \
187192

188193
## Compile the Zig LVGL App for PinePhone
189194
## (armv8-a with cortex-a53)

lvglwasm.wasm

27.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)