Skip to content

Commit 48e1efb

Browse files
committed
font folder restructure and makefile fixes
1 parent 9139b58 commit 48e1efb

22 files changed

+35
-52
lines changed

lvgl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ extern "C" {
3030

3131
#include "src/lv_themes/lv_theme.h"
3232

33-
#include "src/lv_misc/lv_font.h"
34-
#include "src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h"
33+
#include "src/lv_font/lv_font.h"
34+
#include "src/lv_font/lv_font_fmt_txt.h"
3535

3636
#include "src/lv_objx/lv_btn.h"
3737
#include "src/lv_objx/lv_imgbtn.h"

lvgl.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(LVGL_DIR)/lvgl/src/lv_core/lv_core.mk
22
include $(LVGL_DIR)/lvgl/src/lv_hal/lv_hal.mk
33
include $(LVGL_DIR)/lvgl/src/lv_objx/lv_objx.mk
4-
include $(LVGL_DIR)/lvgl/src/lv_fonts/lv_fonts.mk
4+
include $(LVGL_DIR)/lvgl/src/lv_font/lv_font.mk
55
include $(LVGL_DIR)/lvgl/src/lv_misc/lv_misc.mk
66
include $(LVGL_DIR)/lvgl/src/lv_themes/lv_themes.mk
77
include $(LVGL_DIR)/lvgl/src/lv_draw/lv_draw.mk

src/lv_core/lv_style.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ extern "C" {
1414
* INCLUDES
1515
*********************/
1616
#include <stdbool.h>
17+
#include "../lv_font/lv_font.h"
1718
#include "../lv_misc/lv_color.h"
1819
#include "../lv_misc/lv_area.h"
19-
#include "../lv_misc/lv_font.h"
2020
#include "../lv_misc/lv_anim.h"
2121

2222
/*********************

src/lv_draw/lv_draw_basic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
#include "../lv_core/lv_refr.h"
1313
#include "../lv_hal/lv_hal.h"
14+
#include "../lv_font/lv_font.h"
1415
#include "../lv_misc/lv_area.h"
15-
#include "../lv_misc/lv_font.h"
1616
#include "../lv_misc/lv_color.h"
1717
#include "../lv_misc/lv_log.h"
1818

src/lv_draw/lv_draw_basic.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ extern "C" {
1919
#include "../../../lv_conf.h"
2020
#endif
2121

22+
#include "../lv_font/lv_font.h"
2223
#include "../lv_misc/lv_color.h"
2324
#include "../lv_misc/lv_area.h"
24-
#include "../lv_misc/lv_font.h"
2525

2626
/*********************
2727
* DEFINES

src/lv_misc/lv_font.c src/lv_font/lv_font.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*********************/
99

1010
#include "lv_font.h"
11-
#include "lv_log.h"
12-
#include "lv_utils.h"
11+
#include "../lv_misc/lv_utils.h"
12+
#include "../lv_misc/lv_log.h"
1313

1414
/*********************
1515
* DEFINES
File renamed without changes.

src/lv_font/lv_font.mk

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CSRCS += lv_font.c
2+
CSRCS += lv_font_fmt_txt.c
3+
CSRCS += lv_font_roboto_12.c
4+
CSRCS += lv_font_roboto_16.c
5+
CSRCS += lv_font_roboto_22.c
6+
CSRCS += lv_font_roboto_28.c
7+
8+
DEPPATH += --dep-path $(LVGL_DIR)/lvgl/src/lv_font
9+
VPATH += :$(LVGL_DIR)/lvgl/src/lv_font
10+
11+
CFLAGS += "-I$(LVGL_DIR)/lvgl/src/lv_font"

src/lv_misc/lv_font_fmt/lv_font_fmt_txt.c src/lv_font/lv_font_fmt_txt.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* INCLUDES
88
*********************/
99

10-
#include "../lv_font.h"
11-
#include "../lv_log.h"
12-
#include "../lv_utils.h"
10+
#include "lv_font.h"
1311
#include "lv_font_fmt_txt.h"
12+
#include "../lv_misc/lv_log.h"
13+
#include "../lv_misc/lv_utils.h"
1414

1515
/*********************
1616
* DEFINES
@@ -25,7 +25,7 @@
2525
**********************/
2626
static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter);
2727
static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t gid_right);
28-
static int32_t lv_font_codeCompare(const void * pRef, const void * pElement);
28+
//static int32_t lv_font_codeCompare(const void * pRef, const void * pElement);
2929

3030
/**********************
3131
* STATIC VARIABLES
@@ -78,11 +78,9 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t *
7878
if(!gid) return false;
7979

8080
int8_t kvalue = 0;
81-
const lv_font_fmt_txt_glyph_dsc_t * gdsc_next = NULL;
8281
if(fdsc->kern_dsc) {
8382
uint32_t gid_next = get_glyph_dsc_id(font, unicode_letter_next);
8483
if(gid_next) {
85-
gdsc_next = &fdsc->glyph_dsc[gid_next];
8684
kvalue = get_kern_value(font, gid, gid_next);
8785
}
8886
}
@@ -213,7 +211,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t
213211
* @retval > 0 Reference is less than element.
214212
*
215213
*/
216-
static int32_t lv_font_codeCompare(const void * pRef, const void * pElement)
217-
{
218-
return (*(uint16_t *)pRef) - (*(uint16_t *)pElement);
219-
}
214+
//static int32_t lv_font_codeCompare(const void * pRef, const void * pElement)
215+
//{
216+
// return (*(uint16_t *)pRef) - (*(uint16_t *)pElement);
217+
//}

src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h src/lv_font/lv_font_fmt_txt.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ extern "C" {
1616
#ifdef LV_CONF_INCLUDE_SIMPLE
1717
#include "lv_conf.h"
1818
#else
19-
#include "../../../../lv_conf.h"
19+
#include "../../../lv_conf.h"
2020
#endif
2121

2222
#include <stdint.h>
2323
#include <stddef.h>
2424
#include <stdbool.h>
25-
26-
#include "../lv_font.h"
25+
#include "lv_font.h"
2726

2827
/*********************
2928
* DEFINES
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/lv_fonts/lv_fonts.mk

-23
This file was deleted.

src/lv_misc/lv_misc.mk

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CSRCS += lv_font.c
21
CSRCS += lv_circ.c
32
CSRCS += lv_area.c
43
CSRCS += lv_task.c

src/lv_misc/lv_txt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord
191191
/*Check for new line chars*/
192192
if(letter == '\n' || letter == '\r') {
193193
uint32_t i_tmp = i;
194-
uint32_t letter_next = lv_txt_encoded_next(txt, &i_tmp);
195-
if(letter == '\r' && letter_next == '\n') i = i_tmp;
194+
uint32_t n = lv_txt_encoded_next(txt, &i_tmp);
195+
if(letter == '\r' && n == '\n') i = i_tmp;
196196

197197
return i; /*Return with the first letter of the next line*/
198198

src/lv_misc/lv_txt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ extern "C" {
2121

2222
#include <stdbool.h>
2323
#include "lv_area.h"
24-
#include "lv_font.h"
2524
#include "lv_area.h"
25+
#include "../lv_font/lv_font.h"
2626

2727
/*********************
2828
* DEFINES

src/lv_objx/lv_ddlist.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "../lv_core/lv_group.h"
1414
#include "../lv_core/lv_indev.h"
1515
#include "../lv_themes/lv_theme.h"
16-
#include "../lv_misc/lv_symbol_def.h"
16+
#include "../lv_font/lv_symbol_def.h"
1717
#include "../lv_misc/lv_anim.h"
1818
#include "../lv_misc/lv_math.h"
1919
#include <string.h>

src/lv_objx/lv_img.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ extern "C" {
2323

2424
#include "../lv_core/lv_obj.h"
2525
#include "../lv_misc/lv_fs.h"
26-
#include "../lv_misc/lv_symbol_def.h"
2726
#include "lv_label.h"
2827
#include "../lv_draw/lv_draw.h"
2928

src/lv_objx/lv_label.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ extern "C" {
2222
#if LV_USE_LABEL != 0
2323

2424
#include "../lv_core/lv_obj.h"
25-
#include "../lv_misc/lv_font.h"
25+
#include "../lv_font/lv_font.h"
26+
#include "../lv_font/lv_symbol_def.h"
2627
#include "../lv_misc/lv_txt.h"
27-
#include "../lv_misc/lv_symbol_def.h"
2828

2929
/*********************
3030
* DEFINES

0 commit comments

Comments
 (0)