From 3aa22f9f6a798a13e57c1f838de2b560d1842028 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Wed, 23 Mar 2022 10:40:51 +0100 Subject: [PATCH] LVGL add lv_font apis --- .../lv_binding_berry/generate/be_lvgl_module.c | 3 +++ lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h | 6 ++++++ lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py | 1 + 3 files changed, 10 insertions(+) diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c index 57f0d05b8..29ef33819 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c @@ -109,6 +109,9 @@ const be_ntv_func_def_t lv_func[] = { { "event_stop_bubbling", { (const void*) &lv_event_stop_bubbling, "", "(lv.lv_event)" } }, { "event_stop_processing", { (const void*) &lv_event_stop_processing, "", "(lv.lv_event)" } }, { "flex_init", { (const void*) &lv_flex_init, "", "" } }, + { "font_get_glyph_dsc", { (const void*) &lv_font_get_glyph_dsc, "b", "(lv.lv_font)(lv.lv_font_glyph_dsc)ii" } }, + { "font_get_glyph_width", { (const void*) &lv_font_get_glyph_width, "i", "(lv.lv_font)ii" } }, + { "font_get_line_height", { (const void*) &lv_font_get_line_height, "i", "(lv.lv_font)" } }, { "get_hor_res", { (const void*) &lv_get_hor_res, "i", "" } }, { "get_ts_calibration", { (const void*) &lv_get_ts_calibration, "lv.lv_ts_calibration", "" } }, { "get_ver_res", { (const void*) &lv_get_ver_res, "i", "" } }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h index 23c3867ff..9827808e3 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h +++ b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h @@ -702,6 +702,12 @@ void lv_spinbox_decrement(lv_obj_t * obj) // ../../lvgl/src/extra/widgets/spinner/lv_spinner.h lv_obj_t * lv_spinner_create(lv_obj_t * parent, uint32_t time, uint32_t arc_length) +// ../../lvgl/src/font/lv_font.h +const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter) +bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter, uint32_t letter_next) +uint16_t lv_font_get_glyph_width(const lv_font_t * font, uint32_t letter, uint32_t letter_next) +static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p) + // ../../lvgl/src/lv_api_map.h static inline uint32_t lv_task_handler(void) static inline void lv_obj_move_foreground(lv_obj_t * obj) diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py index fe345f010..892a9cc32 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py @@ -74,6 +74,7 @@ lv_fun_globs = [ "misc/lv_math.h", "misc/lv_area.h", "misc/lv_timer.h", + "font/lv_font.h", #"**/*.h", ] headers_names = list_files(lv_src_prefix, lv_fun_globs)