diff --git a/lv_conf_templ.h b/lv_conf_templ.h index a97d9594e7..2deb7fa8e9 100644 --- a/lv_conf_templ.h +++ b/lv_conf_templ.h @@ -109,6 +109,9 @@ /*Text settings*/ #define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */ #define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/ +#define LV_TXT_LINE_BREAK_LONG_LEN 12 /* If a character is at least this long, will break wherever "prettiest" */ +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /* Minimum number of characters of a word to put on a line before a break */ +#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 0 /* Minimum number of characters of a word to put on a line after a break */ /*Feature usage*/ #define USE_LV_ANIMATION 1 /*1: Enable all animations*/ diff --git a/lv_misc/lv_txt.c b/lv_misc/lv_txt.c index 12df6bd50c..648915b5c8 100644 --- a/lv_misc/lv_txt.c +++ b/lv_misc/lv_txt.c @@ -13,9 +13,18 @@ * DEFINES *********************/ #define NO_BREAK_FOUND UINT32_MAX + +#ifndef LV_TXT_LINE_BREAK_LONG_LEN #define LV_TXT_LINE_BREAK_LONG_LEN 12 /* If a character is at least this long, will break wherever "prettiest" */ +#endif + +#ifndef LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /* Minimum number of characters of a word to put on a line before a break */ +#endif + +#ifndef LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 0 /* Minimum number of characters of a word to put on a line after a break */ +#endif /********************** * TYPEDEFS