diff --git a/lvgl.h b/lvgl.h index 9d099f80f..e44768c5b 100644 --- a/lvgl.h +++ b/lvgl.h @@ -30,8 +30,8 @@ extern "C" { #include "src/lv_themes/lv_theme.h" -#include "src/lv_misc/lv_font.h" -#include "src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h" +#include "src/lv_font/lv_font.h" +#include "src/lv_font/lv_font_fmt_txt.h" #include "src/lv_objx/lv_btn.h" #include "src/lv_objx/lv_imgbtn.h" diff --git a/lvgl.mk b/lvgl.mk index a895f33f1..830fe1194 100644 --- a/lvgl.mk +++ b/lvgl.mk @@ -1,7 +1,7 @@ include $(LVGL_DIR)/lvgl/src/lv_core/lv_core.mk include $(LVGL_DIR)/lvgl/src/lv_hal/lv_hal.mk include $(LVGL_DIR)/lvgl/src/lv_objx/lv_objx.mk -include $(LVGL_DIR)/lvgl/src/lv_fonts/lv_fonts.mk +include $(LVGL_DIR)/lvgl/src/lv_font/lv_font.mk include $(LVGL_DIR)/lvgl/src/lv_misc/lv_misc.mk include $(LVGL_DIR)/lvgl/src/lv_themes/lv_themes.mk include $(LVGL_DIR)/lvgl/src/lv_draw/lv_draw.mk diff --git a/src/lv_core/lv_style.h b/src/lv_core/lv_style.h index 8fdf22a7a..ddbc1829b 100644 --- a/src/lv_core/lv_style.h +++ b/src/lv_core/lv_style.h @@ -14,9 +14,9 @@ extern "C" { * INCLUDES *********************/ #include +#include "../lv_font/lv_font.h" #include "../lv_misc/lv_color.h" #include "../lv_misc/lv_area.h" -#include "../lv_misc/lv_font.h" #include "../lv_misc/lv_anim.h" /********************* diff --git a/src/lv_draw/lv_draw_basic.c b/src/lv_draw/lv_draw_basic.c index 8ab7a90d6..dc6badc24 100644 --- a/src/lv_draw/lv_draw_basic.c +++ b/src/lv_draw/lv_draw_basic.c @@ -11,8 +11,8 @@ #include "../lv_core/lv_refr.h" #include "../lv_hal/lv_hal.h" +#include "../lv_font/lv_font.h" #include "../lv_misc/lv_area.h" -#include "../lv_misc/lv_font.h" #include "../lv_misc/lv_color.h" #include "../lv_misc/lv_log.h" diff --git a/src/lv_draw/lv_draw_basic.h b/src/lv_draw/lv_draw_basic.h index 97dfb3349..87482237d 100644 --- a/src/lv_draw/lv_draw_basic.h +++ b/src/lv_draw/lv_draw_basic.h @@ -19,9 +19,9 @@ extern "C" { #include "../../../lv_conf.h" #endif +#include "../lv_font/lv_font.h" #include "../lv_misc/lv_color.h" #include "../lv_misc/lv_area.h" -#include "../lv_misc/lv_font.h" /********************* * DEFINES diff --git a/src/lv_misc/lv_font.c b/src/lv_font/lv_font.c similarity index 96% rename from src/lv_misc/lv_font.c rename to src/lv_font/lv_font.c index d7452ab83..c2d6eac82 100644 --- a/src/lv_misc/lv_font.c +++ b/src/lv_font/lv_font.c @@ -8,8 +8,8 @@ *********************/ #include "lv_font.h" -#include "lv_log.h" -#include "lv_utils.h" +#include "../lv_misc/lv_utils.h" +#include "../lv_misc/lv_log.h" /********************* * DEFINES diff --git a/src/lv_misc/lv_font.h b/src/lv_font/lv_font.h similarity index 100% rename from src/lv_misc/lv_font.h rename to src/lv_font/lv_font.h diff --git a/src/lv_font/lv_font.mk b/src/lv_font/lv_font.mk new file mode 100644 index 000000000..a605da791 --- /dev/null +++ b/src/lv_font/lv_font.mk @@ -0,0 +1,11 @@ +CSRCS += lv_font.c +CSRCS += lv_font_fmt_txt.c +CSRCS += lv_font_roboto_12.c +CSRCS += lv_font_roboto_16.c +CSRCS += lv_font_roboto_22.c +CSRCS += lv_font_roboto_28.c + +DEPPATH += --dep-path $(LVGL_DIR)/lvgl/src/lv_font +VPATH += :$(LVGL_DIR)/lvgl/src/lv_font + +CFLAGS += "-I$(LVGL_DIR)/lvgl/src/lv_font" diff --git a/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.c b/src/lv_font/lv_font_fmt_txt.c similarity index 94% rename from src/lv_misc/lv_font_fmt/lv_font_fmt_txt.c rename to src/lv_font/lv_font_fmt_txt.c index 98e90f693..5182074be 100644 --- a/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.c +++ b/src/lv_font/lv_font_fmt_txt.c @@ -7,10 +7,10 @@ * INCLUDES *********************/ -#include "../lv_font.h" -#include "../lv_log.h" -#include "../lv_utils.h" +#include "lv_font.h" #include "lv_font_fmt_txt.h" +#include "../lv_misc/lv_log.h" +#include "../lv_misc/lv_utils.h" /********************* * DEFINES @@ -25,7 +25,7 @@ **********************/ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter); static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t gid_right); -static int32_t lv_font_codeCompare(const void * pRef, const void * pElement); +//static int32_t lv_font_codeCompare(const void * pRef, const void * pElement); /********************** * STATIC VARIABLES @@ -78,11 +78,9 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * if(!gid) return false; int8_t kvalue = 0; - const lv_font_fmt_txt_glyph_dsc_t * gdsc_next = NULL; if(fdsc->kern_dsc) { uint32_t gid_next = get_glyph_dsc_id(font, unicode_letter_next); if(gid_next) { - gdsc_next = &fdsc->glyph_dsc[gid_next]; kvalue = get_kern_value(font, gid, gid_next); } } @@ -213,7 +211,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t * @retval > 0 Reference is less than element. * */ -static int32_t lv_font_codeCompare(const void * pRef, const void * pElement) -{ - return (*(uint16_t *)pRef) - (*(uint16_t *)pElement); -} +//static int32_t lv_font_codeCompare(const void * pRef, const void * pElement) +//{ +// return (*(uint16_t *)pRef) - (*(uint16_t *)pElement); +//} diff --git a/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h b/src/lv_font/lv_font_fmt_txt.h similarity index 99% rename from src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h rename to src/lv_font/lv_font_fmt_txt.h index 10b73ef20..26d792677 100644 --- a/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h +++ b/src/lv_font/lv_font_fmt_txt.h @@ -16,14 +16,13 @@ extern "C" { #ifdef LV_CONF_INCLUDE_SIMPLE #include "lv_conf.h" #else -#include "../../../../lv_conf.h" +#include "../../../lv_conf.h" #endif #include #include #include - -#include "../lv_font.h" +#include "lv_font.h" /********************* * DEFINES diff --git a/src/lv_fonts/lv_font_roboto_12.c b/src/lv_font/lv_font_roboto_12.c similarity index 100% rename from src/lv_fonts/lv_font_roboto_12.c rename to src/lv_font/lv_font_roboto_12.c diff --git a/src/lv_fonts/lv_font_roboto_16.c b/src/lv_font/lv_font_roboto_16.c similarity index 100% rename from src/lv_fonts/lv_font_roboto_16.c rename to src/lv_font/lv_font_roboto_16.c diff --git a/src/lv_fonts/lv_font_roboto_22.c b/src/lv_font/lv_font_roboto_22.c similarity index 100% rename from src/lv_fonts/lv_font_roboto_22.c rename to src/lv_font/lv_font_roboto_22.c diff --git a/src/lv_fonts/lv_font_roboto_28.c b/src/lv_font/lv_font_roboto_28.c similarity index 100% rename from src/lv_fonts/lv_font_roboto_28.c rename to src/lv_font/lv_font_roboto_28.c diff --git a/src/lv_misc/lv_symbol_def.h b/src/lv_font/lv_symbol_def.h similarity index 100% rename from src/lv_misc/lv_symbol_def.h rename to src/lv_font/lv_symbol_def.h diff --git a/src/lv_fonts/lv_fonts.mk b/src/lv_fonts/lv_fonts.mk deleted file mode 100644 index 002fb75b6..000000000 --- a/src/lv_fonts/lv_fonts.mk +++ /dev/null @@ -1,23 +0,0 @@ -CSRCS += lv_font_builtin.c -CSRCS += lv_font_dejavu_10.c -CSRCS += lv_font_dejavu_20.c -CSRCS += lv_font_dejavu_30.c -CSRCS += lv_font_dejavu_40.c -CSRCS += lv_font_dejavu_10_cyrillic.c -CSRCS += lv_font_dejavu_20_cyrillic.c -CSRCS += lv_font_dejavu_30_cyrillic.c -CSRCS += lv_font_dejavu_40_cyrillic.c -CSRCS += lv_font_dejavu_10_latin_sup.c -CSRCS += lv_font_dejavu_20_latin_sup.c -CSRCS += lv_font_dejavu_30_latin_sup.c -CSRCS += lv_font_dejavu_40_latin_sup.c -CSRCS += lv_font_symbol_10.c -CSRCS += lv_font_symbol_20.c -CSRCS += lv_font_symbol_30.c -CSRCS += lv_font_symbol_40.c -CSRCS += lv_font_monospace_8.c - -DEPPATH += --dep-path $(LVGL_DIR)/lvgl/src/lv_fonts -VPATH += :$(LVGL_DIR)/lvgl/src/lv_fonts - -CFLAGS += "-I$(LVGL_DIR)/lvgl/src/lv_fonts" diff --git a/src/lv_misc/lv_misc.mk b/src/lv_misc/lv_misc.mk index 360cf2ee7..52ffe8904 100644 --- a/src/lv_misc/lv_misc.mk +++ b/src/lv_misc/lv_misc.mk @@ -1,4 +1,3 @@ -CSRCS += lv_font.c CSRCS += lv_circ.c CSRCS += lv_area.c CSRCS += lv_task.c diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index 85799d05f..b2f1d35ca 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -191,8 +191,8 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord /*Check for new line chars*/ if(letter == '\n' || letter == '\r') { uint32_t i_tmp = i; - uint32_t letter_next = lv_txt_encoded_next(txt, &i_tmp); - if(letter == '\r' && letter_next == '\n') i = i_tmp; + uint32_t n = lv_txt_encoded_next(txt, &i_tmp); + if(letter == '\r' && n == '\n') i = i_tmp; return i; /*Return with the first letter of the next line*/ diff --git a/src/lv_misc/lv_txt.h b/src/lv_misc/lv_txt.h index 1150d3f23..1527527e1 100644 --- a/src/lv_misc/lv_txt.h +++ b/src/lv_misc/lv_txt.h @@ -21,8 +21,8 @@ extern "C" { #include #include "lv_area.h" -#include "lv_font.h" #include "lv_area.h" +#include "../lv_font/lv_font.h" /********************* * DEFINES diff --git a/src/lv_objx/lv_ddlist.c b/src/lv_objx/lv_ddlist.c index 0f2f1986b..004f03690 100644 --- a/src/lv_objx/lv_ddlist.c +++ b/src/lv_objx/lv_ddlist.c @@ -13,7 +13,7 @@ #include "../lv_core/lv_group.h" #include "../lv_core/lv_indev.h" #include "../lv_themes/lv_theme.h" -#include "../lv_misc/lv_symbol_def.h" +#include "../lv_font/lv_symbol_def.h" #include "../lv_misc/lv_anim.h" #include "../lv_misc/lv_math.h" #include diff --git a/src/lv_objx/lv_img.h b/src/lv_objx/lv_img.h index 59b0b0019..5cfaae13a 100644 --- a/src/lv_objx/lv_img.h +++ b/src/lv_objx/lv_img.h @@ -23,7 +23,6 @@ extern "C" { #include "../lv_core/lv_obj.h" #include "../lv_misc/lv_fs.h" -#include "../lv_misc/lv_symbol_def.h" #include "lv_label.h" #include "../lv_draw/lv_draw.h" diff --git a/src/lv_objx/lv_label.h b/src/lv_objx/lv_label.h index 33f987695..33b5c3c83 100644 --- a/src/lv_objx/lv_label.h +++ b/src/lv_objx/lv_label.h @@ -22,9 +22,9 @@ extern "C" { #if LV_USE_LABEL != 0 #include "../lv_core/lv_obj.h" -#include "../lv_misc/lv_font.h" +#include "../lv_font/lv_font.h" +#include "../lv_font/lv_symbol_def.h" #include "../lv_misc/lv_txt.h" -#include "../lv_misc/lv_symbol_def.h" /********************* * DEFINES