merge dev
This commit is contained in:
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,7 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## v7.4.0 (planned on 01.09.2020)
|
## v7.4.0 (planned on 01.09.2020)
|
||||||
*Available in the `dev` branch*
|
|
||||||
|
### New features
|
||||||
|
- arc: add set value by click feature
|
||||||
|
- arc: add `LV_ARC_PART_KNOB` similarly to slider
|
||||||
|
- send gestures even is the the obejct was dragged. User can check dragging with `lv_indev_is_dragging(lv_indev_act())` in the event function.
|
||||||
|
- Add `lv_font_load()` function - Loads a `lv_font_t` object from a binary font file
|
||||||
|
- Add `lv_font_free()` function - Frees the memory allocated by the `lv_font_load()` function
|
||||||
|
- Add style caching to reduce acces time of properties with default value
|
||||||
|
|
||||||
## v7.3.1 (18.08.2020)
|
## v7.3.1 (18.08.2020)
|
||||||
|
|
||||||
@@ -16,6 +23,7 @@
|
|||||||
- Fix crash if `lv_table_set_col_cnt` is called before `lv_table_set_row_cnt` for the first time
|
- Fix crash if `lv_table_set_col_cnt` is called before `lv_table_set_row_cnt` for the first time
|
||||||
- Fix overflow in large image transformations
|
- Fix overflow in large image transformations
|
||||||
- Limit extra button click area of button matrix's buttons. With large paddings it was counter intuitive. (Gaps are mapped to button when clicked).
|
- Limit extra button click area of button matrix's buttons. With large paddings it was counter intuitive. (Gaps are mapped to button when clicked).
|
||||||
|
- Fix `lv_btnmatrix_set_one_check` not forcing exactly one button to be checked
|
||||||
- Fix color picker invalidation in rectangle mode
|
- Fix color picker invalidation in rectangle mode
|
||||||
- Init disabled days to gray color in calendar
|
- Init disabled days to gray color in calendar
|
||||||
|
|
||||||
@@ -26,10 +34,9 @@
|
|||||||
- Add `lv_event_send_refresh`, `lv_event_send_refresh_recursive` to easily send `LV_EVENT_REFRESH` to object
|
- Add `lv_event_send_refresh`, `lv_event_send_refresh_recursive` to easily send `LV_EVENT_REFRESH` to object
|
||||||
- Add `lv_tabview_set_tab_name()` function - used to change a tab's name
|
- Add `lv_tabview_set_tab_name()` function - used to change a tab's name
|
||||||
- Add `LV_THEME_MATERIAL_FLAG_NO_TRANSITION` and `LV_THEME_MATERIAL_FLAG_NO_FOCUS` flags
|
- Add `LV_THEME_MATERIAL_FLAG_NO_TRANSITION` and `LV_THEME_MATERIAL_FLAG_NO_FOCUS` flags
|
||||||
- Reduce code size by adding: `LV_USE_FONT_COMPRESSED`, `LV_FONT_USE_SUBPX`, `LV_USE_OUTLINE`, `LV_USE_PATTERN`, `LV_USE_VALUE_STR` and applying some optimization
|
- Reduce code size by adding: `LV_USE_FONT_COMPRESSED` and `LV_FONT_USE_SUBPX` and applying some optimization
|
||||||
- Add `LV_MEMCPY_MEMSET_STD` to use standard `memcpy` and `memset`
|
- Add `LV_MEMCPY_MEMSET_STD` to use standard `memcpy` and `memset`
|
||||||
|
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
- Do not print warning for missing glyph if its height OR width is zero.
|
- Do not print warning for missing glyph if its height OR width is zero.
|
||||||
- Prevent duplicated sending of `LV_EVENT_INSERT` from text area
|
- Prevent duplicated sending of `LV_EVENT_INSERT` from text area
|
||||||
|
|||||||
29
a.patch
Normal file
29
a.patch
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
diff --git a/scripts/release.py b/scripts/release.py
|
||||||
|
index 28370c66..bc5234e7 100755
|
||||||
|
--- a/scripts/release.py
|
||||||
|
+++ b/scripts/release.py
|
||||||
|
@@ -395,12 +395,12 @@ def docs_update_dev_version():
|
||||||
|
os.chdir("../")
|
||||||
|
|
||||||
|
|
||||||
|
-def publish_dev():
|
||||||
|
+def publish_dev_and_master():
|
||||||
|
pub_cmd = "git checkout dev; git push origin dev"
|
||||||
|
cmd("cd lvgl; " + pub_cmd)
|
||||||
|
+ pub_cmd = "git checkout master; git push origin master"
|
||||||
|
+ cmd("cd lvgl; " + pub_cmd)
|
||||||
|
|
||||||
|
- pub_cmd = "git checkout dev; git push origin dev"
|
||||||
|
- cmd("cd docs; " + pub_cmd)
|
||||||
|
cmd("cd docs; git checkout master; ./update.py latest dev")
|
||||||
|
|
||||||
|
def cleanup():
|
||||||
|
@@ -463,7 +463,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
|
lvgl_update_dev_version()
|
||||||
|
docs_update_dev_version()
|
||||||
|
- publish_dev()
|
||||||
|
+ publish_dev_and_master()
|
||||||
|
|
||||||
|
cleanup()
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file lv_conf.h
|
* @file lv_conf.h
|
||||||
* Configuration file for v7.3.1
|
* Configuration file for v7.6.0-dev-dev
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -687,6 +687,9 @@ typedef void * lv_obj_user_data_t;
|
|||||||
# define LV_ROLLER_INF_PAGES 7
|
# define LV_ROLLER_INF_PAGES 7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*Rotary (dependencies: lv_arc, lv_btn)*/
|
||||||
|
#define LV_USE_ROTARY 1
|
||||||
|
|
||||||
/*Slider (dependencies: lv_bar)*/
|
/*Slider (dependencies: lv_bar)*/
|
||||||
#define LV_USE_SLIDER 1
|
#define LV_USE_SLIDER 1
|
||||||
|
|
||||||
|
|||||||
13
lvgl.h
13
lvgl.h
@@ -40,6 +40,7 @@ extern "C" {
|
|||||||
#include "src/lv_themes/lv_theme.h"
|
#include "src/lv_themes/lv_theme.h"
|
||||||
|
|
||||||
#include "src/lv_font/lv_font.h"
|
#include "src/lv_font/lv_font.h"
|
||||||
|
#include "src/lv_font/lv_font_loader.h"
|
||||||
#include "src/lv_font/lv_font_fmt_txt.h"
|
#include "src/lv_font/lv_font_fmt_txt.h"
|
||||||
#include "src/lv_misc/lv_printf.h"
|
#include "src/lv_misc/lv_printf.h"
|
||||||
|
|
||||||
@@ -81,6 +82,18 @@ extern "C" {
|
|||||||
|
|
||||||
#include "src/lv_api_map.h"
|
#include "src/lv_api_map.h"
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* DEFINES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* TYPEDEFS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* GLOBAL PROTOTYPES
|
||||||
|
**********************/
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -1047,6 +1047,10 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*Rotary (dependencies: lv_arc, lv_btn)*/
|
||||||
|
#ifndef LV_USE_ROTARY
|
||||||
|
#define LV_USE_ROTARY 1
|
||||||
|
#endif
|
||||||
/*Slider (dependencies: lv_bar)*/
|
/*Slider (dependencies: lv_bar)*/
|
||||||
#ifndef LV_USE_SLIDER
|
#ifndef LV_USE_SLIDER
|
||||||
#define LV_USE_SLIDER 1
|
#define LV_USE_SLIDER 1
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ static inline void lv_scr_load(lv_obj_t * scr)
|
|||||||
* 1 dip is 2 px on a 320 DPI screen
|
* 1 dip is 2 px on a 320 DPI screen
|
||||||
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
|
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
|
||||||
*/
|
*/
|
||||||
#define LV_DPX(n) LV_MATH_MAX((( lv_disp_get_dpi(NULL) * (n) + 80) / 160), 1) /*+80 for rounding*/
|
#define LV_DPX(n) (n == 0 ? 0 :LV_MATH_MAX((( lv_disp_get_dpi(NULL) * (n) + 80) / 160), 1)) /*+80 for rounding*/
|
||||||
|
|
||||||
static inline lv_coord_t lv_dpx(lv_coord_t n)
|
static inline lv_coord_t lv_dpx(lv_coord_t n)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1490,7 +1490,6 @@ static lv_obj_t * get_dragged_obj(lv_obj_t * obj)
|
|||||||
static void indev_gesture(lv_indev_proc_t * proc)
|
static void indev_gesture(lv_indev_proc_t * proc)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(proc->types.pointer.drag_in_prog) return;
|
|
||||||
if(proc->types.pointer.gesture_sent) return;
|
if(proc->types.pointer.gesture_sent) return;
|
||||||
|
|
||||||
lv_obj_t * gesture_obj = proc->types.pointer.act_obj;
|
lv_obj_t * gesture_obj = proc->types.pointer.act_obj;
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ static void lv_event_mark_deleted(lv_obj_t * obj);
|
|||||||
static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find);
|
static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find);
|
||||||
static void lv_obj_del_async_cb(void * obj);
|
static void lv_obj_del_async_cb(void * obj);
|
||||||
static void obj_del_core(lv_obj_t * obj);
|
static void obj_del_core(lv_obj_t * obj);
|
||||||
|
static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop);
|
||||||
|
static void update_style_cache_children(lv_obj_t * obj);
|
||||||
|
static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
@@ -503,43 +505,11 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
|
|||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||||
|
|
||||||
if(lv_obj_get_hidden(obj)) return;
|
lv_area_t area_tmp;
|
||||||
|
lv_area_copy(&area_tmp, area);
|
||||||
|
bool visible = lv_obj_area_is_visible(obj, &area_tmp);
|
||||||
|
|
||||||
/*Invalidate the object only if it belongs to the curent or previous'*/
|
if(visible) _lv_inv_area(lv_obj_get_disp(obj), &area_tmp);
|
||||||
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
|
|
||||||
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
|
|
||||||
if(obj_scr == lv_disp_get_scr_act(disp) ||
|
|
||||||
obj_scr == lv_disp_get_scr_prev(disp) ||
|
|
||||||
obj_scr == lv_disp_get_layer_top(disp) ||
|
|
||||||
obj_scr == lv_disp_get_layer_sys(disp)) {
|
|
||||||
|
|
||||||
/*Truncate the area to the object*/
|
|
||||||
lv_area_t obj_coords;
|
|
||||||
lv_coord_t ext_size = obj->ext_draw_pad;
|
|
||||||
lv_area_copy(&obj_coords, &obj->coords);
|
|
||||||
obj_coords.x1 -= ext_size;
|
|
||||||
obj_coords.y1 -= ext_size;
|
|
||||||
obj_coords.x2 += ext_size;
|
|
||||||
obj_coords.y2 += ext_size;
|
|
||||||
|
|
||||||
bool is_common;
|
|
||||||
lv_area_t area_trunc;
|
|
||||||
|
|
||||||
is_common = _lv_area_intersect(&area_trunc, area, &obj_coords);
|
|
||||||
if(is_common == false) return; /*The area is not on the object*/
|
|
||||||
|
|
||||||
/*Truncate recursively to the parents*/
|
|
||||||
lv_obj_t * par = lv_obj_get_parent(obj);
|
|
||||||
while(par != NULL) {
|
|
||||||
is_common = _lv_area_intersect(&area_trunc, &area_trunc, &par->coords);
|
|
||||||
if(is_common == false) break; /*If no common parts with parent break;*/
|
|
||||||
if(lv_obj_get_hidden(par)) return; /*If the parent is hidden then the child is hidden and won't be drawn*/
|
|
||||||
|
|
||||||
par = lv_obj_get_parent(par);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(is_common) _lv_inv_area(disp, &area_trunc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -562,6 +532,74 @@ void lv_obj_invalidate(const lv_obj_t * obj)
|
|||||||
lv_obj_invalidate_area(obj, &obj_coords);
|
lv_obj_invalidate_area(obj, &obj_coords);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell whether an area of an object is visible (even partially) now or not
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @param area the are to check. The visible part of the area will be written back here.
|
||||||
|
* @return true: visible; false: not visible (hidden, out of parent, on other screen, etc)
|
||||||
|
*/
|
||||||
|
bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
|
||||||
|
{
|
||||||
|
if(lv_obj_get_hidden(obj)) return false;
|
||||||
|
|
||||||
|
/*Invalidate the object only if it belongs to the curent or previous'*/
|
||||||
|
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
|
||||||
|
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
|
||||||
|
if(obj_scr == lv_disp_get_scr_act(disp) ||
|
||||||
|
obj_scr == lv_disp_get_scr_prev(disp) ||
|
||||||
|
obj_scr == lv_disp_get_layer_top(disp) ||
|
||||||
|
obj_scr == lv_disp_get_layer_sys(disp)) {
|
||||||
|
|
||||||
|
/*Truncate the area to the object*/
|
||||||
|
lv_area_t obj_coords;
|
||||||
|
lv_coord_t ext_size = obj->ext_draw_pad;
|
||||||
|
lv_area_copy(&obj_coords, &obj->coords);
|
||||||
|
obj_coords.x1 -= ext_size;
|
||||||
|
obj_coords.y1 -= ext_size;
|
||||||
|
obj_coords.x2 += ext_size;
|
||||||
|
obj_coords.y2 += ext_size;
|
||||||
|
|
||||||
|
bool is_common;
|
||||||
|
|
||||||
|
is_common = _lv_area_intersect(area, area, &obj_coords);
|
||||||
|
if(is_common == false) return false; /*The area is not on the object*/
|
||||||
|
|
||||||
|
/*Truncate recursively to the parents*/
|
||||||
|
lv_obj_t * par = lv_obj_get_parent(obj);
|
||||||
|
while(par != NULL) {
|
||||||
|
is_common = _lv_area_intersect(area, area, &par->coords);
|
||||||
|
if(is_common == false) return false; /*If no common parts with parent break;*/
|
||||||
|
if(lv_obj_get_hidden(par)) return false; /*If the parent is hidden then the child is hidden and won't be drawn*/
|
||||||
|
|
||||||
|
par = lv_obj_get_parent(par);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell whether an object is visible (even partially) now or not
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @return true: visible; false: not visible (hidden, out of parent, on other screen, etc)
|
||||||
|
*/
|
||||||
|
bool lv_obj_is_visible(const lv_obj_t * obj)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_area_t obj_coords;
|
||||||
|
lv_coord_t ext_size = obj->ext_draw_pad;
|
||||||
|
lv_area_copy(&obj_coords, &obj->coords);
|
||||||
|
obj_coords.x1 -= ext_size;
|
||||||
|
obj_coords.y1 -= ext_size;
|
||||||
|
obj_coords.x2 += ext_size;
|
||||||
|
obj_coords.y2 += ext_size;
|
||||||
|
|
||||||
|
return lv_obj_area_is_visible(obj, &obj_coords);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Setter functions
|
* Setter functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -1120,7 +1158,7 @@ void lv_obj_add_style(lv_obj_t * obj, uint8_t part, lv_style_t * style)
|
|||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
trans_del(obj, part, 0xFF, NULL);
|
trans_del(obj, part, 0xFF, NULL);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1144,7 +1182,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint8_t part, lv_style_t * style)
|
|||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
trans_del(obj, part, 0xFF, NULL);
|
trans_del(obj, part, 0xFF, NULL);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1181,7 +1219,7 @@ void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part)
|
|||||||
{
|
{
|
||||||
lv_obj_clean_style_list(obj, part);
|
lv_obj_clean_style_list(obj, part);
|
||||||
|
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1203,7 +1241,7 @@ void _lv_obj_set_style_local_int(lv_obj_t * obj, uint8_t part, lv_style_property
|
|||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
trans_del(obj, part, prop, NULL);
|
trans_del(obj, part, prop, NULL);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_refresh_style(obj, prop & (~LV_STYLE_STATE_MASK));
|
lv_obj_refresh_style(obj, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1225,7 +1263,7 @@ void _lv_obj_set_style_local_color(lv_obj_t * obj, uint8_t part, lv_style_proper
|
|||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
trans_del(obj, part, prop, NULL);
|
trans_del(obj, part, prop, NULL);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_refresh_style(obj, prop & (~LV_STYLE_STATE_MASK));
|
lv_obj_refresh_style(obj, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1247,7 +1285,7 @@ void _lv_obj_set_style_local_opa(lv_obj_t * obj, uint8_t part, lv_style_property
|
|||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
trans_del(obj, part, prop, NULL);
|
trans_del(obj, part, prop, NULL);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_refresh_style(obj, prop & (~LV_STYLE_STATE_MASK));
|
lv_obj_refresh_style(obj, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1269,7 +1307,7 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t part, lv_style_property
|
|||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
trans_del(obj, part, prop, NULL);
|
trans_del(obj, part, prop, NULL);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_refresh_style(obj, prop & (~LV_STYLE_STATE_MASK));
|
lv_obj_refresh_style(obj, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1296,10 +1334,12 @@ bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_prope
|
|||||||
* @param obj pointer to an object
|
* @param obj pointer to an object
|
||||||
* @param prop `LV_STYLE_PROP_ALL` or an `LV_STYLE_...` property. It is used to optimize what needs to be refreshed.
|
* @param prop `LV_STYLE_PROP_ALL` or an `LV_STYLE_...` property. It is used to optimize what needs to be refreshed.
|
||||||
*/
|
*/
|
||||||
void lv_obj_refresh_style(lv_obj_t * obj, lv_style_property_t prop)
|
void lv_obj_refresh_style(lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
invalidate_style_cache(obj, part, prop);
|
||||||
|
|
||||||
/*If a real style refresh is required*/
|
/*If a real style refresh is required*/
|
||||||
bool real_refr = false;
|
bool real_refr = false;
|
||||||
switch(prop) {
|
switch(prop) {
|
||||||
@@ -1387,6 +1427,26 @@ void lv_obj_report_style_mod(lv_style_t * style)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable/disable the use of style cahche for an object
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @param dis true: disable; false: enable (re-enable)
|
||||||
|
*/
|
||||||
|
void _lv_obj_disable_style_caching(lv_obj_t * obj, bool dis)
|
||||||
|
{
|
||||||
|
uint8_t part;
|
||||||
|
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
if(list == NULL) break;
|
||||||
|
list->ignore_cache = dis;
|
||||||
|
}
|
||||||
|
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
if(list == NULL) break;
|
||||||
|
list->ignore_cache = dis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*-----------------
|
/*-----------------
|
||||||
* Attribute set
|
* Attribute set
|
||||||
*----------------*/
|
*----------------*/
|
||||||
@@ -1609,7 +1669,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
|||||||
|
|
||||||
#if LV_USE_ANIMATION == 0
|
#if LV_USE_ANIMATION == 0
|
||||||
obj->state = new_state;
|
obj->state = new_state;
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
#else
|
#else
|
||||||
lv_state_t prev_state = obj->state;
|
lv_state_t prev_state = obj->state;
|
||||||
obj->state = new_state;
|
obj->state = new_state;
|
||||||
@@ -1660,10 +1720,10 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2449,12 +2509,74 @@ lv_style_int_t _lv_obj_get_style_int(const lv_obj_t * obj, uint8_t part, lv_styl
|
|||||||
lv_res_t res = LV_RES_INV;
|
lv_res_t res = LV_RES_INV;
|
||||||
const lv_obj_t * parent = obj;
|
const lv_obj_t * parent = obj;
|
||||||
while(parent) {
|
while(parent) {
|
||||||
lv_style_list_t * dsc = lv_obj_get_style_list(parent, part);
|
lv_style_list_t * list = lv_obj_get_style_list(parent, part);
|
||||||
|
if(!list->ignore_cache && list->style_cnt > 0) {
|
||||||
|
if(!list->valid_cache) update_style_cache((lv_obj_t*)parent, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
|
|
||||||
|
bool def = false;
|
||||||
|
switch(prop & (~LV_STYLE_STATE_MASK)) {
|
||||||
|
case LV_STYLE_BG_GRAD_DIR:
|
||||||
|
if(list->bg_grad_dir_none) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_CLIP_CORNER:
|
||||||
|
if(list->clip_corner_off) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_TEXT_LETTER_SPACE:
|
||||||
|
case LV_STYLE_TEXT_LINE_SPACE:
|
||||||
|
if(list->text_space_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_TRANSFORM_ANGLE:
|
||||||
|
case LV_STYLE_TRANSFORM_WIDTH:
|
||||||
|
case LV_STYLE_TRANSFORM_HEIGHT:
|
||||||
|
case LV_STYLE_TRANSFORM_ZOOM:
|
||||||
|
if(list->transform_all_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_BORDER_WIDTH:
|
||||||
|
if(list->border_width_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_BORDER_SIDE:
|
||||||
|
if(list->border_side_full) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_BORDER_POST:
|
||||||
|
if(list->border_post_off) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_OUTLINE_WIDTH:
|
||||||
|
if(list->outline_width_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_RADIUS:
|
||||||
|
if(list->radius_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_SHADOW_WIDTH:
|
||||||
|
if(list->shadow_width_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_PAD_TOP:
|
||||||
|
case LV_STYLE_PAD_BOTTOM:
|
||||||
|
case LV_STYLE_PAD_LEFT:
|
||||||
|
case LV_STYLE_PAD_RIGHT:
|
||||||
|
if(list->pad_all_zero) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_BG_BLEND_MODE:
|
||||||
|
case LV_STYLE_BORDER_BLEND_MODE:
|
||||||
|
case LV_STYLE_IMAGE_BLEND_MODE:
|
||||||
|
case LV_STYLE_LINE_BLEND_MODE:
|
||||||
|
case LV_STYLE_OUTLINE_BLEND_MODE:
|
||||||
|
case LV_STYLE_PATTERN_BLEND_MODE:
|
||||||
|
case LV_STYLE_SHADOW_BLEND_MODE:
|
||||||
|
case LV_STYLE_TEXT_BLEND_MODE:
|
||||||
|
case LV_STYLE_VALUE_BLEND_MODE:
|
||||||
|
if(list->blend_mode_all_normal) def = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(def) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lv_state_t state = lv_obj_get_state(parent, part);
|
lv_state_t state = lv_obj_get_state(parent, part);
|
||||||
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
||||||
|
|
||||||
res = _lv_style_list_get_int(dsc, prop, &value_act);
|
res = _lv_style_list_get_int(list, prop, &value_act);
|
||||||
if(res == LV_RES_OK) return value_act;
|
if(res == LV_RES_OK) return value_act;
|
||||||
|
|
||||||
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
||||||
@@ -2512,12 +2634,12 @@ lv_color_t _lv_obj_get_style_color(const lv_obj_t * obj, uint8_t part, lv_style_
|
|||||||
lv_res_t res = LV_RES_INV;
|
lv_res_t res = LV_RES_INV;
|
||||||
const lv_obj_t * parent = obj;
|
const lv_obj_t * parent = obj;
|
||||||
while(parent) {
|
while(parent) {
|
||||||
lv_style_list_t * dsc = lv_obj_get_style_list(parent, part);
|
lv_style_list_t * list = lv_obj_get_style_list(parent, part);
|
||||||
|
|
||||||
lv_state_t state = lv_obj_get_state(parent, part);
|
lv_state_t state = lv_obj_get_state(parent, part);
|
||||||
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
||||||
|
|
||||||
res = _lv_style_list_get_color(dsc, prop, &value_act);
|
res = _lv_style_list_get_color(list, prop, &value_act);
|
||||||
if(res == LV_RES_OK) return value_act;
|
if(res == LV_RES_OK) return value_act;
|
||||||
|
|
||||||
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
||||||
@@ -2568,12 +2690,34 @@ lv_opa_t _lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prop
|
|||||||
lv_res_t res = LV_RES_INV;
|
lv_res_t res = LV_RES_INV;
|
||||||
const lv_obj_t * parent = obj;
|
const lv_obj_t * parent = obj;
|
||||||
while(parent) {
|
while(parent) {
|
||||||
lv_style_list_t * dsc = lv_obj_get_style_list(parent, part);
|
lv_style_list_t * list = lv_obj_get_style_list(parent, part);
|
||||||
|
|
||||||
|
if(!list->ignore_cache && list->style_cnt > 0) {
|
||||||
|
if(!list->valid_cache) update_style_cache((lv_obj_t*)parent, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
|
bool def = false;
|
||||||
|
switch(prop & (~LV_STYLE_STATE_MASK)) {
|
||||||
|
case LV_STYLE_OPA_SCALE:
|
||||||
|
if(list->opa_scale_cover) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_BG_OPA:
|
||||||
|
if(list->bg_opa_cover) return LV_OPA_COVER; /*Special case, not the default value is used*/
|
||||||
|
if(list->bg_opa_transp) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_IMAGE_RECOLOR_OPA:
|
||||||
|
if(list->img_recolor_opa_transp) def = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(def) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lv_state_t state = lv_obj_get_state(parent, part);
|
lv_state_t state = lv_obj_get_state(parent, part);
|
||||||
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
||||||
|
|
||||||
res = _lv_style_list_get_opa(dsc, prop, &value_act);
|
res = _lv_style_list_get_opa(list, prop, &value_act);
|
||||||
if(res == LV_RES_OK) return value_act;
|
if(res == LV_RES_OK) return value_act;
|
||||||
|
|
||||||
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
||||||
@@ -2625,12 +2769,32 @@ const void * _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_
|
|||||||
lv_res_t res = LV_RES_INV;
|
lv_res_t res = LV_RES_INV;
|
||||||
const lv_obj_t * parent = obj;
|
const lv_obj_t * parent = obj;
|
||||||
while(parent) {
|
while(parent) {
|
||||||
lv_style_list_t * dsc = lv_obj_get_style_list(parent, part);
|
lv_style_list_t * list = lv_obj_get_style_list(parent, part);
|
||||||
|
|
||||||
|
if(!list->ignore_cache && list->style_cnt > 0) {
|
||||||
|
if(!list->valid_cache) update_style_cache((lv_obj_t*)parent, part, prop & (~LV_STYLE_STATE_MASK));
|
||||||
|
bool def = false;
|
||||||
|
switch(prop & (~LV_STYLE_STATE_MASK)) {
|
||||||
|
case LV_STYLE_VALUE_STR:
|
||||||
|
if(list->value_txt_str) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_PATTERN_IMAGE:
|
||||||
|
if(list->pattern_img_null) def = true;
|
||||||
|
break;
|
||||||
|
case LV_STYLE_TEXT_FONT:
|
||||||
|
if(list->text_font_normal) def = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(def) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lv_state_t state = lv_obj_get_state(parent, part);
|
lv_state_t state = lv_obj_get_state(parent, part);
|
||||||
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
prop = (uint16_t)prop_ori + ((uint16_t)state << LV_STYLE_STATE_POS);
|
||||||
|
|
||||||
res = _lv_style_list_get_ptr(dsc, prop, &value_act);
|
res = _lv_style_list_get_ptr(list, prop, &value_act);
|
||||||
if(res == LV_RES_OK) return value_act;
|
if(res == LV_RES_OK) return value_act;
|
||||||
|
|
||||||
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
if(LV_STYLE_ATTR_GET_INHERIT(attr) == 0) break;
|
||||||
@@ -3144,9 +3308,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(draw_dsc->border_opa != LV_OPA_TRANSP) {
|
draw_dsc->border_width = lv_obj_get_style_border_width(obj, part);
|
||||||
draw_dsc->border_width = lv_obj_get_style_border_width(obj, part);
|
if(draw_dsc->border_width) {
|
||||||
if(draw_dsc->border_width) {
|
if(draw_dsc->border_opa != LV_OPA_TRANSP) {
|
||||||
draw_dsc->border_opa = lv_obj_get_style_border_opa(obj, part);
|
draw_dsc->border_opa = lv_obj_get_style_border_opa(obj, part);
|
||||||
if(draw_dsc->border_opa > LV_OPA_MIN) {
|
if(draw_dsc->border_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->border_side = lv_obj_get_style_border_side(obj, part);
|
draw_dsc->border_side = lv_obj_get_style_border_side(obj, part);
|
||||||
@@ -3159,9 +3323,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if LV_USE_OUTLINE
|
#if LV_USE_OUTLINE
|
||||||
if(draw_dsc->outline_opa != LV_OPA_TRANSP) {
|
draw_dsc->outline_width = lv_obj_get_style_outline_width(obj, part);
|
||||||
draw_dsc->outline_width = lv_obj_get_style_outline_width(obj, part);
|
if(draw_dsc->outline_width) {
|
||||||
if(draw_dsc->outline_width) {
|
if(draw_dsc->outline_opa != LV_OPA_TRANSP) {
|
||||||
draw_dsc->outline_opa = lv_obj_get_style_outline_opa(obj, part);
|
draw_dsc->outline_opa = lv_obj_get_style_outline_opa(obj, part);
|
||||||
if(draw_dsc->outline_opa > LV_OPA_MIN) {
|
if(draw_dsc->outline_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->outline_pad = lv_obj_get_style_outline_pad(obj, part);
|
draw_dsc->outline_pad = lv_obj_get_style_outline_pad(obj, part);
|
||||||
@@ -3175,9 +3339,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_PATTERN
|
#if LV_USE_PATTERN
|
||||||
if(draw_dsc->pattern_opa != LV_OPA_TRANSP) {
|
draw_dsc->pattern_image = lv_obj_get_style_pattern_image(obj, part);
|
||||||
draw_dsc->pattern_image = lv_obj_get_style_pattern_image(obj, part);
|
if(draw_dsc->pattern_image) {
|
||||||
if(draw_dsc->pattern_image) {
|
if(draw_dsc->pattern_opa != LV_OPA_TRANSP) {
|
||||||
draw_dsc->pattern_opa = lv_obj_get_style_pattern_opa(obj, part);
|
draw_dsc->pattern_opa = lv_obj_get_style_pattern_opa(obj, part);
|
||||||
if(draw_dsc->pattern_opa > LV_OPA_MIN) {
|
if(draw_dsc->pattern_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->pattern_recolor_opa = lv_obj_get_style_pattern_recolor_opa(obj, part);
|
draw_dsc->pattern_recolor_opa = lv_obj_get_style_pattern_recolor_opa(obj, part);
|
||||||
@@ -3198,9 +3362,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_SHADOW
|
#if LV_USE_SHADOW
|
||||||
if(draw_dsc->shadow_opa > LV_OPA_MIN) {
|
draw_dsc->shadow_width = lv_obj_get_style_shadow_width(obj, part);
|
||||||
draw_dsc->shadow_width = lv_obj_get_style_shadow_width(obj, part);
|
if(draw_dsc->shadow_width) {
|
||||||
if(draw_dsc->shadow_width) {
|
if(draw_dsc->shadow_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->shadow_opa = lv_obj_get_style_shadow_opa(obj, part);
|
draw_dsc->shadow_opa = lv_obj_get_style_shadow_opa(obj, part);
|
||||||
if(draw_dsc->shadow_opa > LV_OPA_MIN) {
|
if(draw_dsc->shadow_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->shadow_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part);
|
draw_dsc->shadow_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part);
|
||||||
@@ -3216,9 +3380,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_VALUE_STR
|
#if LV_USE_VALUE_STR
|
||||||
if(draw_dsc->value_opa > LV_OPA_MIN) {
|
draw_dsc->value_str = lv_obj_get_style_value_str(obj, part);
|
||||||
draw_dsc->value_str = lv_obj_get_style_value_str(obj, part);
|
if(draw_dsc->value_str) {
|
||||||
if(draw_dsc->value_str) {
|
if(draw_dsc->value_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->value_opa = lv_obj_get_style_value_opa(obj, part);
|
draw_dsc->value_opa = lv_obj_get_style_value_opa(obj, part);
|
||||||
if(draw_dsc->value_opa > LV_OPA_MIN) {
|
if(draw_dsc->value_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->value_ofs_x = lv_obj_get_style_value_ofs_x(obj, part);
|
draw_dsc->value_ofs_x = lv_obj_get_style_value_ofs_x(obj, part);
|
||||||
@@ -3308,6 +3472,9 @@ void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint8_t part, lv_draw_img_dsc_t *
|
|||||||
|
|
||||||
void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t * draw_dsc)
|
void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t * draw_dsc)
|
||||||
{
|
{
|
||||||
|
draw_dsc->width = lv_obj_get_style_line_width(obj, part);
|
||||||
|
if(draw_dsc->width == 0) return;
|
||||||
|
|
||||||
draw_dsc->opa = lv_obj_get_style_line_opa(obj, part);
|
draw_dsc->opa = lv_obj_get_style_line_opa(obj, part);
|
||||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||||
|
|
||||||
@@ -3319,9 +3486,6 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t
|
|||||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
draw_dsc->width = lv_obj_get_style_line_width(obj, part);
|
|
||||||
if(draw_dsc->width == 0) return;
|
|
||||||
|
|
||||||
draw_dsc->color = lv_obj_get_style_line_color(obj, part);
|
draw_dsc->color = lv_obj_get_style_line_color(obj, part);
|
||||||
|
|
||||||
draw_dsc->dash_width = lv_obj_get_style_line_dash_width(obj, part);
|
draw_dsc->dash_width = lv_obj_get_style_line_dash_width(obj, part);
|
||||||
@@ -3817,16 +3981,16 @@ static void refresh_children_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coor
|
|||||||
*/
|
*/
|
||||||
static void report_style_mod_core(void * style, lv_obj_t * obj)
|
static void report_style_mod_core(void * style, lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
uint8_t part_sub;
|
uint8_t part;
|
||||||
for(part_sub = 0; part_sub != _LV_OBJ_PART_REAL_LAST; part_sub++) {
|
for(part = 0; part != _LV_OBJ_PART_REAL_LAST; part++) {
|
||||||
lv_style_list_t * dsc = lv_obj_get_style_list(obj, part_sub);
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
if(dsc == NULL) break;
|
if(list == NULL) break;
|
||||||
|
|
||||||
uint8_t ci;
|
uint8_t ci;
|
||||||
for(ci = 0; ci < dsc->style_cnt; ci++) {
|
for(ci = 0; ci < list->style_cnt; ci++) {
|
||||||
lv_style_t * class = lv_style_list_get_style(dsc, ci);
|
lv_style_t * class = lv_style_list_get_style(list, ci);
|
||||||
if(class == style || style == NULL) {
|
if(class == style || style == NULL) {
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4207,7 +4371,7 @@ static void trans_anim_cb(lv_style_trans_t * tr, lv_anim_value_t v)
|
|||||||
else x = tr->end_value._ptr;
|
else x = tr->end_value._ptr;
|
||||||
_lv_style_set_ptr(style, tr->prop, x);
|
_lv_style_set_ptr(style, tr->prop, x);
|
||||||
}
|
}
|
||||||
lv_obj_refresh_style(tr->obj, tr->prop);
|
lv_obj_refresh_style(tr->obj, tr->part, tr->prop);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4302,3 +4466,204 @@ static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_fin
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool style_prop_is_cacheble(lv_style_property_t prop)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch(prop) {
|
||||||
|
case LV_STYLE_PROP_ALL:
|
||||||
|
case LV_STYLE_BG_GRAD_DIR:
|
||||||
|
case LV_STYLE_CLIP_CORNER:
|
||||||
|
case LV_STYLE_TEXT_LETTER_SPACE:
|
||||||
|
case LV_STYLE_TEXT_LINE_SPACE:
|
||||||
|
case LV_STYLE_TEXT_FONT:
|
||||||
|
case LV_STYLE_TRANSFORM_ANGLE:
|
||||||
|
case LV_STYLE_TRANSFORM_WIDTH:
|
||||||
|
case LV_STYLE_TRANSFORM_HEIGHT:
|
||||||
|
case LV_STYLE_TRANSFORM_ZOOM:
|
||||||
|
case LV_STYLE_BORDER_WIDTH:
|
||||||
|
case LV_STYLE_OUTLINE_WIDTH:
|
||||||
|
case LV_STYLE_RADIUS:
|
||||||
|
case LV_STYLE_SHADOW_WIDTH:
|
||||||
|
case LV_STYLE_OPA_SCALE:
|
||||||
|
case LV_STYLE_BG_OPA:
|
||||||
|
case LV_STYLE_BORDER_SIDE:
|
||||||
|
case LV_STYLE_BORDER_POST:
|
||||||
|
case LV_STYLE_IMAGE_RECOLOR_OPA:
|
||||||
|
case LV_STYLE_VALUE_STR:
|
||||||
|
case LV_STYLE_PATTERN_IMAGE:
|
||||||
|
case LV_STYLE_PAD_TOP:
|
||||||
|
case LV_STYLE_PAD_BOTTOM:
|
||||||
|
case LV_STYLE_PAD_LEFT:
|
||||||
|
case LV_STYLE_PAD_RIGHT:
|
||||||
|
case LV_STYLE_BG_BLEND_MODE:
|
||||||
|
case LV_STYLE_BORDER_BLEND_MODE:
|
||||||
|
case LV_STYLE_IMAGE_BLEND_MODE:
|
||||||
|
case LV_STYLE_LINE_BLEND_MODE:
|
||||||
|
case LV_STYLE_OUTLINE_BLEND_MODE:
|
||||||
|
case LV_STYLE_PATTERN_BLEND_MODE:
|
||||||
|
case LV_STYLE_SHADOW_BLEND_MODE:
|
||||||
|
case LV_STYLE_TEXT_BLEND_MODE:
|
||||||
|
case LV_STYLE_VALUE_BLEND_MODE:
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the cache of style list
|
||||||
|
* @param obj pointer to an obejct
|
||||||
|
* @param part the part of the object
|
||||||
|
* @param prop the property which triggered the update
|
||||||
|
*/
|
||||||
|
static void update_style_cache(lv_obj_t * obj, uint8_t part, uint16_t prop)
|
||||||
|
{
|
||||||
|
if(style_prop_is_cacheble(prop) == false) return;
|
||||||
|
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
|
||||||
|
bool ignore_cache_ori = list->ignore_cache;
|
||||||
|
list->ignore_cache = 1;
|
||||||
|
|
||||||
|
#if LV_USE_OPA_SCALE
|
||||||
|
list->opa_scale_cover = lv_obj_get_style_opa_scale(obj, part) == LV_OPA_COVER ? 1 : 0;
|
||||||
|
#else
|
||||||
|
list->opa_scale_cover = 1;
|
||||||
|
#endif
|
||||||
|
list->text_decor_none = lv_obj_get_style_text_decor(obj, part) == LV_TEXT_DECOR_NONE ? 1 : 0;
|
||||||
|
list->text_font_normal = lv_obj_get_style_text_font(obj, part) == LV_THEME_DEFAULT_FONT_NORMAL ? 1 : 0;
|
||||||
|
|
||||||
|
list->text_space_zero = 1;
|
||||||
|
if(lv_obj_get_style_text_letter_space(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_text_line_space(obj, part) != 0) {
|
||||||
|
list->text_space_zero = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lv_opa_t bg_opa = lv_obj_get_style_bg_opa(obj, part);
|
||||||
|
list->bg_opa_transp = bg_opa == LV_OPA_TRANSP ? 1 : 0;
|
||||||
|
list->bg_opa_cover = bg_opa == LV_OPA_COVER ? 1 : 0;
|
||||||
|
|
||||||
|
list->bg_grad_dir_none = lv_obj_get_style_bg_grad_dir(obj, part) == LV_GRAD_DIR_NONE ? 1 : 0;
|
||||||
|
list->border_width_zero = lv_obj_get_style_border_width(obj, part) == 0 ? 1 : 0;
|
||||||
|
list->border_side_full = lv_obj_get_style_border_side(obj, part) == LV_BORDER_SIDE_FULL ? 1 : 0;
|
||||||
|
list->border_post_off = lv_obj_get_style_border_post(obj, part) == 0 ? 1 : 0;
|
||||||
|
list->clip_corner_off = lv_obj_get_style_clip_corner(obj, part) == false ? 1 : 0;
|
||||||
|
list->img_recolor_opa_transp = lv_obj_get_style_image_recolor_opa(obj, part) == LV_OPA_TRANSP ? 1 : 0;
|
||||||
|
list->outline_width_zero = lv_obj_get_style_outline_width(obj, part) == 0 ? 1 : 0;
|
||||||
|
list->pattern_img_null = lv_obj_get_style_pattern_image(obj, part) == NULL ? 1 : 0;
|
||||||
|
list->radius_zero = lv_obj_get_style_radius(obj, part) == 0 ? 1 : 0;
|
||||||
|
list->shadow_width_zero = lv_obj_get_style_shadow_width(obj, part) == 0 ? 1 : 0;
|
||||||
|
list->value_txt_str = lv_obj_get_style_value_str(obj, part) == NULL ? 1 : 0;
|
||||||
|
|
||||||
|
|
||||||
|
list->transform_all_zero = 1;
|
||||||
|
if(lv_obj_get_style_transform_angle(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_transform_width(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_transform_height(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_transform_zoom(obj, part) != LV_IMG_ZOOM_NONE)
|
||||||
|
{
|
||||||
|
list->transform_all_zero = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
list->pad_all_zero = 1;
|
||||||
|
if(lv_obj_get_style_pad_top(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_pad_bottom(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_pad_left(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_pad_right(obj, part) != 0)
|
||||||
|
{
|
||||||
|
list->pad_all_zero = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
list->blend_mode_all_normal = 1;
|
||||||
|
#if LV_USE_BLEND_MODES
|
||||||
|
if(lv_obj_get_style_bg_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_border_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_pattern_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_outline_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_value_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_text_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_line_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_image_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL ||
|
||||||
|
lv_obj_get_style_shadow_blend_mode(obj, part) != LV_BLEND_MODE_NORMAL)
|
||||||
|
{
|
||||||
|
list->blend_mode_all_normal = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
list->ignore_cache = ignore_cache_ori;
|
||||||
|
list->valid_cache = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the cache of style list
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @param part the part of the object
|
||||||
|
*/
|
||||||
|
static void update_style_cache_children(lv_obj_t * obj)
|
||||||
|
{
|
||||||
|
uint8_t part;
|
||||||
|
for(part = 0; part != _LV_OBJ_PART_REAL_LAST; part++) {
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
if(list == NULL) break;
|
||||||
|
|
||||||
|
bool ignore_cache_ori = list->ignore_cache;
|
||||||
|
list->ignore_cache = 1;
|
||||||
|
|
||||||
|
list->opa_scale_cover = lv_obj_get_style_opa_scale(obj, part) == LV_OPA_COVER ? 1 : 0;
|
||||||
|
list->text_decor_none = lv_obj_get_style_text_decor(obj, part) == LV_TEXT_DECOR_NONE ? 1 : 0;
|
||||||
|
list->text_font_normal = lv_obj_get_style_text_font(obj, part) == lv_theme_get_font_normal() ? 1 : 0;
|
||||||
|
list->img_recolor_opa_transp = lv_obj_get_style_image_recolor_opa(obj, part) == LV_OPA_TRANSP ? 1 : 0;
|
||||||
|
|
||||||
|
list->text_space_zero = 1;
|
||||||
|
if(lv_obj_get_style_text_letter_space(obj, part) != 0 ||
|
||||||
|
lv_obj_get_style_text_line_space(obj, part) != 0) {
|
||||||
|
list->text_space_zero = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
list->ignore_cache = ignore_cache_ori;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_obj_t * child = lv_obj_get_child(obj, NULL);
|
||||||
|
while(child) {
|
||||||
|
update_style_cache_children(child);
|
||||||
|
child = lv_obj_get_child(obj, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark the object and all of it's children's style lists as invalid.
|
||||||
|
* The cache will be updated when a cached property asked nest time
|
||||||
|
* @param obj pointer to an object
|
||||||
|
*/
|
||||||
|
static void invalidate_style_cache(lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
|
||||||
|
{
|
||||||
|
if(style_prop_is_cacheble(prop) == false) return;
|
||||||
|
|
||||||
|
if(part != LV_OBJ_PART_ALL) {
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
if(list == NULL) return;
|
||||||
|
list->valid_cache = 0;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for(part = 0; part < _LV_OBJ_PART_REAL_FIRST; part++) {
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
if(list == NULL) break;
|
||||||
|
list->valid_cache = 0;
|
||||||
|
}
|
||||||
|
for(part = _LV_OBJ_PART_REAL_FIRST; part < 0xFF; part++) {
|
||||||
|
lv_style_list_t * list = lv_obj_get_style_list(obj, part);
|
||||||
|
if(list == NULL) break;
|
||||||
|
list->valid_cache = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_obj_t * child = lv_obj_get_child(obj, NULL);
|
||||||
|
while(child) {
|
||||||
|
update_style_cache_children(child);
|
||||||
|
child = lv_obj_get_child(obj, child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ enum {
|
|||||||
LV_EVENT_APPLY, /**< "Ok", "Apply" or similar specific button has clicked*/
|
LV_EVENT_APPLY, /**< "Ok", "Apply" or similar specific button has clicked*/
|
||||||
LV_EVENT_CANCEL, /**< "Close", "Cancel" or similar specific button has clicked*/
|
LV_EVENT_CANCEL, /**< "Close", "Cancel" or similar specific button has clicked*/
|
||||||
LV_EVENT_DELETE, /**< Object is being deleted */
|
LV_EVENT_DELETE, /**< Object is being deleted */
|
||||||
|
_LV_EVENT_LAST /** Number of events*/
|
||||||
};
|
};
|
||||||
typedef uint8_t lv_event_t; /**< Type of event being sent to the object. */
|
typedef uint8_t lv_event_t; /**< Type of event being sent to the object. */
|
||||||
|
|
||||||
@@ -353,6 +354,22 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area);
|
|||||||
*/
|
*/
|
||||||
void lv_obj_invalidate(const lv_obj_t * obj);
|
void lv_obj_invalidate(const lv_obj_t * obj);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell whether an area of an object is visible (even partially) now or not
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @param area the are to check. The visible part of the area will be written back here.
|
||||||
|
* @return true: visible; false: not visible (hidden, out of parent, on other screen, etc)
|
||||||
|
*/
|
||||||
|
bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell whether an object is visible (even partially) now or not
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @return true: visible; false: not visible (hidden, out of parent, on other screen, etc)
|
||||||
|
*/
|
||||||
|
bool lv_obj_is_visible(const lv_obj_t * obj);
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Setter functions
|
* Setter functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -586,7 +603,7 @@ void lv_obj_reset_style_list(lv_obj_t * obj, uint8_t part);
|
|||||||
* @param obj pointer to an object
|
* @param obj pointer to an object
|
||||||
* @param prop `LV_STYLE_PROP_ALL` or an `LV_STYLE_...` property. It is used to optimize what needs to be refreshed.
|
* @param prop `LV_STYLE_PROP_ALL` or an `LV_STYLE_...` property. It is used to optimize what needs to be refreshed.
|
||||||
*/
|
*/
|
||||||
void lv_obj_refresh_style(lv_obj_t * obj, lv_style_property_t prop);
|
void lv_obj_refresh_style(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify all object if a style is modified
|
* Notify all object if a style is modified
|
||||||
@@ -664,6 +681,13 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property
|
|||||||
*/
|
*/
|
||||||
bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
bool lv_obj_remove_style_local_prop(lv_obj_t * obj, uint8_t part, lv_style_property_t prop);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable/disable the use of style cahche for an object
|
||||||
|
* @param obj pointer to an object
|
||||||
|
* @param dis true: disable; false: enable (re-enable)
|
||||||
|
*/
|
||||||
|
void _lv_obj_disable_style_caching(lv_obj_t * obj, bool dis);
|
||||||
|
|
||||||
/*-----------------
|
/*-----------------
|
||||||
* Attribute set
|
* Attribute set
|
||||||
*----------------*/
|
*----------------*/
|
||||||
|
|||||||
@@ -1039,7 +1039,6 @@ bool lv_debug_check_style_list(const lv_style_list_t * list)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -221,11 +221,37 @@ typedef struct {
|
|||||||
#if LV_USE_ASSERT_STYLE
|
#if LV_USE_ASSERT_STYLE
|
||||||
uint32_t sentinel;
|
uint32_t sentinel;
|
||||||
#endif
|
#endif
|
||||||
uint8_t style_cnt;
|
uint32_t style_cnt :6;
|
||||||
uint8_t has_local : 1;
|
uint32_t has_local :1;
|
||||||
uint8_t has_trans : 1;
|
uint32_t has_trans :1;
|
||||||
uint8_t skip_trans : 1; /*1: Temporally skip the transition style if any*/
|
uint32_t skip_trans :1; /*1: Temporally skip the transition style if any*/
|
||||||
uint8_t ignore_trans : 1; /*1: Mark that this style list shouldn't receive transitions at all*/
|
uint32_t ignore_trans :1; /*1: Mark that this style list shouldn't receive transitions at all*/
|
||||||
|
uint32_t valid_cache :1; /*1: The cache is valid and can be used*/
|
||||||
|
uint32_t ignore_cache :1; /*1: Ignore cache while getting value of properties*/
|
||||||
|
|
||||||
|
uint32_t radius_zero :1;
|
||||||
|
uint32_t opa_scale_cover :1;
|
||||||
|
uint32_t clip_corner_off :1;
|
||||||
|
uint32_t transform_all_zero :1;
|
||||||
|
uint32_t pad_all_zero :1;
|
||||||
|
uint32_t blend_mode_all_normal :1;
|
||||||
|
uint32_t bg_opa_transp :1;
|
||||||
|
uint32_t bg_opa_cover :1;
|
||||||
|
uint32_t bg_grad_dir_none :1;
|
||||||
|
|
||||||
|
uint32_t border_width_zero :1;
|
||||||
|
uint32_t border_side_full :1;
|
||||||
|
uint32_t border_post_off :1;
|
||||||
|
|
||||||
|
uint32_t outline_width_zero :1;
|
||||||
|
uint32_t pattern_img_null :1;
|
||||||
|
uint32_t shadow_width_zero :1;
|
||||||
|
uint32_t value_txt_str :1;
|
||||||
|
uint32_t img_recolor_opa_transp :1;
|
||||||
|
|
||||||
|
uint32_t text_space_zero :1;
|
||||||
|
uint32_t text_decor_none :1;
|
||||||
|
uint32_t text_font_normal :1;
|
||||||
} lv_style_list_t;
|
} lv_style_list_t;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
CSRCS += lv_font.c
|
CSRCS += lv_font.c
|
||||||
CSRCS += lv_font_fmt_txt.c
|
CSRCS += lv_font_fmt_txt.c
|
||||||
|
CSRCS += lv_font_loader.c
|
||||||
CSRCS += lv_font_montserrat_12.c
|
CSRCS += lv_font_montserrat_12.c
|
||||||
CSRCS += lv_font_montserrat_14.c
|
CSRCS += lv_font_montserrat_14.c
|
||||||
CSRCS += lv_font_montserrat_16.c
|
CSRCS += lv_font_montserrat_16.c
|
||||||
|
|||||||
694
src/lv_font/lv_font_loader.c
Normal file
694
src/lv_font/lv_font_loader.c
Normal file
@@ -0,0 +1,694 @@
|
|||||||
|
/**
|
||||||
|
* @file lv_font_loader.c
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* INCLUDES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "../lvgl.h"
|
||||||
|
#include "../lv_misc/lv_fs.h"
|
||||||
|
#include "lv_font_loader.h"
|
||||||
|
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* TYPEDEFS
|
||||||
|
**********************/
|
||||||
|
typedef struct {
|
||||||
|
lv_fs_file_t * fp;
|
||||||
|
int8_t bit_pos;
|
||||||
|
uint8_t byte_value;
|
||||||
|
} bit_iterator_t;
|
||||||
|
|
||||||
|
typedef struct font_header_bin {
|
||||||
|
uint32_t version;
|
||||||
|
uint16_t tables_count;
|
||||||
|
uint16_t font_size;
|
||||||
|
uint16_t ascent;
|
||||||
|
int16_t descent;
|
||||||
|
uint16_t typo_ascent;
|
||||||
|
int16_t typo_descent;
|
||||||
|
uint16_t typo_line_gap;
|
||||||
|
int16_t min_y;
|
||||||
|
int16_t max_y;
|
||||||
|
uint16_t default_advance_width;
|
||||||
|
uint16_t kerning_scale;
|
||||||
|
uint8_t index_to_loc_format;
|
||||||
|
uint8_t glyph_id_format;
|
||||||
|
uint8_t advance_width_format;
|
||||||
|
uint8_t bits_per_pixel;
|
||||||
|
uint8_t xy_bits;
|
||||||
|
uint8_t wh_bits;
|
||||||
|
uint8_t advance_width_bits;
|
||||||
|
uint8_t compression_id;
|
||||||
|
uint8_t subpixels_mode;
|
||||||
|
uint8_t padding;
|
||||||
|
} font_header_bin_t;
|
||||||
|
|
||||||
|
typedef struct cmap_table_bin {
|
||||||
|
uint32_t data_offset;
|
||||||
|
uint32_t range_start;
|
||||||
|
uint16_t range_length;
|
||||||
|
uint16_t glyph_id_start;
|
||||||
|
uint16_t data_entries_count;
|
||||||
|
uint8_t format_type;
|
||||||
|
uint8_t padding;
|
||||||
|
} cmap_table_bin_t;
|
||||||
|
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* STATIC PROTOTYPES
|
||||||
|
**********************/
|
||||||
|
static bit_iterator_t init_bit_iterator(lv_fs_file_t * fp);
|
||||||
|
static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font);
|
||||||
|
int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t format, uint32_t start);
|
||||||
|
|
||||||
|
static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
|
||||||
|
static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res);
|
||||||
|
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* MACROS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a `lv_font_t` object from a binary font file
|
||||||
|
* @param font_name filename where the font file is located
|
||||||
|
* @return a pointer to the font or NULL in case of error
|
||||||
|
*/
|
||||||
|
lv_font_t * lv_font_load(const char * font_name)
|
||||||
|
{
|
||||||
|
bool success = false;
|
||||||
|
|
||||||
|
lv_font_t * font = lv_mem_alloc(sizeof(lv_font_t));
|
||||||
|
memset(font, 0, sizeof(lv_font_t));
|
||||||
|
|
||||||
|
lv_fs_file_t file;
|
||||||
|
lv_fs_res_t res = lv_fs_open(&file, font_name, LV_FS_MODE_RD);
|
||||||
|
|
||||||
|
if(res == LV_FS_RES_OK) {
|
||||||
|
success = lvgl_load_font(&file, font);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!success) {
|
||||||
|
LV_LOG_WARN("Error loading font file: %s\n", font_name);
|
||||||
|
/*
|
||||||
|
* When `lvgl_load_font` fails it can leak some pointers.
|
||||||
|
* All non-null pointers can be assumed as allocated and
|
||||||
|
* `lv_font_free` should free them correctly.
|
||||||
|
*/
|
||||||
|
lv_font_free(font);
|
||||||
|
font = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_fs_close(&file);
|
||||||
|
|
||||||
|
return font;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Frees the memory allocated by the `lv_font_load()` function
|
||||||
|
* @param font lv_font_t object created by the lv_font_load function
|
||||||
|
*/
|
||||||
|
void lv_font_free(lv_font_t * font)
|
||||||
|
{
|
||||||
|
if(NULL != font) {
|
||||||
|
lv_font_fmt_txt_dsc_t * dsc = (lv_font_fmt_txt_dsc_t *) font->dsc;
|
||||||
|
|
||||||
|
if(NULL != dsc) {
|
||||||
|
|
||||||
|
if(dsc->kern_classes == 0) {
|
||||||
|
lv_font_fmt_txt_kern_pair_t * kern_dsc =
|
||||||
|
(lv_font_fmt_txt_kern_pair_t *) dsc->kern_dsc;
|
||||||
|
|
||||||
|
if(NULL != kern_dsc) {
|
||||||
|
if(kern_dsc->glyph_ids)
|
||||||
|
lv_mem_free((void *) kern_dsc->glyph_ids);
|
||||||
|
|
||||||
|
if(kern_dsc->values)
|
||||||
|
lv_mem_free((void *) kern_dsc->values);
|
||||||
|
|
||||||
|
lv_mem_free((void *) kern_dsc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lv_font_fmt_txt_kern_classes_t * kern_dsc =
|
||||||
|
(lv_font_fmt_txt_kern_classes_t *) dsc->kern_dsc;
|
||||||
|
|
||||||
|
if(NULL != kern_dsc) {
|
||||||
|
if(kern_dsc->class_pair_values)
|
||||||
|
lv_mem_free((void *) kern_dsc->class_pair_values);
|
||||||
|
|
||||||
|
if(kern_dsc->left_class_mapping)
|
||||||
|
lv_mem_free((void *) kern_dsc->left_class_mapping);
|
||||||
|
|
||||||
|
if(kern_dsc->right_class_mapping)
|
||||||
|
lv_mem_free((void *) kern_dsc->right_class_mapping);
|
||||||
|
|
||||||
|
lv_mem_free((void *) kern_dsc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_font_fmt_txt_cmap_t * cmaps =
|
||||||
|
(lv_font_fmt_txt_cmap_t *) dsc->cmaps;
|
||||||
|
|
||||||
|
if(NULL != cmaps) {
|
||||||
|
for(int i = 0; i < dsc->cmap_num; ++i) {
|
||||||
|
if(NULL != cmaps[i].glyph_id_ofs_list)
|
||||||
|
lv_mem_free((void *) cmaps[i].glyph_id_ofs_list);
|
||||||
|
if(NULL != cmaps[i].unicode_list)
|
||||||
|
lv_mem_free((void *) cmaps[i].unicode_list);
|
||||||
|
}
|
||||||
|
lv_mem_free(cmaps);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(NULL != dsc->glyph_bitmap) {
|
||||||
|
lv_mem_free((void *) dsc->glyph_bitmap);
|
||||||
|
}
|
||||||
|
if(NULL != dsc->glyph_dsc) {
|
||||||
|
lv_mem_free((void *) dsc->glyph_dsc);
|
||||||
|
}
|
||||||
|
lv_mem_free(dsc);
|
||||||
|
}
|
||||||
|
lv_mem_free(font);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* STATIC FUNCTIONS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
static bit_iterator_t init_bit_iterator(lv_fs_file_t * fp)
|
||||||
|
{
|
||||||
|
bit_iterator_t it;
|
||||||
|
it.fp = fp;
|
||||||
|
it.bit_pos = -1;
|
||||||
|
it.byte_value = 0;
|
||||||
|
return it;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||||
|
{
|
||||||
|
int value = 0;
|
||||||
|
while(n_bits--) {
|
||||||
|
it->byte_value = it->byte_value << 1;
|
||||||
|
it->bit_pos--;
|
||||||
|
|
||||||
|
if(it->bit_pos < 0) {
|
||||||
|
it->bit_pos = 7;
|
||||||
|
*res = lv_fs_read(it->fp, &(it->byte_value), 1, NULL);
|
||||||
|
if(*res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int8_t bit = (it->byte_value & 0x80) ? 1 : 0;
|
||||||
|
|
||||||
|
value |= (bit << n_bits);
|
||||||
|
}
|
||||||
|
*res = LV_FS_RES_OK;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int read_bits_signed(bit_iterator_t * it, int n_bits, lv_fs_res_t * res)
|
||||||
|
{
|
||||||
|
int value = read_bits(it, n_bits, res);
|
||||||
|
if(value & (1 << (n_bits - 1))) {
|
||||||
|
for(int bit = n_bits; bit < 8; ++bit) {
|
||||||
|
value |= (1 << bit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int read_label(lv_fs_file_t * fp, int start, const char * label)
|
||||||
|
{
|
||||||
|
lv_fs_seek(fp, start);
|
||||||
|
|
||||||
|
uint32_t length;
|
||||||
|
char buf[4];
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, &length, 4, NULL) != LV_FS_RES_OK
|
||||||
|
|| lv_fs_read(fp, buf, 4, NULL) != LV_FS_RES_OK
|
||||||
|
|| memcmp(label, buf, 4) != 0) {
|
||||||
|
LV_LOG_WARN("Error reading '%s' label.", label);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
|
||||||
|
uint32_t cmaps_start, cmap_table_bin_t * cmap_table)
|
||||||
|
{
|
||||||
|
for(unsigned int i = 0; i < font_dsc->cmap_num; ++i) {
|
||||||
|
if(lv_fs_read(fp, &cmap_table[i], sizeof(cmap_table_bin_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_font_fmt_txt_cmap_t * cmap = (lv_font_fmt_txt_cmap_t *) & (font_dsc->cmaps[i]);
|
||||||
|
|
||||||
|
cmap->range_start = cmap_table[i].range_start;
|
||||||
|
cmap->range_length = cmap_table[i].range_length;
|
||||||
|
cmap->glyph_id_start = cmap_table[i].glyph_id_start;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(unsigned int i = 0; i < font_dsc->cmap_num; ++i) {
|
||||||
|
lv_fs_res_t res = lv_fs_seek(fp, cmaps_start + cmap_table[i].data_offset);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_font_fmt_txt_cmap_t * cmap = (lv_font_fmt_txt_cmap_t *) & (font_dsc->cmaps[i]);
|
||||||
|
|
||||||
|
switch(cmap_table[i].format_type) {
|
||||||
|
case 0: {
|
||||||
|
uint8_t ids_size = sizeof(uint8_t) * cmap_table[i].data_entries_count;
|
||||||
|
uint8_t * glyph_id_ofs_list = lv_mem_alloc(ids_size);
|
||||||
|
|
||||||
|
cmap->glyph_id_ofs_list = glyph_id_ofs_list;
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, glyph_id_ofs_list, ids_size, NULL) != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmap->type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL;
|
||||||
|
cmap->list_length = cmap->range_length;
|
||||||
|
cmap->unicode_list = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
cmap->type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY;
|
||||||
|
cmap->list_length = 0;
|
||||||
|
cmap->unicode_list = NULL;
|
||||||
|
cmap->glyph_id_ofs_list = NULL;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
case 3: {
|
||||||
|
uint32_t list_size = sizeof(uint16_t) * cmap_table[i].data_entries_count;
|
||||||
|
uint16_t * unicode_list = (uint16_t *) lv_mem_alloc(list_size);
|
||||||
|
|
||||||
|
cmap->unicode_list = unicode_list;
|
||||||
|
cmap->list_length = cmap_table[i].data_entries_count;
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, unicode_list, list_size, NULL) != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cmap_table[i].format_type == 1) {
|
||||||
|
uint16_t * buf = lv_mem_alloc(sizeof(uint16_t) * cmap->list_length);
|
||||||
|
|
||||||
|
cmap->type = LV_FONT_FMT_TXT_CMAP_SPARSE_FULL;
|
||||||
|
cmap->glyph_id_ofs_list = buf;
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, buf, sizeof(uint16_t) * cmap->list_length, NULL) != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cmap->type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY;
|
||||||
|
cmap->glyph_id_ofs_list = NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
LV_LOG_WARN("Unknown cmaps format type %d.", cmap_table[i].format_type);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t load_cmaps(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint32_t cmaps_start)
|
||||||
|
{
|
||||||
|
int32_t cmaps_length = read_label(fp, cmaps_start, "cmap");
|
||||||
|
if(cmaps_length < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t cmaps_subtables_count;
|
||||||
|
if(lv_fs_read(fp, &cmaps_subtables_count, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_font_fmt_txt_cmap_t * cmaps =
|
||||||
|
lv_mem_alloc(cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t));
|
||||||
|
|
||||||
|
memset(cmaps, 0, cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t));
|
||||||
|
|
||||||
|
font_dsc->cmaps = cmaps;
|
||||||
|
font_dsc->cmap_num = cmaps_subtables_count;
|
||||||
|
|
||||||
|
cmap_table_bin_t * cmaps_tables = lv_mem_alloc(sizeof(cmap_table_bin_t) * font_dsc->cmap_num);
|
||||||
|
|
||||||
|
bool success = load_cmaps_tables(fp, font_dsc, cmaps_start, cmaps_tables);
|
||||||
|
|
||||||
|
lv_mem_free(cmaps_tables);
|
||||||
|
|
||||||
|
return success ? cmaps_length : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc,
|
||||||
|
uint32_t start, uint32_t * glyph_offset, uint32_t loca_count, font_header_bin_t * header)
|
||||||
|
{
|
||||||
|
int32_t glyph_length = read_label(fp, start, "glyf");
|
||||||
|
if(glyph_length < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_font_fmt_txt_glyph_dsc_t * glyph_dsc = (lv_font_fmt_txt_glyph_dsc_t *)
|
||||||
|
lv_mem_alloc(loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t));
|
||||||
|
|
||||||
|
memset(glyph_dsc, 0, loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t));
|
||||||
|
|
||||||
|
font_dsc->glyph_dsc = glyph_dsc;
|
||||||
|
|
||||||
|
int cur_bmp_size = 0;
|
||||||
|
|
||||||
|
for(unsigned int i = 0; i < loca_count; ++i) {
|
||||||
|
lv_font_fmt_txt_glyph_dsc_t * gdsc = &glyph_dsc[i];
|
||||||
|
|
||||||
|
lv_fs_res_t res = lv_fs_seek(fp, start + glyph_offset[i]);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bit_iterator_t bit_it = init_bit_iterator(fp);
|
||||||
|
|
||||||
|
if(header->advance_width_bits == 0) {
|
||||||
|
gdsc->adv_w = header->default_advance_width;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gdsc->adv_w = read_bits(&bit_it, header->advance_width_bits, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(header->advance_width_format == 0) {
|
||||||
|
gdsc->adv_w *= 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
gdsc->ofs_x = read_bits_signed(&bit_it, header->xy_bits, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gdsc->ofs_y = read_bits_signed(&bit_it, header->xy_bits, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gdsc->box_w = read_bits(&bit_it, header->wh_bits, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gdsc->box_h = read_bits(&bit_it, header->wh_bits, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int nbits = header->advance_width_bits + 2 * header->xy_bits + 2 * header->wh_bits;
|
||||||
|
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)(glyph_length - 1);
|
||||||
|
int bmp_size = next_offset - glyph_offset[i] - nbits / 8;
|
||||||
|
|
||||||
|
if(i == 0) {
|
||||||
|
gdsc->adv_w = 0;
|
||||||
|
gdsc->box_w = 0;
|
||||||
|
gdsc->box_h = 0;
|
||||||
|
gdsc->ofs_x = 0;
|
||||||
|
gdsc->ofs_y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
gdsc->bitmap_index = cur_bmp_size;
|
||||||
|
if(gdsc->box_w * gdsc->box_h != 0) {
|
||||||
|
cur_bmp_size += bmp_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t * glyph_bmp = (uint8_t *) lv_mem_alloc(sizeof(uint8_t) * cur_bmp_size);
|
||||||
|
|
||||||
|
font_dsc->glyph_bitmap = glyph_bmp;
|
||||||
|
|
||||||
|
cur_bmp_size = 0;
|
||||||
|
|
||||||
|
for(unsigned int i = 1; i < loca_count; ++i) {
|
||||||
|
lv_fs_res_t res = lv_fs_seek(fp, start + glyph_offset[i]);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
bit_iterator_t bit_it = init_bit_iterator(fp);
|
||||||
|
|
||||||
|
int nbits = header->advance_width_bits + 2 * header->xy_bits + 2 * header->wh_bits;
|
||||||
|
|
||||||
|
read_bits(&bit_it, nbits, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(glyph_dsc[i].box_w * glyph_dsc[i].box_h == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)(glyph_length - 1);
|
||||||
|
int bmp_size = next_offset - glyph_offset[i] - nbits / 8;
|
||||||
|
|
||||||
|
for(int k = 0; k < bmp_size; ++k) {
|
||||||
|
glyph_bmp[cur_bmp_size + k] = read_bits(&bit_it, 8, &res);
|
||||||
|
if(res != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cur_bmp_size += bmp_size;
|
||||||
|
}
|
||||||
|
return glyph_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Loads a `lv_font_t` from a binary file, given a `lv_fs_file_t`.
|
||||||
|
*
|
||||||
|
* Memory allocations on `lvgl_load_font` should be immediately zeroed and
|
||||||
|
* the pointer should be set on the `lv_font_t` data before any possible return.
|
||||||
|
*
|
||||||
|
* When something fails, it returns `false` and the memory on the `lv_font_t`
|
||||||
|
* still needs to be freed using `lv_font_free`.
|
||||||
|
*
|
||||||
|
* `lv_font_free` will assume that all non-null pointers are allocated and
|
||||||
|
* should be freed.
|
||||||
|
*/
|
||||||
|
static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font)
|
||||||
|
{
|
||||||
|
lv_font_fmt_txt_dsc_t * font_dsc = (lv_font_fmt_txt_dsc_t *)
|
||||||
|
lv_mem_alloc(sizeof(lv_font_fmt_txt_dsc_t));
|
||||||
|
|
||||||
|
memset(font_dsc, 0, sizeof(lv_font_fmt_txt_dsc_t));
|
||||||
|
|
||||||
|
font->dsc = font_dsc;
|
||||||
|
|
||||||
|
/* header */
|
||||||
|
int32_t header_length = read_label(fp, 0, "head");
|
||||||
|
if(header_length < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
font_header_bin_t font_header;
|
||||||
|
if(lv_fs_read(fp, &font_header, sizeof(font_header_bin_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
font->base_line = -font_header.descent;
|
||||||
|
font->line_height = font_header.ascent - font_header.descent;
|
||||||
|
font->get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt;
|
||||||
|
font->get_glyph_bitmap = lv_font_get_bitmap_fmt_txt;
|
||||||
|
font->subpx = LV_FONT_SUBPX_NONE;
|
||||||
|
|
||||||
|
font_dsc->bpp = font_header.bits_per_pixel;
|
||||||
|
font_dsc->kern_scale = font_header.kerning_scale;
|
||||||
|
font_dsc->bitmap_format = font_header.compression_id;
|
||||||
|
|
||||||
|
/* cmaps */
|
||||||
|
uint32_t cmaps_start = header_length;
|
||||||
|
int32_t cmaps_length = load_cmaps(fp, font_dsc, cmaps_start);
|
||||||
|
if(cmaps_length < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loca */
|
||||||
|
uint32_t loca_start = cmaps_start + cmaps_length;
|
||||||
|
int32_t loca_length = read_label(fp, loca_start, "loca");
|
||||||
|
if(loca_length < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t loca_count;
|
||||||
|
if(lv_fs_read(fp, &loca_count, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool failed = false;
|
||||||
|
uint32_t * glyph_offset = lv_mem_alloc(sizeof(uint32_t) * (loca_count + 1));
|
||||||
|
|
||||||
|
for(unsigned int i = 0; i < loca_count; ++i) {
|
||||||
|
if(font_header.index_to_loc_format == 0) {
|
||||||
|
uint16_t offset;
|
||||||
|
if(lv_fs_read(fp, &offset, sizeof(uint16_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
failed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
glyph_offset[i] = offset;
|
||||||
|
}
|
||||||
|
else if(font_header.index_to_loc_format == 1) {
|
||||||
|
uint32_t offset;
|
||||||
|
if(lv_fs_read(fp, &offset, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
failed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
glyph_offset[i] = offset;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LV_LOG_WARN("Unknown index_to_loc_format: %d.", font_header.index_to_loc_format);
|
||||||
|
failed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(failed) {
|
||||||
|
lv_mem_free(glyph_offset);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* glyph */
|
||||||
|
uint32_t glyph_start = loca_start + loca_length;
|
||||||
|
int32_t glyph_length = load_glyph(
|
||||||
|
fp, font_dsc, glyph_start, glyph_offset, loca_count, &font_header);
|
||||||
|
|
||||||
|
lv_mem_free(glyph_offset);
|
||||||
|
|
||||||
|
if(glyph_length < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(font_header.tables_count < 4) {
|
||||||
|
font_dsc->kern_dsc = NULL;
|
||||||
|
font_dsc->kern_classes = 0;
|
||||||
|
font_dsc->kern_scale = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t kern_start = glyph_start + glyph_length;
|
||||||
|
|
||||||
|
int32_t kern_length = load_kern(fp, font_dsc, font_header.glyph_id_format, kern_start);
|
||||||
|
|
||||||
|
return kern_length >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t format, uint32_t start)
|
||||||
|
{
|
||||||
|
int32_t kern_length = read_label(fp, start, "kern");
|
||||||
|
if(kern_length < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t kern_format_type;
|
||||||
|
int32_t padding;
|
||||||
|
if(lv_fs_read(fp, &kern_format_type, sizeof(uint8_t), NULL) != LV_FS_RES_OK ||
|
||||||
|
lv_fs_read(fp, &padding, 3 * sizeof(uint8_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(0 == kern_format_type) { /* sorted pairs */
|
||||||
|
lv_font_fmt_txt_kern_pair_t * kern_pair = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_pair_t));
|
||||||
|
|
||||||
|
memset(kern_pair, 0, sizeof(lv_font_fmt_txt_kern_pair_t));
|
||||||
|
|
||||||
|
font_dsc->kern_dsc = kern_pair;
|
||||||
|
font_dsc->kern_classes = 0;
|
||||||
|
|
||||||
|
uint32_t glyph_entries;
|
||||||
|
if(lv_fs_read(fp, &glyph_entries, sizeof(uint32_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ids_size;
|
||||||
|
if(format == 0) {
|
||||||
|
ids_size = sizeof(int8_t) * 2 * glyph_entries;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ids_size = sizeof(int16_t) * 2 * glyph_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t * glyph_ids = lv_mem_alloc(ids_size);
|
||||||
|
int8_t * values = lv_mem_alloc(glyph_entries);
|
||||||
|
|
||||||
|
kern_pair->glyph_ids_size = format;
|
||||||
|
kern_pair->pair_cnt = glyph_entries;
|
||||||
|
kern_pair->glyph_ids = glyph_ids;
|
||||||
|
kern_pair->values = values;
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, glyph_ids, ids_size, NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, values, glyph_entries, NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(3 == kern_format_type) { /* array M*N of classes */
|
||||||
|
|
||||||
|
lv_font_fmt_txt_kern_classes_t * kern_classes = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_classes_t));
|
||||||
|
|
||||||
|
memset(kern_classes, 0, sizeof(lv_font_fmt_txt_kern_classes_t));
|
||||||
|
|
||||||
|
font_dsc->kern_dsc = kern_classes;
|
||||||
|
font_dsc->kern_classes = 1;
|
||||||
|
|
||||||
|
uint16_t kern_class_mapping_length;
|
||||||
|
uint8_t kern_table_rows;
|
||||||
|
uint8_t kern_table_cols;
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, &kern_class_mapping_length, sizeof(uint16_t), NULL) != LV_FS_RES_OK ||
|
||||||
|
lv_fs_read(fp, &kern_table_rows, sizeof(uint8_t), NULL) != LV_FS_RES_OK ||
|
||||||
|
lv_fs_read(fp, &kern_table_cols, sizeof(uint8_t), NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int kern_values_length = sizeof(int8_t) * kern_table_rows * kern_table_cols;
|
||||||
|
|
||||||
|
uint8_t * kern_left = lv_mem_alloc(kern_class_mapping_length);
|
||||||
|
uint8_t * kern_right = lv_mem_alloc(kern_class_mapping_length);
|
||||||
|
int8_t * kern_values = lv_mem_alloc(kern_values_length);
|
||||||
|
|
||||||
|
kern_classes->left_class_mapping = kern_left;
|
||||||
|
kern_classes->right_class_mapping = kern_right;
|
||||||
|
kern_classes->left_class_cnt = kern_table_rows;
|
||||||
|
kern_classes->right_class_cnt = kern_table_cols;
|
||||||
|
kern_classes->class_pair_values = kern_values;
|
||||||
|
|
||||||
|
if(lv_fs_read(fp, kern_left, kern_class_mapping_length, NULL) != LV_FS_RES_OK ||
|
||||||
|
lv_fs_read(fp, kern_right, kern_class_mapping_length, NULL) != LV_FS_RES_OK ||
|
||||||
|
lv_fs_read(fp, kern_values, kern_values_length, NULL) != LV_FS_RES_OK) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LV_LOG_WARN("Unknown kern_format_type: %d", kern_format_type);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return kern_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /*LV_USE_FILESYSTEM*/
|
||||||
|
|
||||||
44
src/lv_font/lv_font_loader.h
Normal file
44
src/lv_font/lv_font_loader.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* @file lv_font_loader.h
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LV_FONT_LOADER_H
|
||||||
|
#define LV_FONT_LOADER_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* INCLUDES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* DEFINES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* TYPEDEFS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* GLOBAL PROTOTYPES
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
|
||||||
|
lv_font_t * lv_font_load(const char * fontName);
|
||||||
|
void lv_font_free(lv_font_t * font);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* MACROS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*LV_FONT_LOADER_H*/
|
||||||
@@ -475,8 +475,11 @@ static void anim_task(lv_task_t * param)
|
|||||||
if(a->path.cb) new_value = a->path.cb(&a->path, a);
|
if(a->path.cb) new_value = a->path.cb(&a->path, a);
|
||||||
else new_value = lv_anim_path_linear(&a->path, a);
|
else new_value = lv_anim_path_linear(&a->path, a);
|
||||||
|
|
||||||
/*Apply the calculated value*/
|
if(new_value != a->current) {
|
||||||
if(a->exec_cb) a->exec_cb(a->var, new_value);
|
a->current = new_value;
|
||||||
|
/*Apply the calculated value*/
|
||||||
|
if(a->exec_cb) a->exec_cb(a->var, new_value);
|
||||||
|
}
|
||||||
|
|
||||||
/*If the time is elapsed the animation is ready*/
|
/*If the time is elapsed the animation is ready*/
|
||||||
if(a->act_time >= a->time) {
|
if(a->act_time >= a->time) {
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ typedef struct _lv_anim_t {
|
|||||||
lv_anim_ready_cb_t ready_cb; /**< Call it when the animation is ready*/
|
lv_anim_ready_cb_t ready_cb; /**< Call it when the animation is ready*/
|
||||||
lv_anim_path_t path; /**< Describe the path (curve) of animations*/
|
lv_anim_path_t path; /**< Describe the path (curve) of animations*/
|
||||||
int32_t start; /**< Start value*/
|
int32_t start; /**< Start value*/
|
||||||
|
int32_t current; /**< Current value */
|
||||||
int32_t end; /**< End value*/
|
int32_t end; /**< End value*/
|
||||||
int32_t time; /**< Animation time in ms*/
|
int32_t time; /**< Animation time in ms*/
|
||||||
int32_t act_time; /**< Current time in animation. Set to negative to make delay.*/
|
int32_t act_time; /**< Current time in animation. Set to negative to make delay.*/
|
||||||
@@ -171,6 +172,7 @@ static inline void lv_anim_set_delay(lv_anim_t * a, uint32_t delay)
|
|||||||
static inline void lv_anim_set_values(lv_anim_t * a, lv_anim_value_t start, lv_anim_value_t end)
|
static inline void lv_anim_set_values(lv_anim_t * a, lv_anim_value_t start, lv_anim_value_t end)
|
||||||
{
|
{
|
||||||
a->start = start;
|
a->start = start;
|
||||||
|
a->current = start;
|
||||||
a->end = end;
|
a->end = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ LV_ATTRIBUTE_FAST_MEM void _lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask
|
|||||||
q->f = (uint32_t)(root & 0xf) << 4;
|
q->f = (uint32_t)(root & 0xf) << 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the atan2 of a vector.
|
* Calculate the atan2 of a vector.
|
||||||
* @param x
|
* @param x
|
||||||
@@ -232,6 +231,32 @@ int64_t _lv_pow(int64_t base, int8_t exp)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the mapped of a number given an input and output range
|
||||||
|
* @param x integer which mapped value should be calculated
|
||||||
|
* @param min_in min input range
|
||||||
|
* @param max_in max input range
|
||||||
|
* @param min_out max output range
|
||||||
|
* @param max_out max output range
|
||||||
|
* @return the mapped number
|
||||||
|
*/
|
||||||
|
int16_t _lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32_t max_out)
|
||||||
|
{
|
||||||
|
if(x <= min_in) return min_out;
|
||||||
|
if(x >= max_in) return max_out;
|
||||||
|
|
||||||
|
/* The equation should be:
|
||||||
|
* ((x - min_in) / delta in) * delta_out + min_out
|
||||||
|
* To avoid rounding error reorder the operations:
|
||||||
|
* (((x - min_in) * delta_out) / delta in) + min_out
|
||||||
|
*/
|
||||||
|
|
||||||
|
int32_t delta_in = max_in - min_in;
|
||||||
|
int32_t delta_out = max_out - min_out;
|
||||||
|
|
||||||
|
return ((x - min_in) * delta_out) / delta_in + min_out;
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -112,6 +112,17 @@ LV_ATTRIBUTE_FAST_MEM void _lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask
|
|||||||
*/
|
*/
|
||||||
int64_t _lv_pow(int64_t base, int8_t exp);
|
int64_t _lv_pow(int64_t base, int8_t exp);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the mapped of a number given an input and output range
|
||||||
|
* @param x integer which mapped value should be calculated
|
||||||
|
* @param min_in min input range
|
||||||
|
* @param max_in max input range
|
||||||
|
* @param min_out max output range
|
||||||
|
* @param max_out max output range
|
||||||
|
* @return the mapped number
|
||||||
|
*/
|
||||||
|
int16_t _lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min, int32_t max);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ typedef enum {
|
|||||||
#if LV_USE_ROLLER
|
#if LV_USE_ROLLER
|
||||||
LV_THEME_ROLLER,
|
LV_THEME_ROLLER,
|
||||||
#endif
|
#endif
|
||||||
|
#if LV_USE_ROTARY
|
||||||
|
LV_THEME_ROTARY,
|
||||||
|
#endif
|
||||||
#if LV_USE_SLIDER
|
#if LV_USE_SLIDER
|
||||||
LV_THEME_SLIDER,
|
LV_THEME_SLIDER,
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ typedef struct {
|
|||||||
#if LV_USE_ARC
|
#if LV_USE_ARC
|
||||||
lv_style_t arc_indic;
|
lv_style_t arc_indic;
|
||||||
lv_style_t arc_bg;
|
lv_style_t arc_bg;
|
||||||
|
lv_style_t arc_knob;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR
|
||||||
@@ -505,6 +506,14 @@ static void arc_init(void)
|
|||||||
lv_style_set_line_color(&styles->arc_bg, LV_STATE_DEFAULT, COLOR_BG_SEC);
|
lv_style_set_line_color(&styles->arc_bg, LV_STATE_DEFAULT, COLOR_BG_SEC);
|
||||||
lv_style_set_line_width(&styles->arc_bg, LV_STATE_DEFAULT, LV_DPX(25));
|
lv_style_set_line_width(&styles->arc_bg, LV_STATE_DEFAULT, LV_DPX(25));
|
||||||
lv_style_set_line_rounded(&styles->arc_bg, LV_STATE_DEFAULT, true);
|
lv_style_set_line_rounded(&styles->arc_bg, LV_STATE_DEFAULT, true);
|
||||||
|
|
||||||
|
style_init_reset(&styles->arc_knob);
|
||||||
|
lv_style_set_radius(&styles->arc_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
|
||||||
|
lv_style_set_pad_top(&styles->arc_knob, LV_STATE_DEFAULT, LV_DPX(0));
|
||||||
|
lv_style_set_pad_bottom(&styles->arc_knob, LV_STATE_DEFAULT, LV_DPX(0));
|
||||||
|
lv_style_set_pad_left(&styles->arc_knob, LV_STATE_DEFAULT, LV_DPX(0));
|
||||||
|
lv_style_set_pad_right(&styles->arc_knob, LV_STATE_DEFAULT, LV_DPX(0));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,6 +629,9 @@ static void checkbox_init(void)
|
|||||||
lv_style_set_radius(&styles->cb_bullet, LV_STATE_DEFAULT, LV_DPX(4));
|
lv_style_set_radius(&styles->cb_bullet, LV_STATE_DEFAULT, LV_DPX(4));
|
||||||
lv_style_set_pattern_image(&styles->cb_bullet, LV_STATE_CHECKED, LV_SYMBOL_OK);
|
lv_style_set_pattern_image(&styles->cb_bullet, LV_STATE_CHECKED, LV_SYMBOL_OK);
|
||||||
lv_style_set_pattern_recolor(&styles->cb_bullet, LV_STATE_CHECKED, LV_COLOR_WHITE);
|
lv_style_set_pattern_recolor(&styles->cb_bullet, LV_STATE_CHECKED, LV_COLOR_WHITE);
|
||||||
|
lv_style_set_pattern_opa(&styles->cb_bullet, LV_STATE_DEFAULT, LV_OPA_TRANSP);
|
||||||
|
lv_style_set_pattern_opa(&styles->cb_bullet, LV_STATE_CHECKED, LV_OPA_COVER);
|
||||||
|
lv_style_set_transition_prop_3(&styles->cb_bullet, LV_STATE_DEFAULT, LV_STYLE_PATTERN_OPA);
|
||||||
lv_style_set_text_font(&styles->cb_bullet, LV_STATE_CHECKED, theme.font_small);
|
lv_style_set_text_font(&styles->cb_bullet, LV_STATE_CHECKED, theme.font_small);
|
||||||
lv_style_set_pad_left(&styles->cb_bullet, LV_STATE_DEFAULT, LV_DPX(3));
|
lv_style_set_pad_left(&styles->cb_bullet, LV_STATE_DEFAULT, LV_DPX(3));
|
||||||
lv_style_set_pad_right(&styles->cb_bullet, LV_STATE_DEFAULT, LV_DPX(3));
|
lv_style_set_pad_right(&styles->cb_bullet, LV_STATE_DEFAULT, LV_DPX(3));
|
||||||
@@ -1059,6 +1071,11 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
|||||||
|
|
||||||
list = lv_obj_get_style_list(obj, LV_ARC_PART_INDIC);
|
list = lv_obj_get_style_list(obj, LV_ARC_PART_INDIC);
|
||||||
_lv_style_list_add_style(list, &styles->arc_indic);
|
_lv_style_list_add_style(list, &styles->arc_indic);
|
||||||
|
|
||||||
|
list = lv_obj_get_style_list(obj, LV_ARC_PART_KNOB);
|
||||||
|
_lv_style_list_add_style(list, &styles->bg);
|
||||||
|
_lv_style_list_add_style(list, &styles->bg_click);
|
||||||
|
_lv_style_list_add_style(list, &styles->arc_knob);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1185,7 +1202,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if LV_USE_OBJMASK
|
#if LV_USE_OBJMASK
|
||||||
case LV_THEME_OBJMASK:
|
case LV_THEME_OBJMASK:
|
||||||
list = lv_obj_get_style_list(obj, LV_OBJMASK_PART_MAIN);
|
list = lv_obj_get_style_list(obj, LV_OBJMASK_PART_MAIN);
|
||||||
@@ -1368,7 +1384,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -1023,7 +1023,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_obj_refresh_style(obj, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(obj, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include "lv_arc.h"
|
#include "lv_arc.h"
|
||||||
#if LV_USE_ARC != 0
|
#if LV_USE_ARC != 0
|
||||||
|
|
||||||
|
#include "../lv_core/lv_group.h"
|
||||||
|
#include "../lv_core/lv_indev.h"
|
||||||
#include "../lv_misc/lv_debug.h"
|
#include "../lv_misc/lv_debug.h"
|
||||||
#include "../lv_misc/lv_math.h"
|
#include "../lv_misc/lv_math.h"
|
||||||
#include "../lv_draw/lv_draw_arc.h"
|
#include "../lv_draw/lv_draw_arc.h"
|
||||||
@@ -29,7 +31,9 @@
|
|||||||
static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area, lv_design_mode_t mode);
|
static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||||
static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param);
|
static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param);
|
||||||
static lv_style_list_t * lv_arc_get_style(lv_obj_t * arc, uint8_t part);
|
static lv_style_list_t * lv_arc_get_style(lv_obj_t * arc, uint8_t part);
|
||||||
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle);
|
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, lv_arc_part_t part);
|
||||||
|
static void get_center(lv_obj_t * arc, lv_point_t * center, lv_coord_t * arc_r);
|
||||||
|
static void get_knob_area(lv_obj_t * arc, const lv_point_t * center, lv_coord_t r, lv_area_t * knob_area);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
@@ -78,7 +82,16 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->bg_angle_end = 45;
|
ext->bg_angle_end = 45;
|
||||||
ext->arc_angle_start = 135;
|
ext->arc_angle_start = 135;
|
||||||
ext->arc_angle_end = 270;
|
ext->arc_angle_end = 270;
|
||||||
|
ext->type = LV_ARC_TYPE_NORMAL;
|
||||||
|
ext->cur_value = -1;
|
||||||
|
ext->min_value = 0;
|
||||||
|
ext->max_value = 100;
|
||||||
|
ext->dragging = false;
|
||||||
|
ext->chg_rate = 540;
|
||||||
|
ext->last_tick = lv_tick_get();
|
||||||
|
ext->last_angle = ext->arc_angle_end;
|
||||||
lv_style_list_init(&ext->style_arc);
|
lv_style_list_init(&ext->style_arc);
|
||||||
|
lv_style_list_init(&ext->style_knob);
|
||||||
|
|
||||||
lv_obj_set_size(arc, LV_DPI, LV_DPI);
|
lv_obj_set_size(arc, LV_DPI, LV_DPI);
|
||||||
|
|
||||||
@@ -88,6 +101,10 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
|
|
||||||
/*Init the new arc arc*/
|
/*Init the new arc arc*/
|
||||||
if(copy == NULL) {
|
if(copy == NULL) {
|
||||||
|
lv_obj_set_click(arc, true);
|
||||||
|
lv_obj_add_protect(arc, LV_PROTECT_PRESS_LOST);
|
||||||
|
lv_obj_set_ext_click_area(arc, LV_DPI / 10, LV_DPI / 10, LV_DPI / 10, LV_DPI / 10);
|
||||||
|
lv_arc_set_value(arc, ext->min_value);
|
||||||
lv_theme_apply(arc, LV_THEME_ARC);
|
lv_theme_apply(arc, LV_THEME_ARC);
|
||||||
}
|
}
|
||||||
/*Copy an existing arc*/
|
/*Copy an existing arc*/
|
||||||
@@ -97,11 +114,19 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->arc_angle_end = copy_ext->arc_angle_end;
|
ext->arc_angle_end = copy_ext->arc_angle_end;
|
||||||
ext->bg_angle_start = copy_ext->bg_angle_start;
|
ext->bg_angle_start = copy_ext->bg_angle_start;
|
||||||
ext->bg_angle_end = copy_ext->bg_angle_end;
|
ext->bg_angle_end = copy_ext->bg_angle_end;
|
||||||
|
ext->type = copy_ext->type;
|
||||||
|
ext->cur_value = copy_ext->cur_value;
|
||||||
|
ext->min_value = copy_ext->min_value;
|
||||||
|
ext->max_value = copy_ext->max_value;
|
||||||
|
ext->dragging = copy_ext->dragging;
|
||||||
|
ext->chg_rate = copy_ext->chg_rate;
|
||||||
|
ext->last_tick = copy_ext->last_tick;
|
||||||
|
ext->last_angle = copy_ext->last_angle;
|
||||||
|
lv_style_list_copy(&ext->style_knob, ©_ext->style_knob);
|
||||||
lv_style_list_copy(&ext->style_arc, ©_ext->style_arc);
|
lv_style_list_copy(&ext->style_arc, ©_ext->style_arc);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(arc, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(arc, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("arc created");
|
LV_LOG_INFO("arc created");
|
||||||
@@ -140,11 +165,11 @@ void lv_arc_set_start_angle(lv_obj_t * arc, uint16_t start)
|
|||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->arc_angle_start > ext->arc_angle_end && start > ext->arc_angle_end) {
|
else if(ext->arc_angle_start > ext->arc_angle_end && start > ext->arc_angle_end) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_start, start), LV_MATH_MAX(ext->arc_angle_start, start));
|
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_start, start), LV_MATH_MAX(ext->arc_angle_start, start), LV_ARC_PART_INDIC);
|
||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->arc_angle_start < ext->arc_angle_end && start < ext->arc_angle_end) {
|
else if(ext->arc_angle_start < ext->arc_angle_end && start < ext->arc_angle_end) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_start, start), LV_MATH_MAX(ext->arc_angle_start, start));
|
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_start, start), LV_MATH_MAX(ext->arc_angle_start, start), LV_ARC_PART_INDIC);
|
||||||
}
|
}
|
||||||
/*Crossing the start angle makes the whole arc change*/
|
/*Crossing the start angle makes the whole arc change*/
|
||||||
else {
|
else {
|
||||||
@@ -173,11 +198,11 @@ void lv_arc_set_end_angle(lv_obj_t * arc, uint16_t end)
|
|||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->arc_angle_end > ext->arc_angle_start && end > ext->arc_angle_start) {
|
else if(ext->arc_angle_end > ext->arc_angle_start && end > ext->arc_angle_start) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_end, end), LV_MATH_MAX(ext->arc_angle_end, end));
|
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_end, end), LV_MATH_MAX(ext->arc_angle_end, end), LV_ARC_PART_INDIC);
|
||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->arc_angle_end < ext->arc_angle_start && end < ext->arc_angle_start) {
|
else if(ext->arc_angle_end < ext->arc_angle_start && end < ext->arc_angle_start) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_end, end), LV_MATH_MAX(ext->arc_angle_end, end));
|
inv_arc_area(arc, LV_MATH_MIN(ext->arc_angle_end, end), LV_MATH_MAX(ext->arc_angle_end, end), LV_ARC_PART_INDIC);
|
||||||
}
|
}
|
||||||
/*Crossing the end angle makes the whole arc change*/
|
/*Crossing the end angle makes the whole arc change*/
|
||||||
else {
|
else {
|
||||||
@@ -203,12 +228,12 @@ void lv_arc_set_angles(lv_obj_t * arc, uint16_t start, uint16_t end)
|
|||||||
if(start > 360) start -= 360;
|
if(start > 360) start -= 360;
|
||||||
if(end > (start + 360)) end = start + 360;
|
if(end > (start + 360)) end = start + 360;
|
||||||
|
|
||||||
inv_arc_area(arc, ext->arc_angle_start, ext->arc_angle_end);
|
inv_arc_area(arc, ext->arc_angle_start, ext->arc_angle_end, LV_ARC_PART_INDIC);
|
||||||
|
|
||||||
ext->arc_angle_start = start;
|
ext->arc_angle_start = start;
|
||||||
ext->arc_angle_end = end;
|
ext->arc_angle_end = end;
|
||||||
|
|
||||||
inv_arc_area(arc, ext->arc_angle_start, ext->arc_angle_end);
|
inv_arc_area(arc, ext->arc_angle_start, ext->arc_angle_end, LV_ARC_PART_INDIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -230,11 +255,11 @@ void lv_arc_set_bg_start_angle(lv_obj_t * arc, uint16_t start)
|
|||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->bg_angle_start > ext->bg_angle_end && start > ext->bg_angle_end) {
|
else if(ext->bg_angle_start > ext->bg_angle_end && start > ext->bg_angle_end) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_start, start), LV_MATH_MAX(ext->bg_angle_start, start));
|
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_start, start), LV_MATH_MAX(ext->bg_angle_start, start), LV_ARC_PART_BG);
|
||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->bg_angle_start < ext->bg_angle_end && start < ext->bg_angle_end) {
|
else if(ext->bg_angle_start < ext->bg_angle_end && start < ext->bg_angle_end) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_start, start), LV_MATH_MAX(ext->bg_angle_start, start));
|
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_start, start), LV_MATH_MAX(ext->bg_angle_start, start), LV_ARC_PART_BG);
|
||||||
}
|
}
|
||||||
/*Crossing the start angle makes the whole arc change*/
|
/*Crossing the start angle makes the whole arc change*/
|
||||||
else {
|
else {
|
||||||
@@ -263,11 +288,11 @@ void lv_arc_set_bg_end_angle(lv_obj_t * arc, uint16_t end)
|
|||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->bg_angle_end > ext->bg_angle_start && end > ext->bg_angle_start) {
|
else if(ext->bg_angle_end > ext->bg_angle_start && end > ext->bg_angle_start) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_end, end), LV_MATH_MAX(ext->bg_angle_end, end));
|
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_end, end), LV_MATH_MAX(ext->bg_angle_end, end), LV_ARC_PART_BG);
|
||||||
}
|
}
|
||||||
/*Only a smaller incremental move*/
|
/*Only a smaller incremental move*/
|
||||||
else if(ext->bg_angle_end < ext->bg_angle_start && end < ext->bg_angle_start) {
|
else if(ext->bg_angle_end < ext->bg_angle_start && end < ext->bg_angle_start) {
|
||||||
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_end, end), LV_MATH_MAX(ext->bg_angle_end, end));
|
inv_arc_area(arc, LV_MATH_MIN(ext->bg_angle_end, end), LV_MATH_MAX(ext->bg_angle_end, end), LV_ARC_PART_BG);
|
||||||
}
|
}
|
||||||
/*Crossing the end angle makes the whole arc change*/
|
/*Crossing the end angle makes the whole arc change*/
|
||||||
else {
|
else {
|
||||||
@@ -292,12 +317,12 @@ void lv_arc_set_bg_angles(lv_obj_t * arc, uint16_t start, uint16_t end)
|
|||||||
if(start > 360) start -= 360;
|
if(start > 360) start -= 360;
|
||||||
if(end > (start + 360)) end = start + 360;
|
if(end > (start + 360)) end = start + 360;
|
||||||
|
|
||||||
inv_arc_area(arc, ext->bg_angle_start, ext->bg_angle_end);
|
inv_arc_area(arc, ext->bg_angle_start, ext->bg_angle_end, LV_ARC_PART_BG);
|
||||||
|
|
||||||
ext->bg_angle_start = start;
|
ext->bg_angle_start = start;
|
||||||
ext->bg_angle_end = end;
|
ext->bg_angle_end = end;
|
||||||
|
|
||||||
inv_arc_area(arc, ext->bg_angle_start, ext->bg_angle_end);
|
inv_arc_area(arc, ext->bg_angle_start, ext->bg_angle_end, LV_ARC_PART_BG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -316,6 +341,131 @@ void lv_arc_set_rotation(lv_obj_t * arc, uint16_t rotation_angle)
|
|||||||
lv_obj_invalidate(arc);
|
lv_obj_invalidate(arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the type of arc.
|
||||||
|
* @param arc pointer to arc object
|
||||||
|
* @param type arc type
|
||||||
|
*/
|
||||||
|
void lv_arc_set_type(lv_obj_t * arc, lv_arc_type_t type)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t *ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
int16_t val = ext->cur_value;
|
||||||
|
|
||||||
|
ext->type = type;
|
||||||
|
ext->cur_value = -1; /** Force set_value handling*/
|
||||||
|
|
||||||
|
int16_t bg_midpoint, bg_end = ext->bg_angle_end;
|
||||||
|
if (ext->bg_angle_end < ext->bg_angle_start) bg_end = ext->bg_angle_end + 360;
|
||||||
|
|
||||||
|
switch(ext->type) {
|
||||||
|
case LV_ARC_TYPE_SYMMETRIC:
|
||||||
|
bg_midpoint = (ext->bg_angle_start + bg_end) / 2;
|
||||||
|
lv_arc_set_start_angle(arc, bg_midpoint);
|
||||||
|
lv_arc_set_end_angle(arc, bg_midpoint);
|
||||||
|
break;
|
||||||
|
case LV_ARC_TYPE_REVERSE:
|
||||||
|
lv_arc_set_end_angle(arc, ext->bg_angle_end);
|
||||||
|
break;
|
||||||
|
default: /** LV_ARC_TYPE_NORMAL*/
|
||||||
|
lv_arc_set_start_angle(arc, ext->bg_angle_start);
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_arc_set_value(arc, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a new value on the arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @param value new value
|
||||||
|
*/
|
||||||
|
void lv_arc_set_value(lv_obj_t * arc, int16_t value)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t * ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
if(ext->cur_value == value) return;
|
||||||
|
|
||||||
|
int16_t new_value;
|
||||||
|
new_value = value > ext->max_value ? ext->max_value : value;
|
||||||
|
new_value = new_value < ext->min_value ? ext->min_value : new_value;
|
||||||
|
|
||||||
|
if(ext->cur_value == new_value) return;
|
||||||
|
ext->cur_value = new_value;
|
||||||
|
|
||||||
|
int16_t bg_midpoint, range_midpoint, bg_end = ext->bg_angle_end;
|
||||||
|
if (ext->bg_angle_end < ext->bg_angle_start) bg_end = ext->bg_angle_end + 360;
|
||||||
|
|
||||||
|
int16_t angle;
|
||||||
|
switch(ext->type) {
|
||||||
|
case LV_ARC_TYPE_SYMMETRIC:
|
||||||
|
bg_midpoint = (ext->bg_angle_start + bg_end) / 2;
|
||||||
|
range_midpoint = (int32_t)(ext->min_value + ext->max_value) / 2;
|
||||||
|
|
||||||
|
if (ext->cur_value < range_midpoint) {
|
||||||
|
angle = _lv_map(ext->cur_value, ext->min_value, range_midpoint, ext->bg_angle_start, bg_midpoint);
|
||||||
|
lv_arc_set_start_angle(arc, angle);
|
||||||
|
lv_arc_set_end_angle(arc, bg_midpoint);
|
||||||
|
} else {
|
||||||
|
angle = _lv_map(ext->cur_value, range_midpoint, ext->max_value, bg_midpoint, bg_end);
|
||||||
|
lv_arc_set_start_angle(arc, bg_midpoint);
|
||||||
|
lv_arc_set_end_angle(arc, angle);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LV_ARC_TYPE_REVERSE:
|
||||||
|
angle = _lv_map(ext->cur_value, ext->min_value, ext->max_value, ext->bg_angle_start, bg_end);
|
||||||
|
lv_arc_set_start_angle(arc, angle);
|
||||||
|
break;
|
||||||
|
default: /** LV_ARC_TYPE_NORMAL*/
|
||||||
|
angle = _lv_map(ext->cur_value, ext->min_value, ext->max_value, ext->bg_angle_start, bg_end);
|
||||||
|
lv_arc_set_end_angle(arc, angle);
|
||||||
|
}
|
||||||
|
ext->last_angle = angle; /*Cache angle for slew rate limiting*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set minimum and the maximum values of a arc
|
||||||
|
* @param arc pointer to the arc object
|
||||||
|
* @param min minimum value
|
||||||
|
* @param max maximum value
|
||||||
|
*/
|
||||||
|
void lv_arc_set_range(lv_obj_t * arc, int16_t min, int16_t max)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t * ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
if(ext->min_value == min && ext->max_value == max) return;
|
||||||
|
|
||||||
|
ext->min_value = min;
|
||||||
|
ext->max_value = max;
|
||||||
|
|
||||||
|
if(ext->cur_value < min) {
|
||||||
|
ext->cur_value = min;
|
||||||
|
}
|
||||||
|
if(ext->cur_value > max) {
|
||||||
|
ext->cur_value = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_arc_set_value(arc, ext->cur_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the threshold of arc knob increments
|
||||||
|
* position.
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @param threshold increment threshold
|
||||||
|
*/
|
||||||
|
void lv_arc_set_chg_rate(lv_obj_t * arc, uint16_t rate)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t *ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
ext->chg_rate = rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Getter functions
|
* Getter functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -376,6 +526,72 @@ uint16_t lv_arc_get_bg_angle_end(lv_obj_t * arc)
|
|||||||
return ext->bg_angle_end;
|
return ext->bg_angle_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of a arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return the value of the arc
|
||||||
|
*/
|
||||||
|
int16_t lv_arc_get_value(const lv_obj_t * arc)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t * ext = lv_obj_get_ext_attr(arc);
|
||||||
|
return ext->cur_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the minimum value of a arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return the minimum value of the arc
|
||||||
|
*/
|
||||||
|
int16_t lv_arc_get_min_value(const lv_obj_t * arc)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t *ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
return ext->min_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum value of a arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return the maximum value of the arc
|
||||||
|
*/
|
||||||
|
int16_t lv_arc_get_max_value(const lv_obj_t * arc)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t *ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
return ext->max_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Give the arc is being dragged or not
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return true: drag in progress false: not dragged
|
||||||
|
*/
|
||||||
|
bool lv_arc_is_dragged(const lv_obj_t * arc)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t * ext = lv_obj_get_ext_attr(arc);
|
||||||
|
return ext->dragging;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get whether the arc is type or not.
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return arc type
|
||||||
|
*/
|
||||||
|
lv_arc_type_t lv_arc_get_type(const lv_obj_t * arc)
|
||||||
|
{
|
||||||
|
LV_ASSERT_OBJ(arc, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_arc_ext_t * ext = (lv_arc_ext_t *)lv_obj_get_ext_attr(arc);
|
||||||
|
return ext->type;
|
||||||
|
}
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Other functions
|
* Other functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -414,21 +630,17 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
|
|||||||
|
|
||||||
lv_draw_rect(&arc->coords, clip_area, &bg_dsc);
|
lv_draw_rect(&arc->coords, clip_area, &bg_dsc);
|
||||||
|
|
||||||
lv_coord_t left_bg = lv_obj_get_style_pad_left(arc, LV_ARC_PART_BG);
|
lv_point_t center;
|
||||||
lv_coord_t right_bg = lv_obj_get_style_pad_right(arc, LV_ARC_PART_BG);
|
lv_coord_t arc_r;
|
||||||
lv_coord_t top_bg = lv_obj_get_style_pad_top(arc, LV_ARC_PART_BG);
|
get_center(arc, ¢er, &arc_r);
|
||||||
lv_coord_t bottom_bg = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_BG);
|
|
||||||
lv_coord_t r = (LV_MATH_MIN(lv_obj_get_width(arc) - left_bg - right_bg,
|
|
||||||
lv_obj_get_height(arc) - top_bg - bottom_bg)) / 2;
|
|
||||||
lv_draw_line_dsc_t arc_dsc;
|
|
||||||
lv_coord_t x = arc->coords.x1 + r + left_bg;
|
|
||||||
lv_coord_t y = arc->coords.y1 + r + top_bg;
|
|
||||||
|
|
||||||
if(r > 0) {
|
/*Draw the background arc*/
|
||||||
|
lv_draw_line_dsc_t arc_dsc;
|
||||||
|
if(arc_r > 0) {
|
||||||
lv_draw_line_dsc_init(&arc_dsc);
|
lv_draw_line_dsc_init(&arc_dsc);
|
||||||
lv_obj_init_draw_line_dsc(arc, LV_ARC_PART_BG, &arc_dsc);
|
lv_obj_init_draw_line_dsc(arc, LV_ARC_PART_BG, &arc_dsc);
|
||||||
|
|
||||||
lv_draw_arc(x, y, r, ext->bg_angle_start + ext->rotation_angle, ext->bg_angle_end + ext->rotation_angle, clip_area,
|
lv_draw_arc(center.x, center.y, arc_r, ext->bg_angle_start + ext->rotation_angle, ext->bg_angle_end + ext->rotation_angle, clip_area,
|
||||||
&arc_dsc);
|
&arc_dsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,15 +650,25 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
|
|||||||
lv_coord_t right_indic = lv_obj_get_style_pad_right(arc, LV_ARC_PART_INDIC);
|
lv_coord_t right_indic = lv_obj_get_style_pad_right(arc, LV_ARC_PART_INDIC);
|
||||||
lv_coord_t top_indic = lv_obj_get_style_pad_top(arc, LV_ARC_PART_INDIC);
|
lv_coord_t top_indic = lv_obj_get_style_pad_top(arc, LV_ARC_PART_INDIC);
|
||||||
lv_coord_t bottom_indic = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_INDIC);
|
lv_coord_t bottom_indic = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_INDIC);
|
||||||
r -= LV_MATH_MAX4(left_indic, right_indic, top_indic, bottom_indic);
|
lv_coord_t indic_r = arc_r - LV_MATH_MAX4(left_indic, right_indic, top_indic, bottom_indic);
|
||||||
|
|
||||||
if(r > 0) {
|
if(indic_r > 0) {
|
||||||
lv_draw_line_dsc_init(&arc_dsc);
|
lv_draw_line_dsc_init(&arc_dsc);
|
||||||
lv_obj_init_draw_line_dsc(arc, LV_ARC_PART_INDIC, &arc_dsc);
|
lv_obj_init_draw_line_dsc(arc, LV_ARC_PART_INDIC, &arc_dsc);
|
||||||
|
|
||||||
lv_draw_arc(x, y, r, ext->arc_angle_start + ext->rotation_angle, ext->arc_angle_end + ext->rotation_angle, clip_area,
|
lv_draw_arc(center.x, center.y, indic_r, ext->arc_angle_start + ext->rotation_angle, ext->arc_angle_end + ext->rotation_angle, clip_area,
|
||||||
&arc_dsc);
|
&arc_dsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lv_area_t knob_area;
|
||||||
|
get_knob_area(arc, ¢er, arc_r, &knob_area);
|
||||||
|
|
||||||
|
lv_draw_rect_dsc_t knob_rect_dsc;
|
||||||
|
lv_draw_rect_dsc_init(&knob_rect_dsc);
|
||||||
|
lv_obj_init_draw_rect_dsc(arc, LV_ARC_PART_KNOB, &knob_rect_dsc);
|
||||||
|
|
||||||
|
lv_draw_rect(&knob_area, clip_area, &knob_rect_dsc);
|
||||||
|
|
||||||
}
|
}
|
||||||
/*Post draw when the children are drawn*/
|
/*Post draw when the children are drawn*/
|
||||||
else if(mode == LV_DESIGN_DRAW_POST) {
|
else if(mode == LV_DESIGN_DRAW_POST) {
|
||||||
@@ -478,7 +700,119 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param)
|
|||||||
|
|
||||||
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
|
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
|
||||||
|
|
||||||
if(sign == LV_SIGNAL_CLEANUP) {
|
lv_arc_ext_t * ext = lv_obj_get_ext_attr(arc);
|
||||||
|
|
||||||
|
if(sign == LV_SIGNAL_PRESSING) {
|
||||||
|
lv_indev_t * indev = lv_indev_get_act();
|
||||||
|
if(indev == NULL) return res;
|
||||||
|
|
||||||
|
/*Handle only pointers here*/
|
||||||
|
lv_indev_type_t indev_type = lv_indev_get_type(indev);
|
||||||
|
if(indev_type != LV_INDEV_TYPE_POINTER) return res;
|
||||||
|
|
||||||
|
lv_point_t p;
|
||||||
|
lv_indev_get_point(indev, &p);
|
||||||
|
|
||||||
|
/*Make point relative to the arc's center*/
|
||||||
|
lv_point_t center;
|
||||||
|
lv_coord_t r;
|
||||||
|
get_center(arc, ¢er, &r);
|
||||||
|
|
||||||
|
p.x -= center.x;
|
||||||
|
p.y -= center.y;
|
||||||
|
|
||||||
|
/*Enter dragging mode if pressed out of the knob*/
|
||||||
|
if(ext->dragging == false) {
|
||||||
|
lv_coord_t indic_width = lv_obj_get_style_line_width(arc, LV_ARC_PART_INDIC);
|
||||||
|
r -= indic_width;
|
||||||
|
r -= r / 2; /*Add some more sensitive area*/
|
||||||
|
if(p.x * p.x + p.y * p.y > r * r) {
|
||||||
|
ext->dragging = true;
|
||||||
|
ext->last_tick = lv_tick_get(); /*Capture timestamp at dragging start*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*It must be in "dragging" mode to turn the arc*/
|
||||||
|
if(ext->dragging == false) return res;
|
||||||
|
|
||||||
|
/*Calculate the angle of the pressed point*/
|
||||||
|
int16_t angle;
|
||||||
|
int16_t bg_end = ext->bg_angle_end;
|
||||||
|
if (ext->bg_angle_end < ext->bg_angle_start) {
|
||||||
|
bg_end = ext->bg_angle_end + 360;
|
||||||
|
}
|
||||||
|
|
||||||
|
angle = 360 - _lv_atan2(p.x, p.y) + 90; /*Some transformation is required*/
|
||||||
|
if(angle < ext->bg_angle_start) angle = ext->bg_angle_start;
|
||||||
|
if(angle > bg_end) angle = bg_end;
|
||||||
|
|
||||||
|
/*Calculate the slew rate limited angle based on change rate (degrees/sec)*/
|
||||||
|
int16_t delta_angle = angle - ext->last_angle;
|
||||||
|
uint32_t delta_tick = lv_tick_elaps(ext->last_tick);
|
||||||
|
int16_t delta_angle_max = (ext->chg_rate * delta_tick) / 1000;
|
||||||
|
|
||||||
|
if (delta_angle > delta_angle_max) {
|
||||||
|
delta_angle = delta_angle_max;
|
||||||
|
} else if (delta_angle < -delta_angle_max) {
|
||||||
|
delta_angle = -delta_angle_max;
|
||||||
|
}
|
||||||
|
|
||||||
|
angle = ext->last_angle + delta_angle; /*Apply the limited angle change*/
|
||||||
|
|
||||||
|
/*Rounding for symmetry*/
|
||||||
|
int32_t round = ((bg_end - ext->bg_angle_start) * 8) / (ext->max_value - ext->min_value);
|
||||||
|
round = (round + 4) >> 4;
|
||||||
|
angle += round;
|
||||||
|
|
||||||
|
/*Set the new value*/
|
||||||
|
int16_t old_value = ext->cur_value;
|
||||||
|
int16_t new_value = _lv_map(angle, ext->bg_angle_start, bg_end, ext->min_value, ext->max_value);
|
||||||
|
if(new_value != lv_arc_get_value(arc)) {
|
||||||
|
ext->last_tick = lv_tick_get(); /*Cache timestamp for the next iteration*/
|
||||||
|
lv_arc_set_value(arc, new_value); /*set_value caches the last_angle for the next iteration*/
|
||||||
|
if(new_value != old_value) {
|
||||||
|
res = lv_event_send(arc, LV_EVENT_VALUE_CHANGED, NULL);
|
||||||
|
if(res != LV_RES_OK) return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Don1't let the elapsed time to big while sitting on an end point*/
|
||||||
|
if(new_value == ext->min_value || new_value == ext->max_value) {
|
||||||
|
ext->last_tick = lv_tick_get(); /*Cache timestamp for the next iteration*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_PRESS_LOST) {
|
||||||
|
ext->dragging = false;
|
||||||
|
|
||||||
|
#if LV_USE_GROUP
|
||||||
|
/*Leave edit mode if released. (No need to wait for LONG_PRESS) */
|
||||||
|
lv_group_t * g = lv_obj_get_group(arc);
|
||||||
|
bool editing = lv_group_get_editing(g);
|
||||||
|
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
|
||||||
|
if(indev_type == LV_INDEV_TYPE_ENCODER) {
|
||||||
|
if(editing) lv_group_set_editing(g, false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(sign == LV_SIGNAL_CONTROL) {
|
||||||
|
char c = *((char *)param);
|
||||||
|
|
||||||
|
int16_t old_value = ext->cur_value;
|
||||||
|
if(c == LV_KEY_RIGHT || c == LV_KEY_UP) {
|
||||||
|
lv_arc_set_value(arc, lv_arc_get_value(arc) + 1);
|
||||||
|
}
|
||||||
|
else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) {
|
||||||
|
lv_arc_set_value(arc, lv_arc_get_value(arc) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (old_value != ext->cur_value) {
|
||||||
|
res = lv_event_send(arc, LV_EVENT_VALUE_CHANGED, NULL);
|
||||||
|
if(res != LV_RES_OK) return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(sign == LV_SIGNAL_CLEANUP) {
|
||||||
|
lv_obj_clean_style_list(arc, LV_ARC_PART_KNOB);
|
||||||
lv_obj_clean_style_list(arc, LV_ARC_PART_INDIC);
|
lv_obj_clean_style_list(arc, LV_ARC_PART_INDIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,6 +840,9 @@ static lv_style_list_t * lv_arc_get_style(lv_obj_t * arc, uint8_t part)
|
|||||||
case LV_ARC_PART_INDIC:
|
case LV_ARC_PART_INDIC:
|
||||||
style_dsc_p = &ext->style_arc;
|
style_dsc_p = &ext->style_arc;
|
||||||
break;
|
break;
|
||||||
|
case LV_ARC_PART_KNOB:
|
||||||
|
style_dsc_p = &ext->style_knob;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
style_dsc_p = NULL;
|
style_dsc_p = NULL;
|
||||||
}
|
}
|
||||||
@@ -513,8 +850,11 @@ static lv_style_list_t * lv_arc_get_style(lv_obj_t * arc, uint8_t part)
|
|||||||
return style_dsc_p;
|
return style_dsc_p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle)
|
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, lv_arc_part_t part)
|
||||||
{
|
{
|
||||||
|
/*Skip this complicated invalidation if the arc is not visible*/
|
||||||
|
if(lv_obj_is_visible(arc) == false) return;
|
||||||
|
|
||||||
lv_arc_ext_t * ext = lv_obj_get_ext_attr(arc);
|
lv_arc_ext_t * ext = lv_obj_get_ext_attr(arc);
|
||||||
|
|
||||||
start_angle += ext->rotation_angle;
|
start_angle += ext->rotation_angle;
|
||||||
@@ -533,10 +873,26 @@ static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angl
|
|||||||
lv_coord_t rout = (LV_MATH_MIN(lv_obj_get_width(arc) - left - right, lv_obj_get_height(arc) - top - bottom)) / 2;
|
lv_coord_t rout = (LV_MATH_MIN(lv_obj_get_width(arc) - left - right, lv_obj_get_height(arc) - top - bottom)) / 2;
|
||||||
lv_coord_t x = arc->coords.x1 + rout + left;
|
lv_coord_t x = arc->coords.x1 + rout + left;
|
||||||
lv_coord_t y = arc->coords.y1 + rout + top;
|
lv_coord_t y = arc->coords.y1 + rout + top;
|
||||||
lv_style_int_t w = lv_obj_get_style_line_width(arc, LV_ARC_PART_INDIC);
|
lv_style_int_t w = lv_obj_get_style_line_width(arc, part);
|
||||||
lv_style_int_t rounded = lv_obj_get_style_line_rounded(arc, LV_ARC_PART_INDIC);
|
lv_style_int_t rounded = lv_obj_get_style_line_rounded(arc, part);
|
||||||
lv_coord_t rin = rout - w;
|
lv_coord_t rin = rout - w;
|
||||||
lv_coord_t extra_area = rounded ? w / 2 + 2 : 0;
|
lv_coord_t extra_area = 0;
|
||||||
|
|
||||||
|
extra_area = rounded ? w / 2 + 2 : 0;
|
||||||
|
|
||||||
|
if(part == LV_ARC_PART_INDIC && lv_style_list_get_style(&ext->style_knob, 0) != NULL) {
|
||||||
|
lv_coord_t knob_extra_size = lv_obj_get_draw_rect_ext_pad_size(arc, LV_ARC_PART_KNOB);
|
||||||
|
|
||||||
|
lv_coord_t knob_left = lv_obj_get_style_pad_left(arc, LV_ARC_PART_KNOB);
|
||||||
|
lv_coord_t knob_right = lv_obj_get_style_pad_right(arc, LV_ARC_PART_KNOB);
|
||||||
|
lv_coord_t knob_top = lv_obj_get_style_pad_top(arc, LV_ARC_PART_KNOB);
|
||||||
|
lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_KNOB);
|
||||||
|
|
||||||
|
knob_extra_size += LV_MATH_MAX4(knob_left, knob_right, knob_top, knob_bottom);
|
||||||
|
|
||||||
|
extra_area = LV_MATH_MAX(extra_area, w / 2 + 2 + knob_extra_size);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
lv_area_t inv_area;
|
lv_area_t inv_area;
|
||||||
|
|
||||||
@@ -617,4 +973,56 @@ static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angl
|
|||||||
lv_obj_invalidate(arc);
|
lv_obj_invalidate(arc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void get_center(lv_obj_t * arc, lv_point_t * center, lv_coord_t * arc_r)
|
||||||
|
{
|
||||||
|
lv_coord_t left_bg = lv_obj_get_style_pad_left(arc, LV_ARC_PART_BG);
|
||||||
|
lv_coord_t right_bg = lv_obj_get_style_pad_right(arc, LV_ARC_PART_BG);
|
||||||
|
lv_coord_t top_bg = lv_obj_get_style_pad_top(arc, LV_ARC_PART_BG);
|
||||||
|
lv_coord_t bottom_bg = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_BG);
|
||||||
|
|
||||||
|
lv_coord_t r = (LV_MATH_MIN(lv_obj_get_width(arc) - left_bg - right_bg,
|
||||||
|
lv_obj_get_height(arc) - top_bg - bottom_bg)) / 2;
|
||||||
|
|
||||||
|
*arc_r = r;
|
||||||
|
center->x = arc->coords.x1 + r + left_bg;
|
||||||
|
center->y = arc->coords.y1 + r + top_bg;
|
||||||
|
|
||||||
|
|
||||||
|
lv_coord_t indic_width = lv_obj_get_style_line_width(arc, LV_ARC_PART_INDIC);
|
||||||
|
r -= indic_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void get_knob_area(lv_obj_t * arc, const lv_point_t * center, lv_coord_t r, lv_area_t * knob_area)
|
||||||
|
{
|
||||||
|
lv_arc_ext_t * ext = lv_obj_get_ext_attr(arc);
|
||||||
|
|
||||||
|
lv_coord_t indic_width = lv_obj_get_style_line_width(arc, LV_ARC_PART_INDIC);
|
||||||
|
lv_coord_t indic_width_half = indic_width / 2;
|
||||||
|
r -= indic_width_half;
|
||||||
|
|
||||||
|
uint16_t angle = ext->rotation_angle;
|
||||||
|
if(ext->type == LV_ARC_TYPE_NORMAL) {
|
||||||
|
angle += ext->arc_angle_end;
|
||||||
|
} else if(ext->type == LV_ARC_TYPE_REVERSE) {
|
||||||
|
angle += ext->arc_angle_start;
|
||||||
|
} else if(ext->type == LV_ARC_TYPE_SYMMETRIC) {
|
||||||
|
int32_t range_midpoint = (int32_t)(ext->min_value + ext->max_value) / 2;
|
||||||
|
if(ext->cur_value < range_midpoint) angle += ext->arc_angle_start;
|
||||||
|
else angle += ext->arc_angle_end;
|
||||||
|
}
|
||||||
|
lv_coord_t knob_x = (r * _lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT;
|
||||||
|
lv_coord_t knob_y = (r * _lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT;
|
||||||
|
|
||||||
|
lv_coord_t left_knob = lv_obj_get_style_pad_left(arc, LV_ARC_PART_KNOB);
|
||||||
|
lv_coord_t right_knob = lv_obj_get_style_pad_right(arc, LV_ARC_PART_KNOB);
|
||||||
|
lv_coord_t top_knob = lv_obj_get_style_pad_top(arc, LV_ARC_PART_KNOB);
|
||||||
|
lv_coord_t bottom_knob = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_KNOB);
|
||||||
|
|
||||||
|
knob_area->x1 = center->x + knob_x - left_knob - indic_width_half;
|
||||||
|
knob_area->x2 = center->x + knob_x + right_knob + indic_width_half;
|
||||||
|
knob_area->y1 = center->y + knob_y - top_knob - indic_width_half;
|
||||||
|
knob_area->y2 = center->y + knob_y + bottom_knob + indic_width_half;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ extern "C" {
|
|||||||
/**********************
|
/**********************
|
||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
enum {
|
||||||
|
LV_ARC_TYPE_NORMAL,
|
||||||
|
LV_ARC_TYPE_SYMMETRIC,
|
||||||
|
LV_ARC_TYPE_REVERSE
|
||||||
|
};
|
||||||
|
typedef uint8_t lv_arc_type_t;
|
||||||
|
|
||||||
/*Data of arc*/
|
/*Data of arc*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/*New data for this type */
|
/*New data for this type */
|
||||||
@@ -35,14 +43,24 @@ typedef struct {
|
|||||||
uint16_t bg_angle_start;
|
uint16_t bg_angle_start;
|
||||||
uint16_t bg_angle_end;
|
uint16_t bg_angle_end;
|
||||||
lv_style_list_t style_arc;
|
lv_style_list_t style_arc;
|
||||||
|
lv_style_list_t style_knob; /* Style of the knob */
|
||||||
|
|
||||||
|
int16_t cur_value; /*Current value of the arc*/
|
||||||
|
int16_t min_value; /*Minimum value of the arc*/
|
||||||
|
int16_t max_value; /*Maximum value of the arc*/
|
||||||
|
uint16_t dragging :1;
|
||||||
|
uint16_t type :2;
|
||||||
|
uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/
|
||||||
|
uint32_t last_tick; /*Last dragging event timestamp of the arc*/
|
||||||
|
int16_t last_angle; /*Last dragging angle of the arc*/
|
||||||
} lv_arc_ext_t;
|
} lv_arc_ext_t;
|
||||||
|
|
||||||
/*Parts of the arc*/
|
/*Parts of the arc*/
|
||||||
enum {
|
enum {
|
||||||
LV_ARC_PART_BG = LV_OBJ_PART_MAIN,
|
LV_ARC_PART_BG = LV_OBJ_PART_MAIN,
|
||||||
LV_ARC_PART_INDIC,
|
LV_ARC_PART_INDIC,
|
||||||
|
LV_ARC_PART_KNOB,
|
||||||
_LV_ARC_PART_VIRTUAL_LAST,
|
_LV_ARC_PART_VIRTUAL_LAST,
|
||||||
|
|
||||||
_LV_ARC_PART_REAL_LAST = _LV_OBJ_PART_REAL_LAST,
|
_LV_ARC_PART_REAL_LAST = _LV_OBJ_PART_REAL_LAST,
|
||||||
};
|
};
|
||||||
typedef uint8_t lv_arc_part_t;
|
typedef uint8_t lv_arc_part_t;
|
||||||
@@ -118,6 +136,45 @@ void lv_arc_set_bg_angles(lv_obj_t * arc, uint16_t start, uint16_t end);
|
|||||||
*/
|
*/
|
||||||
void lv_arc_set_rotation(lv_obj_t * arc, uint16_t rotation_angle);
|
void lv_arc_set_rotation(lv_obj_t * arc, uint16_t rotation_angle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the type of arc.
|
||||||
|
* @param arc pointer to arc object
|
||||||
|
* @param type arc type
|
||||||
|
*/
|
||||||
|
void lv_arc_set_type(lv_obj_t * arc, lv_arc_type_t type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a new value on the arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @param value new value
|
||||||
|
*/
|
||||||
|
void lv_arc_set_value(lv_obj_t * arc, int16_t value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set minimum and the maximum values of a arc
|
||||||
|
* @param arc pointer to the arc object
|
||||||
|
* @param min minimum value
|
||||||
|
* @param max maximum value
|
||||||
|
*/
|
||||||
|
void lv_arc_set_range(lv_obj_t * arc, int16_t min, int16_t max);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse arc behavior. The indicator will grow from arc end instead of arc start.
|
||||||
|
* position.
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @param reverse true: enable disable reverse behavior; false: disable
|
||||||
|
*/
|
||||||
|
void lv_arc_set_reverse(lv_obj_t * arc, bool reverse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the threshold of arc knob increments
|
||||||
|
* position.
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @param threshold increment threshold
|
||||||
|
*/
|
||||||
|
void lv_arc_set_chg_rate(lv_obj_t * arc, uint16_t threshold);
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Getter functions
|
* Getter functions
|
||||||
*====================*/
|
*====================*/
|
||||||
@@ -150,6 +207,41 @@ uint16_t lv_arc_get_bg_angle_start(lv_obj_t * arc);
|
|||||||
*/
|
*/
|
||||||
uint16_t lv_arc_get_bg_angle_end(lv_obj_t * arc);
|
uint16_t lv_arc_get_bg_angle_end(lv_obj_t * arc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get whether the arc is type or not.
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return arc type
|
||||||
|
*/
|
||||||
|
lv_arc_type_t lv_arc_get_type(const lv_obj_t * arc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of the of a arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return the value of the of the arc
|
||||||
|
*/
|
||||||
|
int16_t lv_arc_get_value(const lv_obj_t * arc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the minimum value of a arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return the minimum value of the arc
|
||||||
|
*/
|
||||||
|
int16_t lv_arc_get_min_value(const lv_obj_t * arc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum value of a arc
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return the maximum value of the arc
|
||||||
|
*/
|
||||||
|
int16_t lv_arc_get_max_value(const lv_obj_t * arc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Give the arc is being dragged or not
|
||||||
|
* @param arc pointer to a arc object
|
||||||
|
* @return true: drag in progress false: not dragged
|
||||||
|
*/
|
||||||
|
bool lv_arc_is_dragged(const lv_obj_t * arc);
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Other functions
|
* Other functions
|
||||||
*====================*/
|
*====================*/
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ lv_obj_t * lv_bar_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_style_list_copy(&ext->style_indic, &ext_copy->style_indic);
|
lv_style_list_copy(&ext->style_indic, &ext_copy->style_indic);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(bar, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(bar, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
|
|
||||||
lv_bar_set_value(bar, ext->cur_value, LV_ANIM_OFF);
|
lv_bar_set_value(bar, ext->cur_value, LV_ANIM_OFF);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->checkable = copy_ext->checkable;
|
ext->checkable = copy_ext->checkable;
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(btn, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(btn, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("button created");
|
LV_LOG_INFO("button created");
|
||||||
|
|||||||
@@ -660,6 +660,7 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
|||||||
lv_draw_label_dsc_t draw_label_tmp_dsc;
|
lv_draw_label_dsc_t draw_label_tmp_dsc;
|
||||||
|
|
||||||
lv_state_t state_ori = btnm->state;
|
lv_state_t state_ori = btnm->state;
|
||||||
|
_lv_obj_disable_style_caching(btnm, true);
|
||||||
btnm->state = LV_STATE_DEFAULT;
|
btnm->state = LV_STATE_DEFAULT;
|
||||||
lv_draw_rect_dsc_init(&draw_rect_rel_dsc);
|
lv_draw_rect_dsc_init(&draw_rect_rel_dsc);
|
||||||
lv_draw_label_dsc_init(&draw_label_rel_dsc);
|
lv_draw_label_dsc_init(&draw_label_rel_dsc);
|
||||||
@@ -667,6 +668,7 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
|||||||
lv_obj_init_draw_label_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_label_rel_dsc);
|
lv_obj_init_draw_label_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_label_rel_dsc);
|
||||||
draw_label_rel_dsc.flag = txt_flag;
|
draw_label_rel_dsc.flag = txt_flag;
|
||||||
btnm->state = state_ori;
|
btnm->state = state_ori;
|
||||||
|
_lv_obj_disable_style_caching(btnm, false);
|
||||||
|
|
||||||
bool chk_inited = false;
|
bool chk_inited = false;
|
||||||
bool disabled_inited = false;
|
bool disabled_inited = false;
|
||||||
@@ -711,12 +713,14 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
|||||||
else if(btn_state == LV_STATE_CHECKED) {
|
else if(btn_state == LV_STATE_CHECKED) {
|
||||||
if(!chk_inited) {
|
if(!chk_inited) {
|
||||||
btnm->state = LV_STATE_CHECKED;
|
btnm->state = LV_STATE_CHECKED;
|
||||||
|
_lv_obj_disable_style_caching(btnm, true);
|
||||||
lv_draw_rect_dsc_init(&draw_rect_chk_dsc);
|
lv_draw_rect_dsc_init(&draw_rect_chk_dsc);
|
||||||
lv_draw_label_dsc_init(&draw_label_chk_dsc);
|
lv_draw_label_dsc_init(&draw_label_chk_dsc);
|
||||||
lv_obj_init_draw_rect_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_rect_chk_dsc);
|
lv_obj_init_draw_rect_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_rect_chk_dsc);
|
||||||
lv_obj_init_draw_label_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_label_chk_dsc);
|
lv_obj_init_draw_label_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_label_chk_dsc);
|
||||||
draw_label_chk_dsc.flag = txt_flag;
|
draw_label_chk_dsc.flag = txt_flag;
|
||||||
btnm->state = state_ori;
|
btnm->state = state_ori;
|
||||||
|
_lv_obj_disable_style_caching(btnm, false);
|
||||||
chk_inited = true;
|
chk_inited = true;
|
||||||
}
|
}
|
||||||
draw_rect_dsc_act = &draw_rect_chk_dsc;
|
draw_rect_dsc_act = &draw_rect_chk_dsc;
|
||||||
@@ -725,12 +729,14 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
|||||||
else if(btn_state == LV_STATE_CHECKED) {
|
else if(btn_state == LV_STATE_CHECKED) {
|
||||||
if(!disabled_inited) {
|
if(!disabled_inited) {
|
||||||
btnm->state = LV_STATE_DISABLED;
|
btnm->state = LV_STATE_DISABLED;
|
||||||
|
_lv_obj_disable_style_caching(btnm, true);
|
||||||
lv_draw_rect_dsc_init(&draw_rect_ina_dsc);
|
lv_draw_rect_dsc_init(&draw_rect_ina_dsc);
|
||||||
lv_draw_label_dsc_init(&draw_label_ina_dsc);
|
lv_draw_label_dsc_init(&draw_label_ina_dsc);
|
||||||
lv_obj_init_draw_rect_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_rect_ina_dsc);
|
lv_obj_init_draw_rect_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_rect_ina_dsc);
|
||||||
lv_obj_init_draw_label_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_label_ina_dsc);
|
lv_obj_init_draw_label_dsc(btnm, LV_BTNMATRIX_PART_BTN, &draw_label_ina_dsc);
|
||||||
draw_label_ina_dsc.flag = txt_flag;
|
draw_label_ina_dsc.flag = txt_flag;
|
||||||
btnm->state = state_ori;
|
btnm->state = state_ori;
|
||||||
|
_lv_obj_disable_style_caching(btnm, false);
|
||||||
disabled_inited = true;
|
disabled_inited = true;
|
||||||
}
|
}
|
||||||
draw_rect_dsc_act = &draw_rect_ina_dsc;
|
draw_rect_dsc_act = &draw_rect_ina_dsc;
|
||||||
@@ -912,7 +918,7 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
|
|||||||
/*Toggle the button if enabled*/
|
/*Toggle the button if enabled*/
|
||||||
if(button_is_tgl_enabled(ext->ctrl_bits[ext->btn_id_pr]) &&
|
if(button_is_tgl_enabled(ext->ctrl_bits[ext->btn_id_pr]) &&
|
||||||
!button_is_inactive(ext->ctrl_bits[ext->btn_id_pr])) {
|
!button_is_inactive(ext->ctrl_bits[ext->btn_id_pr])) {
|
||||||
if(button_get_tgl_state(ext->ctrl_bits[ext->btn_id_pr])) {
|
if(button_get_tgl_state(ext->ctrl_bits[ext->btn_id_pr]) && !ext->one_check) {
|
||||||
ext->ctrl_bits[ext->btn_id_pr] &= (~LV_BTNMATRIX_CTRL_CHECK_STATE);
|
ext->ctrl_bits[ext->btn_id_pr] &= (~LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -705,6 +705,7 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
|
|||||||
strcpy(&txt_buf[5], get_month_name(calendar, ext->showed_date.month));
|
strcpy(&txt_buf[5], get_month_name(calendar, ext->showed_date.month));
|
||||||
|
|
||||||
calendar->state = LV_STATE_DEFAULT;
|
calendar->state = LV_STATE_DEFAULT;
|
||||||
|
_lv_obj_disable_style_caching(calendar, true);
|
||||||
|
|
||||||
lv_draw_label_dsc_t label_dsc;
|
lv_draw_label_dsc_t label_dsc;
|
||||||
lv_draw_label_dsc_init(&label_dsc);
|
lv_draw_label_dsc_init(&label_dsc);
|
||||||
@@ -738,6 +739,7 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
|
|||||||
lv_draw_label(&header_area, mask, &label_dsc, LV_SYMBOL_RIGHT, NULL);
|
lv_draw_label(&header_area, mask, &label_dsc, LV_SYMBOL_RIGHT, NULL);
|
||||||
|
|
||||||
calendar->state = state_ori; /*Restore the state*/
|
calendar->state = state_ori; /*Restore the state*/
|
||||||
|
_lv_obj_disable_style_caching(calendar, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -810,6 +812,7 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area)
|
|||||||
/*The state changes without re-caching the styles, disable the use of cache*/
|
/*The state changes without re-caching the styles, disable the use of cache*/
|
||||||
lv_state_t state_ori = calendar->state;
|
lv_state_t state_ori = calendar->state;
|
||||||
calendar->state = LV_STATE_DEFAULT;
|
calendar->state = LV_STATE_DEFAULT;
|
||||||
|
_lv_obj_disable_style_caching(calendar, true);
|
||||||
|
|
||||||
lv_state_t month_state = LV_STATE_DISABLED;
|
lv_state_t month_state = LV_STATE_DISABLED;
|
||||||
|
|
||||||
@@ -856,6 +859,7 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area)
|
|||||||
|
|
||||||
if(box_area.y1 > clip_area->y2) {
|
if(box_area.y1 > clip_area->y2) {
|
||||||
calendar->state = state_ori;
|
calendar->state = state_ori;
|
||||||
|
_lv_obj_disable_style_caching(calendar, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -926,6 +930,7 @@ static void draw_dates(lv_obj_t * calendar, const lv_area_t * clip_area)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
calendar->state = state_ori;
|
calendar->state = state_ori;
|
||||||
|
_lv_obj_disable_style_caching(calendar, false);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
_lv_memcpy(&ext->secondary_y_axis, &ext_copy->secondary_y_axis, sizeof(lv_chart_axis_cfg_t));
|
_lv_memcpy(&ext->secondary_y_axis, &ext_copy->secondary_y_axis, sizeof(lv_chart_axis_cfg_t));
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(chart, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(chart, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("chart created");
|
LV_LOG_INFO("chart created");
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ lv_obj_t * lv_cont_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->layout = copy_ext->layout;
|
ext->layout = copy_ext->layout;
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(cont, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(cont, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("container created");
|
LV_LOG_INFO("container created");
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ lv_obj_t * lv_cpicker_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
|
|
||||||
lv_style_list_copy(&ext->knob.style_list, ©_ext->knob.style_list);
|
lv_style_list_copy(&ext->knob.style_list, ©_ext->knob.style_list);
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(cpicker, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(cpicker, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
refr_knob_pos(cpicker);
|
refr_knob_pos(cpicker);
|
||||||
|
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ void lv_dropdown_open(lv_obj_t * ddlist)
|
|||||||
lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_BG), &ext->style_page);
|
lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_BG), &ext->style_page);
|
||||||
lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_SCROLLBAR), &ext->style_scrlbar);
|
lv_style_list_copy(lv_obj_get_style_list(ext->page, LV_PAGE_PART_SCROLLBAR), &ext->style_scrlbar);
|
||||||
lv_obj_clean_style_list(ext->page, LV_PAGE_PART_SCROLLABLE);
|
lv_obj_clean_style_list(ext->page, LV_PAGE_PART_SCROLLABLE);
|
||||||
lv_obj_refresh_style(ext->page, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(ext->page, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
|
|
||||||
lv_obj_t * label = lv_label_create(ext->page, NULL);
|
lv_obj_t * label = lv_label_create(ext->page, NULL);
|
||||||
lv_label_set_text_static(label, ext->options);
|
lv_label_set_text_static(label, ext->options);
|
||||||
@@ -965,7 +965,7 @@ static lv_res_t lv_dropdown_signal(lv_obj_t * ddlist, lv_signal_t sign, void * p
|
|||||||
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_MAIN);
|
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_MAIN);
|
||||||
lv_obj_set_height(ddlist, top + bottom + lv_font_get_line_height(font));
|
lv_obj_set_height(ddlist, top + bottom + lv_font_get_line_height(font));
|
||||||
|
|
||||||
if(ext->page) lv_obj_refresh_style(ext->page, LV_STYLE_PROP_ALL);
|
if(ext->page) lv_obj_refresh_style(ext->page, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
else if(sign == LV_SIGNAL_CONTROL) {
|
else if(sign == LV_SIGNAL_CONTROL) {
|
||||||
#if LV_USE_GROUP
|
#if LV_USE_GROUP
|
||||||
@@ -1134,8 +1134,10 @@ static void draw_box(lv_obj_t * ddlist, const lv_area_t * clip_area, uint16_t id
|
|||||||
lv_obj_t * page = ext->page;
|
lv_obj_t * page = ext->page;
|
||||||
lv_state_t state_orig = page->state;
|
lv_state_t state_orig = page->state;
|
||||||
|
|
||||||
page->state = LV_STATE_DEFAULT;
|
if(state != page->state) {
|
||||||
page->state |= state;
|
_lv_obj_disable_style_caching(ddlist, true);
|
||||||
|
page->state = state;
|
||||||
|
}
|
||||||
|
|
||||||
/*Draw a rectangle under the selected item*/
|
/*Draw a rectangle under the selected item*/
|
||||||
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_LIST);
|
const lv_font_t * font = lv_obj_get_style_text_font(ddlist, LV_DROPDOWN_PART_LIST);
|
||||||
@@ -1159,6 +1161,7 @@ static void draw_box(lv_obj_t * ddlist, const lv_area_t * clip_area, uint16_t id
|
|||||||
lv_draw_rect(&rect_area, clip_area, &sel_rect);
|
lv_draw_rect(&rect_area, clip_area, &sel_rect);
|
||||||
|
|
||||||
page->state = state_orig;
|
page->state = state_orig;
|
||||||
|
_lv_obj_disable_style_caching(ddlist, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1169,8 +1172,10 @@ static void draw_box_label(lv_obj_t * ddlist, const lv_area_t * clip_area, uint1
|
|||||||
lv_obj_t * page = ext->page;
|
lv_obj_t * page = ext->page;
|
||||||
lv_state_t state_orig = page->state;
|
lv_state_t state_orig = page->state;
|
||||||
|
|
||||||
page->state = LV_STATE_DEFAULT;
|
if(state != page->state) {
|
||||||
page->state |= state;
|
page->state = state;
|
||||||
|
_lv_obj_disable_style_caching(ddlist, true);
|
||||||
|
}
|
||||||
|
|
||||||
lv_draw_label_dsc_t label_dsc;
|
lv_draw_label_dsc_t label_dsc;
|
||||||
lv_draw_label_dsc_init(&label_dsc);
|
lv_draw_label_dsc_init(&label_dsc);
|
||||||
@@ -1204,6 +1209,7 @@ static void draw_box_label(lv_obj_t * ddlist, const lv_area_t * clip_area, uint1
|
|||||||
lv_draw_label(&label->coords, &mask_sel, &label_dsc, lv_label_get_text(label), NULL);
|
lv_draw_label(&label->coords, &mask_sel, &label_dsc, lv_label_get_text(label), NULL);
|
||||||
}
|
}
|
||||||
page->state = state_orig;
|
page->state = state_orig;
|
||||||
|
_lv_obj_disable_style_caching(ddlist, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ lv_obj_t * lv_gauge_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->format_cb = copy_ext->format_cb;
|
ext->format_cb = copy_ext->format_cb;
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(gauge, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(gauge, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("gauge created");
|
LV_LOG_INFO("gauge created");
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ lv_obj_t * lv_img_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_img_set_src(img, copy_ext->src);
|
lv_img_set_src(img, copy_ext->src);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(img, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(img, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("image created");
|
LV_LOG_INFO("image created");
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ lv_obj_t * lv_imgbtn_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
#endif
|
#endif
|
||||||
ext->tiled = copy_ext->tiled;
|
ext->tiled = copy_ext->tiled;
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(imgbtn, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(imgbtn, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("image button created");
|
LV_LOG_INFO("image button created");
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->dot_end = copy_ext->dot_end;
|
ext->dot_end = copy_ext->dot_end;
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(new_label, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(new_label, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("label created");
|
LV_LOG_INFO("label created");
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ lv_obj_t * lv_led_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->bright = copy_ext->bright;
|
ext->bright = copy_ext->bright;
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(led, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(led, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("led created");
|
LV_LOG_INFO("led created");
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ lv_obj_t * lv_line_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_line_set_points(line, copy_ext->point_array, copy_ext->point_num);
|
lv_line_set_points(line, copy_ext->point_array, copy_ext->point_num);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(line, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(line, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("line created");
|
LV_LOG_INFO("line created");
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ lv_obj_t * lv_linemeter_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->cur_value = copy_ext->cur_value;
|
ext->cur_value = copy_ext->cur_value;
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(linemeter, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(linemeter, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("line meter created");
|
LV_LOG_INFO("line meter created");
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(list, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(list, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("list created");
|
LV_LOG_INFO("list created");
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ lv_obj_t * lv_msgbox_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
if(copy_ext->btnm) ext->btnm = lv_btnmatrix_create(mbox, copy_ext->btnm);
|
if(copy_ext->btnm) ext->btnm = lv_btnmatrix_create(mbox, copy_ext->btnm);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(mbox, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(mbox, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("message box created");
|
LV_LOG_INFO("message box created");
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ lv_obj_t * lv_objmask_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
/* lv_objmask_ext_t * copy_ext = lv_obj_get_ext_attr(copy); */
|
/* lv_objmask_ext_t * copy_ext = lv_obj_get_ext_attr(copy); */
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(objmask, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(objmask, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("object mask created");
|
LV_LOG_INFO("object mask created");
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);
|
lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);
|
||||||
|
|
||||||
lv_style_list_copy(&ext->style_sel, ©_ext->style_sel);
|
lv_style_list_copy(&ext->style_sel, ©_ext->style_sel);
|
||||||
lv_obj_refresh_style(roller, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(roller, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("roller created");
|
LV_LOG_INFO("roller created");
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_area_copy(&ext->left_knob_area, ©_ext->left_knob_area);
|
lv_area_copy(&ext->left_knob_area, ©_ext->left_knob_area);
|
||||||
lv_area_copy(&ext->right_knob_area, ©_ext->right_knob_area);
|
lv_area_copy(&ext->right_knob_area, ©_ext->right_knob_area);
|
||||||
|
|
||||||
lv_obj_refresh_style(slider, LV_OBJ_PART_ALL);
|
lv_obj_refresh_style(slider, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("slider created");
|
LV_LOG_INFO("slider created");
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_spinbox_set_rollover(spinbox, copy_ext->rollover);
|
lv_spinbox_set_rollover(spinbox, copy_ext->rollover);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(spinbox, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(spinbox, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_spinbox_updatevalue(spinbox);
|
lv_spinbox_updatevalue(spinbox);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->time = copy_ext->time;
|
ext->time = copy_ext->time;
|
||||||
ext->anim_dir = copy_ext->anim_dir;
|
ext->anim_dir = copy_ext->anim_dir;
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(spinner, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(spinner, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_spinner_set_type(spinner, ext->anim_type);
|
lv_spinner_set_type(spinner, ext->anim_type);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_switch_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
|
lv_switch_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
|
||||||
|
|
||||||
lv_style_list_copy(&ext->style_knob, ©_ext->style_knob);
|
lv_style_list_copy(&ext->style_knob, ©_ext->style_knob);
|
||||||
lv_obj_refresh_style(sw, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(sw, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ lv_obj_t * lv_table_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
lv_table_set_col_cnt(table, copy_ext->col_cnt);
|
lv_table_set_col_cnt(table, copy_ext->col_cnt);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(table, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(table, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("table created");
|
LV_LOG_INFO("table created");
|
||||||
|
|||||||
@@ -180,11 +180,11 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
LV_PAGE_PART_SCROLLABLE));
|
LV_PAGE_PART_SCROLLABLE));
|
||||||
lv_style_list_copy(lv_obj_get_style_list(new_tab, LV_PAGE_PART_SCROLLBAR), lv_obj_get_style_list(copy_tab,
|
lv_style_list_copy(lv_obj_get_style_list(new_tab, LV_PAGE_PART_SCROLLBAR), lv_obj_get_style_list(copy_tab,
|
||||||
LV_PAGE_PART_SCROLLBAR));
|
LV_PAGE_PART_SCROLLBAR));
|
||||||
lv_obj_refresh_style(new_tab, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(new_tab, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(tabview, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(tabview, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabview_realign(tabview);
|
tabview_realign(tabview);
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
if(copy_ext->one_line) lv_textarea_set_one_line(ta, true);
|
if(copy_ext->one_line) lv_textarea_set_one_line(ta, true);
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(ta, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(ta, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_USE_ANIMATION
|
#if LV_USE_ANIMATION
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(new_tileview, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(new_tileview, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("tileview created");
|
LV_LOG_INFO("tileview created");
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Refresh the style with new signal function*/
|
/*Refresh the style with new signal function*/
|
||||||
lv_obj_refresh_style(new_win, LV_STYLE_PROP_ALL);
|
lv_obj_refresh_style(new_win, LV_OBJ_PART_ALL, LV_STYLE_PROP_ALL);
|
||||||
|
|
||||||
lv_win_realign(new_win);
|
lv_win_realign(new_win);
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ CSRCS += lv_test_assert.c
|
|||||||
CSRCS += lv_test_core/lv_test_core.c
|
CSRCS += lv_test_core/lv_test_core.c
|
||||||
CSRCS += lv_test_core/lv_test_obj.c
|
CSRCS += lv_test_core/lv_test_obj.c
|
||||||
CSRCS += lv_test_core/lv_test_style.c
|
CSRCS += lv_test_core/lv_test_style.c
|
||||||
|
CSRCS += lv_test_core/lv_test_font_loader.c
|
||||||
|
CSRCS += lv_test_fonts/font_1.c
|
||||||
|
CSRCS += lv_test_fonts/font_2.c
|
||||||
|
CSRCS += lv_test_fonts/font_3.c
|
||||||
|
|
||||||
OBJEXT ?= .o
|
OBJEXT ?= .o
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ minimal_monochrome = {
|
|||||||
"LV_USE_PAGE":0,
|
"LV_USE_PAGE":0,
|
||||||
"LV_USE_SPINNER":0,
|
"LV_USE_SPINNER":0,
|
||||||
"LV_USE_ROLLER":0,
|
"LV_USE_ROLLER":0,
|
||||||
|
"LV_USE_ROTARY":0,
|
||||||
"LV_USE_SLIDER":0,
|
"LV_USE_SLIDER":0,
|
||||||
"LV_USE_SPINBOX":0,
|
"LV_USE_SPINBOX":0,
|
||||||
"LV_USE_SWITCH":0,
|
"LV_USE_SWITCH":0,
|
||||||
@@ -196,6 +197,7 @@ all_obj_minimal_features = {
|
|||||||
"LV_USE_PAGE":1,
|
"LV_USE_PAGE":1,
|
||||||
"LV_USE_SPINNER":0, #Disabled beacsue needs anim
|
"LV_USE_SPINNER":0, #Disabled beacsue needs anim
|
||||||
"LV_USE_ROLLER":1,
|
"LV_USE_ROLLER":1,
|
||||||
|
"LV_USE_ROTARY":1,
|
||||||
"LV_USE_SLIDER":1,
|
"LV_USE_SLIDER":1,
|
||||||
"LV_USE_SPINBOX":1,
|
"LV_USE_SPINBOX":1,
|
||||||
"LV_USE_SWITCH":1,
|
"LV_USE_SWITCH":1,
|
||||||
@@ -274,6 +276,7 @@ all_obj_all_features = {
|
|||||||
"LV_USE_PAGE":1,
|
"LV_USE_PAGE":1,
|
||||||
"LV_USE_SPINNER":1,
|
"LV_USE_SPINNER":1,
|
||||||
"LV_USE_ROLLER":1,
|
"LV_USE_ROLLER":1,
|
||||||
|
"LV_USE_ROTARY":1,
|
||||||
"LV_USE_SLIDER":1,
|
"LV_USE_SLIDER":1,
|
||||||
"LV_USE_SPINBOX":1,
|
"LV_USE_SPINBOX":1,
|
||||||
"LV_USE_SWITCH":1,
|
"LV_USE_SWITCH":1,
|
||||||
@@ -365,6 +368,7 @@ advanced_features = {
|
|||||||
"LV_USE_PAGE":1,
|
"LV_USE_PAGE":1,
|
||||||
"LV_USE_SPINNER":1,
|
"LV_USE_SPINNER":1,
|
||||||
"LV_USE_ROLLER":1,
|
"LV_USE_ROLLER":1,
|
||||||
|
"LV_USE_ROTARY":1,
|
||||||
"LV_USE_SLIDER":1,
|
"LV_USE_SLIDER":1,
|
||||||
"LV_USE_SPINBOX":1,
|
"LV_USE_SPINBOX":1,
|
||||||
"LV_USE_SWITCH":1,
|
"LV_USE_SWITCH":1,
|
||||||
|
|||||||
BIN
tests/font_1.fnt
Normal file
BIN
tests/font_1.fnt
Normal file
Binary file not shown.
BIN
tests/font_2.fnt
Normal file
BIN
tests/font_2.fnt
Normal file
Binary file not shown.
BIN
tests/font_3.fnt
Normal file
BIN
tests/font_3.fnt
Normal file
Binary file not shown.
@@ -97,6 +97,15 @@ void lv_test_error(const char * s, ...)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lv_test_assert_true(int32_t expression, const char * s)
|
||||||
|
{
|
||||||
|
if(!expression) {
|
||||||
|
lv_test_error(" FAIL: %s. (Expected: not zero)", s, expression);
|
||||||
|
} else {
|
||||||
|
lv_test_print(" PASS: %s. (Expected: not zero)", s, expression);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void lv_test_assert_int_eq(int32_t n_ref, int32_t n_act, const char * s)
|
void lv_test_assert_int_eq(int32_t n_ref, int32_t n_act, const char * s)
|
||||||
{
|
{
|
||||||
if(n_ref != n_act) {
|
if(n_ref != n_act) {
|
||||||
@@ -134,6 +143,17 @@ void lv_test_assert_str_eq(const char * s_ref, const char * s_act, const char *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void lv_test_assert_array_eq(const uint8_t *p_ref, const uint8_t *p_act, int32_t size, const char * s)
|
||||||
|
{
|
||||||
|
if(memcmp(p_ref, p_act, size) != 0) {
|
||||||
|
lv_test_error(" FAIL: %s. (Expected: all %d bytes should be equal)", s, size);
|
||||||
|
} else {
|
||||||
|
lv_test_print(" PASS: %s. (Expected: all %d bytes should be equal)", s, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void lv_test_assert_ptr_eq(const void * p_ref, const void * p_act, const char * s)
|
void lv_test_assert_ptr_eq(const void * p_ref, const void * p_act, const char * s)
|
||||||
{
|
{
|
||||||
if(p_ref != p_act) {
|
if(p_ref != p_act) {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ extern "C" {
|
|||||||
void lv_test_print(const char * s, ...);
|
void lv_test_print(const char * s, ...);
|
||||||
void lv_test_exit(const char * s, ...);
|
void lv_test_exit(const char * s, ...);
|
||||||
void lv_test_error(const char * s, ...);
|
void lv_test_error(const char * s, ...);
|
||||||
|
void lv_test_assert_true(int32_t expression, const char * s);
|
||||||
void lv_test_assert_int_eq(int32_t n1, int32_t n2, const char * s);
|
void lv_test_assert_int_eq(int32_t n1, int32_t n2, const char * s);
|
||||||
void lv_test_assert_int_gt(int32_t n_ref, int32_t n_act, const char * s);
|
void lv_test_assert_int_gt(int32_t n_ref, int32_t n_act, const char * s);
|
||||||
void lv_test_assert_int_lt(int32_t n_ref, int32_t n_act, const char * s);
|
void lv_test_assert_int_lt(int32_t n_ref, int32_t n_act, const char * s);
|
||||||
@@ -39,6 +40,7 @@ void lv_test_assert_str_eq(const char * str1, const char * str2, const char * s)
|
|||||||
void lv_test_assert_ptr_eq(const void * p_ref, const void * p_act, const char * s);
|
void lv_test_assert_ptr_eq(const void * p_ref, const void * p_act, const char * s);
|
||||||
void lv_test_assert_color_eq(lv_color_t c_ref, lv_color_t c_act, const char * s);
|
void lv_test_assert_color_eq(lv_color_t c_ref, lv_color_t c_act, const char * s);
|
||||||
void lv_test_assert_img_eq(const char * ref_img_fn, const char * s);
|
void lv_test_assert_img_eq(const char * ref_img_fn, const char * s);
|
||||||
|
void lv_test_assert_array_eq(const uint8_t *p_ref, const uint8_t *p_act, int32_t size, const char * s);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "lv_test_core.h"
|
#include "lv_test_core.h"
|
||||||
#include "lv_test_obj.h"
|
#include "lv_test_obj.h"
|
||||||
#include "lv_test_style.h"
|
#include "lv_test_style.h"
|
||||||
|
#include "lv_test_font_loader.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -46,6 +47,7 @@ void lv_test_core(void)
|
|||||||
|
|
||||||
lv_test_obj();
|
lv_test_obj();
|
||||||
lv_test_style();
|
lv_test_style();
|
||||||
|
lv_test_font_loader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
213
tests/lv_test_core/lv_test_font_loader.c
Normal file
213
tests/lv_test_core/lv_test_font_loader.c
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
/**
|
||||||
|
* @file lv_test_font_loader.c
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* INCLUDES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
#include "../lv_test_assert.h"
|
||||||
|
#if LV_BUILD_TEST
|
||||||
|
#include "../lvgl.h"
|
||||||
|
#include "../src/lv_font/lv_font_fmt_txt.h"
|
||||||
|
#include "../src/lv_font/lv_font.h"
|
||||||
|
#include "../src/lv_font/lv_font_loader.h"
|
||||||
|
|
||||||
|
#include "lv_test_font_loader.h"
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* DEFINES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* TYPEDEFS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* STATIC PROTOTYPES
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
static int compare_fonts(lv_font_t * f1, lv_font_t * f2);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* STATIC VARIABLES
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* MACROS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
extern lv_font_t font_1;
|
||||||
|
extern lv_font_t font_2;
|
||||||
|
extern lv_font_t font_3;
|
||||||
|
|
||||||
|
void lv_test_font_loader(void)
|
||||||
|
{
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
lv_font_t * font_1_bin = lv_font_load("f:font_1.fnt");
|
||||||
|
lv_font_t * font_2_bin = lv_font_load("f:font_2.fnt");
|
||||||
|
lv_font_t * font_3_bin = lv_font_load("f:font_3.fnt");
|
||||||
|
|
||||||
|
compare_fonts(&font_1, font_1_bin);
|
||||||
|
compare_fonts(&font_2, font_2_bin);
|
||||||
|
compare_fonts(&font_3, font_3_bin);
|
||||||
|
|
||||||
|
lv_font_free(font_1_bin);
|
||||||
|
lv_font_free(font_2_bin);
|
||||||
|
lv_font_free(font_3_bin);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
static int compare_fonts(lv_font_t * f1, lv_font_t * f2)
|
||||||
|
{
|
||||||
|
lv_test_assert_true(f1 != NULL && f2 != NULL, "font not null");
|
||||||
|
|
||||||
|
lv_test_assert_ptr_eq(f1->get_glyph_dsc, f2->get_glyph_dsc, "glyph_dsc");
|
||||||
|
lv_test_assert_ptr_eq(f1->get_glyph_bitmap, f2->get_glyph_bitmap, "glyph_bitmap");
|
||||||
|
lv_test_assert_int_eq(f1->line_height, f2->line_height, "line_height");
|
||||||
|
lv_test_assert_int_eq(f1->base_line, f2->base_line, "base_line");
|
||||||
|
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||||
|
lv_test_assert_int_eq(f1->subpx, f2->subpx, "subpx");
|
||||||
|
#endif
|
||||||
|
lv_font_fmt_txt_dsc_t * dsc1 = (lv_font_fmt_txt_dsc_t *) f1->dsc;
|
||||||
|
lv_font_fmt_txt_dsc_t * dsc2 = (lv_font_fmt_txt_dsc_t *) f2->dsc;
|
||||||
|
|
||||||
|
lv_test_assert_int_eq(dsc1->kern_scale, dsc2->kern_scale, "kern_scale");
|
||||||
|
lv_test_assert_int_eq(dsc1->cmap_num, dsc2->cmap_num, "cmap_num");
|
||||||
|
lv_test_assert_int_eq(dsc1->bpp, dsc2->bpp, "bpp");
|
||||||
|
lv_test_assert_int_eq(dsc1->kern_classes, dsc2->kern_classes, "kern_classes");
|
||||||
|
lv_test_assert_int_eq(dsc1->bitmap_format, dsc2->bitmap_format, "bitmap_format");
|
||||||
|
|
||||||
|
// cmaps
|
||||||
|
int total_glyphs = 0;
|
||||||
|
for(int i = 0; i < dsc1->cmap_num; ++i) {
|
||||||
|
lv_font_fmt_txt_cmap_t * cmaps1 = (lv_font_fmt_txt_cmap_t *) &dsc1->cmaps[i];
|
||||||
|
lv_font_fmt_txt_cmap_t * cmaps2 = (lv_font_fmt_txt_cmap_t *) &dsc2->cmaps[i];
|
||||||
|
|
||||||
|
lv_test_assert_int_eq(cmaps1->range_start, cmaps2->range_start, "range_start");
|
||||||
|
lv_test_assert_int_eq(cmaps1->range_length, cmaps2->range_length, "range_length");
|
||||||
|
lv_test_assert_int_eq(cmaps1->glyph_id_start, cmaps2->glyph_id_start, "glyph_id_start");
|
||||||
|
lv_test_assert_int_eq(cmaps1->type, cmaps2->type, "type");
|
||||||
|
lv_test_assert_int_eq(cmaps1->list_length, cmaps2->list_length, "list_length");
|
||||||
|
|
||||||
|
if(cmaps1->unicode_list != NULL && cmaps2->unicode_list != NULL) {
|
||||||
|
lv_test_assert_true(cmaps1->unicode_list && cmaps2->unicode_list, "unicode_list");
|
||||||
|
|
||||||
|
lv_test_assert_array_eq(
|
||||||
|
(uint8_t *) cmaps1->unicode_list,
|
||||||
|
(uint8_t *) cmaps2->unicode_list,
|
||||||
|
sizeof(uint16_t) * cmaps1->list_length,
|
||||||
|
"unicode_list");
|
||||||
|
total_glyphs += cmaps1->list_length;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
total_glyphs += cmaps1->range_length;
|
||||||
|
lv_test_assert_ptr_eq(cmaps1->unicode_list, cmaps2->unicode_list, "unicode_list");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cmaps1->glyph_id_ofs_list != NULL && cmaps2->glyph_id_ofs_list != NULL) {
|
||||||
|
uint8_t * ids1 = (uint8_t *) cmaps1->glyph_id_ofs_list;
|
||||||
|
uint8_t * ids2 = (uint8_t *) cmaps2->glyph_id_ofs_list;
|
||||||
|
|
||||||
|
lv_test_assert_array_eq(ids1, ids2, cmaps1->list_length, "glyph_id_ofs_list");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lv_test_assert_ptr_eq(cmaps1->glyph_id_ofs_list, cmaps2->glyph_id_ofs_list, "glyph_id_ofs_list");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// kern_dsc
|
||||||
|
if (dsc1->kern_classes == 1 && dsc2->kern_classes == 1) {
|
||||||
|
lv_font_fmt_txt_kern_classes_t * kern1 = (lv_font_fmt_txt_kern_classes_t *) dsc1->kern_dsc;
|
||||||
|
lv_font_fmt_txt_kern_classes_t * kern2 = (lv_font_fmt_txt_kern_classes_t *) dsc2->kern_dsc;
|
||||||
|
if (kern1 != NULL && kern2 != NULL) {
|
||||||
|
lv_test_assert_int_eq(kern1->right_class_cnt, kern2->right_class_cnt, "right_class_cnt");
|
||||||
|
lv_test_assert_int_eq(kern1->left_class_cnt, kern2->left_class_cnt, "left_class_cnt");
|
||||||
|
|
||||||
|
lv_test_assert_array_eq(
|
||||||
|
(uint8_t *) kern1->left_class_mapping,
|
||||||
|
(uint8_t *) kern2->left_class_mapping,
|
||||||
|
kern1->left_class_cnt,
|
||||||
|
"left_class_mapping");
|
||||||
|
|
||||||
|
lv_test_assert_array_eq(
|
||||||
|
(uint8_t *) kern1->right_class_mapping,
|
||||||
|
(uint8_t *) kern2->right_class_mapping,
|
||||||
|
kern1->right_class_cnt,
|
||||||
|
"right_class_mapping");
|
||||||
|
|
||||||
|
lv_test_assert_array_eq(
|
||||||
|
(uint8_t *) kern1->class_pair_values,
|
||||||
|
(uint8_t *) kern2->class_pair_values,
|
||||||
|
kern1->right_class_cnt * kern1->left_class_cnt,
|
||||||
|
"class_pair_values");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lv_test_assert_ptr_eq(kern1, kern2, "kern");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (dsc1->kern_classes == 0 && dsc2->kern_classes == 0) {
|
||||||
|
lv_font_fmt_txt_kern_pair_t * kern1 = (lv_font_fmt_txt_kern_pair_t *) dsc1->kern_dsc;
|
||||||
|
lv_font_fmt_txt_kern_pair_t * kern2 = (lv_font_fmt_txt_kern_pair_t *) dsc2->kern_dsc;
|
||||||
|
if (kern1 != NULL && kern2 != NULL) {
|
||||||
|
lv_test_assert_int_eq(kern1->glyph_ids_size, kern2->glyph_ids_size, "glyph_ids_size");
|
||||||
|
lv_test_assert_int_eq(kern1->pair_cnt, kern2->pair_cnt, "pair_cnt");
|
||||||
|
|
||||||
|
int ids_size;
|
||||||
|
|
||||||
|
if (kern1->glyph_ids_size == 0) {
|
||||||
|
ids_size = sizeof(int8_t) * 2 * kern1->pair_cnt;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ids_size = sizeof(int16_t) * 2 * kern1->pair_cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_test_assert_array_eq(kern1->glyph_ids, kern2->glyph_ids, ids_size, "glyph_ids");
|
||||||
|
lv_test_assert_array_eq(
|
||||||
|
(uint8_t * ) kern1->values,
|
||||||
|
(uint8_t * ) kern2->values,
|
||||||
|
kern1->pair_cnt,
|
||||||
|
"glyph_values");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_font_fmt_txt_glyph_dsc_t * glyph_dsc1 = (lv_font_fmt_txt_glyph_dsc_t *) dsc1->glyph_dsc;
|
||||||
|
lv_font_fmt_txt_glyph_dsc_t * glyph_dsc2 = (lv_font_fmt_txt_glyph_dsc_t *) dsc2->glyph_dsc;
|
||||||
|
|
||||||
|
for(int i = 0; i < total_glyphs; ++i) {
|
||||||
|
if (i < total_glyphs - 1) {
|
||||||
|
int size1 = glyph_dsc1[i+1].bitmap_index - glyph_dsc1[i].bitmap_index;
|
||||||
|
|
||||||
|
if (size1 > 0) {
|
||||||
|
lv_test_assert_array_eq(
|
||||||
|
dsc1->glyph_bitmap + glyph_dsc1[i].bitmap_index,
|
||||||
|
dsc2->glyph_bitmap + glyph_dsc2[i].bitmap_index,
|
||||||
|
size1 - 1, "glyph_bitmap");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lv_test_assert_int_eq(glyph_dsc1[i].adv_w, glyph_dsc2[i].adv_w, "adv_w");
|
||||||
|
lv_test_assert_int_eq(glyph_dsc1[i].box_w, glyph_dsc2[i].box_w, "box_w");
|
||||||
|
lv_test_assert_int_eq(glyph_dsc1[i].box_h, glyph_dsc2[i].box_h, "box_h");
|
||||||
|
lv_test_assert_int_eq(glyph_dsc1[i].ofs_x, glyph_dsc2[i].ofs_x, "ofs_x");
|
||||||
|
lv_test_assert_int_eq(glyph_dsc1[i].ofs_y, glyph_dsc2[i].ofs_y, "ofs_y");
|
||||||
|
}
|
||||||
|
|
||||||
|
LV_LOG_INFO("No differences found!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* STATIC FUNCTIONS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
#endif // LV_BUILD_TEST
|
||||||
|
|
||||||
39
tests/lv_test_core/lv_test_font_loader.h
Normal file
39
tests/lv_test_core/lv_test_font_loader.h
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* @file lv_font_loader.h
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LV_TEST_FONT_LOADER_H
|
||||||
|
#define LV_TEST_FONT_LOADER_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* INCLUDES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
/*********************
|
||||||
|
* DEFINES
|
||||||
|
*********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* TYPEDEFS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* GLOBAL PROTOTYPES
|
||||||
|
**********************/
|
||||||
|
void lv_test_font_loader(void);
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* MACROS
|
||||||
|
**********************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*LV_TEST_FONT_LOADER_H*/
|
||||||
|
|
||||||
1383
tests/lv_test_fonts/font_1.c
Normal file
1383
tests/lv_test_fonts/font_1.c
Normal file
File diff suppressed because it is too large
Load Diff
1413
tests/lv_test_fonts/font_2.c
Normal file
1413
tests/lv_test_fonts/font_2.c
Normal file
File diff suppressed because it is too large
Load Diff
953
tests/lv_test_fonts/font_3.c
Normal file
953
tests/lv_test_fonts/font_3.c
Normal file
@@ -0,0 +1,953 @@
|
|||||||
|
#include "lvgl/lvgl.h"
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Size: 20 px
|
||||||
|
* Bpp: 4
|
||||||
|
* Opts: --bpp 4 --size 20 --font ../RobotoMono-Regular.ttf -r 0x20-0x7f --format lvgl -o ..\generated_fonts/font_3.c
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#ifndef FONT_3
|
||||||
|
#define FONT_3 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if FONT_3
|
||||||
|
|
||||||
|
/*-----------------
|
||||||
|
* BITMAPS
|
||||||
|
*----------------*/
|
||||||
|
|
||||||
|
/*Store the image of the glyphs*/
|
||||||
|
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
|
||||||
|
/* U+20 " " */
|
||||||
|
|
||||||
|
/* U+21 "!" */
|
||||||
|
0x1f, 0xb0, 0xf, 0xfe, 0x69, 0x10, 0x76, 0x40,
|
||||||
|
0x30, 0x81, 0x76, 0x98, 0xb0,
|
||||||
|
|
||||||
|
/* U+22 "\"" */
|
||||||
|
0x8e, 0x0, 0x7b, 0x0, 0x7c, 0x60, 0x11, 0x80,
|
||||||
|
0x80, 0x43, 0xca, 0x0, 0x37,
|
||||||
|
|
||||||
|
/* U+23 "#" */
|
||||||
|
0x0, 0xc5, 0xe6, 0x7, 0xe6, 0x1, 0xc8, 0x6,
|
||||||
|
0xa, 0x6, 0x1, 0xde, 0x40, 0xf, 0x30, 0xf,
|
||||||
|
0x2a, 0x0, 0x15, 0x40, 0x15, 0x7f, 0x8d, 0xbf,
|
||||||
|
0xc6, 0xde, 0xe1, 0xd2, 0xe0, 0xf2, 0xe0, 0xf2,
|
||||||
|
0x80, 0x8d, 0x81, 0x2d, 0xa1, 0x2c, 0x60, 0x11,
|
||||||
|
0x88, 0x80, 0x84, 0x40, 0x1d, 0xc4, 0x0, 0xd2,
|
||||||
|
0x0, 0xc2, 0x25, 0x61, 0x13, 0x30, 0x40, 0xd,
|
||||||
|
0xdc, 0x35, 0xee, 0x1a, 0xf6, 0x3, 0xdd, 0x4,
|
||||||
|
0x5c, 0x84, 0xdf, 0x80, 0xa0, 0x1, 0x90, 0xc1,
|
||||||
|
0x90, 0xc0, 0x2d, 0x21, 0xd, 0x20, 0xf, 0x1b,
|
||||||
|
0x80, 0x11, 0x0, 0x18,
|
||||||
|
|
||||||
|
/* U+24 "$" */
|
||||||
|
0x0, 0xcb, 0xe2, 0x1, 0xff, 0xc4, 0x78, 0xb,
|
||||||
|
0x40, 0xd, 0xb0, 0x64, 0xb6, 0xe0, 0x8, 0x27,
|
||||||
|
0xed, 0xd0, 0xc0, 0x82, 0x4, 0x0, 0xa, 0x41,
|
||||||
|
0xc0, 0x40, 0x38, 0xc8, 0x0, 0xe0, 0xe0, 0x12,
|
||||||
|
0x6b, 0x5, 0x84, 0x5a, 0x0, 0x70, 0xe9, 0xa5,
|
||||||
|
0xea, 0x80, 0x62, 0xcc, 0x29, 0x54, 0x80, 0x71,
|
||||||
|
0xd6, 0x93, 0x21, 0x29, 0x0, 0x45, 0x21, 0xaf,
|
||||||
|
0x4a, 0x1, 0x9c, 0xd, 0x2, 0x44, 0x2, 0xa0,
|
||||||
|
0xd1, 0x71, 0xf8, 0x86, 0x31, 0x38, 0x44, 0x9b,
|
||||||
|
0xb8, 0x97, 0x0, 0x26, 0xd6, 0x1e, 0xa1, 0x0,
|
||||||
|
0xe1, 0x0, 0xe0,
|
||||||
|
|
||||||
|
/* U+25 "%" */
|
||||||
|
0x7, 0xee, 0x40, 0x7, 0xc9, 0x10, 0xb7, 0x50,
|
||||||
|
0xf, 0x61, 0x32, 0xa7, 0x80, 0xf1, 0x80, 0x42,
|
||||||
|
0x1, 0xd2, 0x66, 0x0, 0x69, 0x98, 0x97, 0x45,
|
||||||
|
0xe0, 0x2, 0x55, 0x66, 0xab, 0xc1, 0x28, 0x6,
|
||||||
|
0xae, 0xe5, 0x8b, 0x48, 0x7, 0x84, 0x41, 0x6,
|
||||||
|
0x80, 0x1f, 0x89, 0xa0, 0x3, 0xfa, 0x11, 0x13,
|
||||||
|
0xdc, 0x70, 0xc, 0x6b, 0xc, 0xca, 0x88, 0x20,
|
||||||
|
0x5, 0x8, 0x78, 0xa8, 0xc5, 0x80, 0x13, 0x40,
|
||||||
|
0x7, 0xfb, 0x4c, 0x31, 0x51, 0x8b, 0x0, 0x3c,
|
||||||
|
0xcc, 0xa8, 0x82, 0x0,
|
||||||
|
|
||||||
|
/* U+26 "&" */
|
||||||
|
0x0, 0x26, 0x7e, 0xb0, 0x7, 0x15, 0x9b, 0xc,
|
||||||
|
0xa8, 0x6, 0xa0, 0xa9, 0xc1, 0xe0, 0xc, 0x40,
|
||||||
|
0xe0, 0x13, 0x80, 0x63, 0x7, 0x6, 0x1b, 0x0,
|
||||||
|
0xd4, 0x12, 0xf2, 0xae, 0x1, 0x8d, 0x8e, 0x1a,
|
||||||
|
0x80, 0x38, 0x90, 0x1, 0x40, 0x1c, 0x38, 0x50,
|
||||||
|
0x1a, 0x20, 0xbc, 0x70, 0x32, 0xf2, 0x34, 0x1a,
|
||||||
|
0x22, 0x40, 0x60, 0x65, 0x47, 0x51, 0x23, 0x10,
|
||||||
|
0xa, 0x8a, 0xa, 0x41, 0x5, 0x0, 0x2a, 0x0,
|
||||||
|
0x30, 0x40, 0x5d, 0x45, 0xc0, 0x84, 0x1, 0x6a,
|
||||||
|
0xa3, 0xb4, 0x71, 0xb2, 0x0,
|
||||||
|
|
||||||
|
/* U+27 "'" */
|
||||||
|
0x2f, 0x50, 0xe, 0x10, 0x3, 0x81, 0x88,
|
||||||
|
|
||||||
|
/* U+28 "(" */
|
||||||
|
0x0, 0xe1, 0x0, 0xd9, 0x20, 0x15, 0x8c, 0x80,
|
||||||
|
0x1d, 0x38, 0x40, 0x10, 0xa6, 0x0, 0x70, 0x90,
|
||||||
|
0xa, 0xc4, 0xc0, 0x2, 0x68, 0x1, 0x28, 0x68,
|
||||||
|
0x4, 0x40, 0x20, 0x10, 0x81, 0x80, 0x70, 0x80,
|
||||||
|
0x42, 0x2, 0x1, 0x18, 0x18, 0x4, 0xe1, 0xe0,
|
||||||
|
0x11, 0xa, 0x80, 0x67, 0x31, 0x0, 0xac, 0x24,
|
||||||
|
0x2, 0x25, 0x60, 0xd, 0x61, 0x40, 0x10, 0xea,
|
||||||
|
0xb8, 0x4, 0x7a, 0x80,
|
||||||
|
|
||||||
|
/* U+29 ")" */
|
||||||
|
0x20, 0xe, 0xe9, 0x0, 0xde, 0xd0, 0x1, 0x1c,
|
||||||
|
0x39, 0x80, 0x4e, 0x5e, 0x1, 0xa8, 0xcc, 0x1,
|
||||||
|
0x28, 0x50, 0x4, 0x42, 0x80, 0x19, 0x48, 0x40,
|
||||||
|
0x21, 0x2, 0x0, 0x8c, 0x1c, 0x2, 0x10, 0xe,
|
||||||
|
0x10, 0x70, 0x8, 0xc0, 0x80, 0x27, 0x11, 0x0,
|
||||||
|
0x44, 0x80, 0x12, 0x87, 0x80, 0x5c, 0x2a, 0x0,
|
||||||
|
0x34, 0x80, 0xb, 0x8d, 0x80, 0x14, 0x1a, 0x1,
|
||||||
|
0x7e, 0x8, 0x4,
|
||||||
|
|
||||||
|
/* U+2A "*" */
|
||||||
|
0x0, 0xd3, 0xe2, 0x1, 0xf0, 0x80, 0x80, 0x61,
|
||||||
|
0x0, 0x78, 0x6, 0x12, 0xeb, 0x41, 0x10, 0x36,
|
||||||
|
0xc0, 0xaa, 0xae, 0x47, 0xe4, 0xc0, 0xeb, 0xb0,
|
||||||
|
0x0, 0xdb, 0xd2, 0x1, 0x50, 0xab, 0x98, 0x6,
|
||||||
|
0x66, 0x45, 0x8d, 0x0, 0x43, 0x24, 0xc3, 0x8,
|
||||||
|
0xe0, 0x1, 0xbe, 0x0, 0x3b, 0xc0,
|
||||||
|
|
||||||
|
/* U+2B "+" */
|
||||||
|
0x0, 0xd1, 0x0, 0xf, 0xca, 0xc0, 0x1f, 0xfd,
|
||||||
|
0x6d, 0xff, 0x88, 0x7f, 0xee, 0x62, 0x28, 0x0,
|
||||||
|
0x45, 0xaf, 0x76, 0x21, 0xdd, 0xb0, 0x3, 0xff,
|
||||||
|
0xa4,
|
||||||
|
|
||||||
|
/* U+2C "," */
|
||||||
|
0xa, 0xf4, 0x1, 0x0, 0x9c, 0x18, 0x8, 0x49,
|
||||||
|
0x46, 0x1, 0x69, 0x80,
|
||||||
|
|
||||||
|
/* U+2D "-" */
|
||||||
|
0x78, 0x8f, 0x25, 0x3b, 0xfb, 0x40,
|
||||||
|
|
||||||
|
/* U+2E "." */
|
||||||
|
0x8, 0xc3, 0x17, 0x39, 0x14, 0xf,
|
||||||
|
|
||||||
|
/* U+2F "/" */
|
||||||
|
0x0, 0xf6, 0x68, 0x7, 0x88, 0xe8, 0x3, 0xd4,
|
||||||
|
0xc, 0x1, 0xe6, 0x41, 0x0, 0xe4, 0x1e, 0x0,
|
||||||
|
0xf7, 0x2, 0x80, 0x79, 0x58, 0x3, 0xcc, 0x14,
|
||||||
|
0x1, 0xed, 0x23, 0x0, 0xe1, 0x4a, 0x0, 0xf3,
|
||||||
|
0x2, 0x80, 0x7a, 0x90, 0x80, 0x38, 0xcb, 0x40,
|
||||||
|
0x3d, 0x40, 0xc0, 0x1e, 0x65, 0x0, 0xf2, 0x87,
|
||||||
|
0x0, 0x78,
|
||||||
|
|
||||||
|
/* U+30 "0" */
|
||||||
|
0x0, 0x25, 0xff, 0xb1, 0x0, 0x25, 0xb5, 0x66,
|
||||||
|
0x15, 0xa8, 0x2, 0xc7, 0xe6, 0x5e, 0x34, 0x8,
|
||||||
|
0x32, 0x20, 0x1, 0x90, 0x53, 0x2, 0x0, 0xc2,
|
||||||
|
0x1b, 0xe0, 0xc0, 0x14, 0x48, 0x8, 0x80, 0x21,
|
||||||
|
0xb7, 0x50, 0xe, 0x3c, 0x4b, 0x80, 0xd, 0x58,
|
||||||
|
0x1a, 0x80, 0x10, 0x83, 0x2e, 0x90, 0x8, 0x3,
|
||||||
|
0xc1, 0xe8, 0x3, 0x84, 0xc3, 0xc0, 0x32, 0x86,
|
||||||
|
0xa0, 0xc8, 0x80, 0x56, 0xa, 0x16, 0x3f, 0x32,
|
||||||
|
0xe2, 0x90, 0x2, 0xda, 0xb3, 0xa, 0xd8, 0x0,
|
||||||
|
|
||||||
|
/* U+31 "1" */
|
||||||
|
0x0, 0xc4, 0x80, 0x6, 0xcd, 0xc9, 0xf9, 0x30,
|
||||||
|
0x3, 0x25, 0xd8, 0x1, 0xd6, 0x8e, 0x0, 0x10,
|
||||||
|
0xf, 0xff, 0x78,
|
||||||
|
|
||||||
|
/* U+32 "2" */
|
||||||
|
0x0, 0xc, 0xf7, 0xf4, 0x0, 0x62, 0xf6, 0x56,
|
||||||
|
0x27, 0xd0, 0xa, 0x46, 0xed, 0x38, 0xa4, 0xe0,
|
||||||
|
0x4, 0x34, 0x0, 0xa0, 0x30, 0x5, 0xe4, 0x3,
|
||||||
|
0x18, 0x4, 0x30, 0xa0, 0x19, 0x3, 0x0, 0x3f,
|
||||||
|
0x40, 0x30, 0x7, 0xd2, 0x52, 0x20, 0x1e, 0x76,
|
||||||
|
0x56, 0x0, 0xf2, 0x41, 0xd0, 0x7, 0x8e, 0xcb,
|
||||||
|
0x40, 0x3c, 0x3a, 0x3e, 0x20, 0x1e, 0xc1, 0xd2,
|
||||||
|
0x0, 0xf5, 0x91, 0xa3, 0xbf, 0x18, 0x28, 0x1c,
|
||||||
|
0x47, 0x94,
|
||||||
|
|
||||||
|
/* U+33 "3" */
|
||||||
|
0x0, 0xc, 0xf7, 0xf4, 0x0, 0x43, 0xec, 0xae,
|
||||||
|
0xaf, 0xa0, 0xb, 0x1a, 0xb8, 0xb7, 0x26, 0x4,
|
||||||
|
0x15, 0x0, 0xa8, 0x30, 0x3b, 0x80, 0x1f, 0xfc,
|
||||||
|
0x2b, 0xf, 0x0, 0x85, 0xe7, 0x59, 0xd4, 0x2,
|
||||||
|
0x38, 0x62, 0x1c, 0x0, 0xc5, 0xfe, 0xb3, 0xb4,
|
||||||
|
0x0, 0xf2, 0x78, 0x78, 0x8, 0x80, 0x31, 0xa,
|
||||||
|
0x87, 0x60, 0x7, 0x9, 0x81, 0x92, 0x0, 0x4c,
|
||||||
|
0x8, 0x1c, 0x17, 0x68, 0xb9, 0x28, 0x2, 0xe6,
|
||||||
|
0x57, 0x57, 0xd1,
|
||||||
|
|
||||||
|
/* U+34 "4" */
|
||||||
|
0x0, 0xf1, 0xff, 0x80, 0x3f, 0x78, 0x7, 0xf3,
|
||||||
|
0x18, 0x7, 0xe1, 0x94, 0x30, 0xf, 0xac, 0x28,
|
||||||
|
0x3, 0xe4, 0x58, 0x10, 0xf, 0xa4, 0x9c, 0x3,
|
||||||
|
0xe7, 0x29, 0x0, 0xf8, 0xa1, 0x50, 0x3, 0xe9,
|
||||||
|
0xb, 0x0, 0xf8, 0xd0, 0x3b, 0xfe, 0x30, 0xff,
|
||||||
|
0xc, 0x47, 0x84, 0x1e, 0x9, 0xdf, 0xc4, 0x10,
|
||||||
|
0xe0, 0x1f, 0xfc, 0xa0,
|
||||||
|
|
||||||
|
/* U+35 "5" */
|
||||||
|
0x0, 0x7f, 0xfc, 0xa0, 0x20, 0x26, 0x7c, 0x20,
|
||||||
|
0x60, 0xd9, 0x9c, 0x80, 0xc1, 0xc0, 0x1f, 0x8,
|
||||||
|
0x18, 0x7, 0xc4, 0x7, 0x15, 0x6, 0x1, 0x78,
|
||||||
|
0x4b, 0xab, 0xe3, 0x80, 0x38, 0xa7, 0xb9, 0x21,
|
||||||
|
0x4, 0xd, 0xac, 0x22, 0x68, 0xa, 0x0, 0xf9,
|
||||||
|
0x40, 0xc0, 0x3e, 0x30, 0x0, 0xfd, 0x80, 0x62,
|
||||||
|
0x2, 0x13, 0x43, 0x0, 0xa0, 0x30, 0x38, 0x32,
|
||||||
|
0xa7, 0x51, 0xa, 0x5, 0xaa, 0x8c, 0xf, 0x60,
|
||||||
|
|
||||||
|
/* U+36 "6" */
|
||||||
|
0x0, 0x86, 0x37, 0xd4, 0x3, 0x27, 0x39, 0xa3,
|
||||||
|
0x0, 0x45, 0x61, 0x5d, 0x66, 0x1, 0x48, 0x52,
|
||||||
|
0x80, 0x70, 0xa1, 0xa8, 0x7, 0x90, 0x2c, 0x59,
|
||||||
|
0xd4, 0x2, 0x20, 0xde, 0x98, 0xad, 0x10, 0xe0,
|
||||||
|
0x58, 0xee, 0x31, 0x50, 0x5, 0xe, 0x22, 0x92,
|
||||||
|
0x41, 0x0, 0x20, 0x6, 0x50, 0x51, 0x6, 0x0,
|
||||||
|
0xde, 0x3, 0x81, 0xa0, 0x1b, 0x41, 0x90, 0x9c,
|
||||||
|
0x80, 0x4, 0xa2, 0x61, 0xc1, 0xb5, 0x4d, 0xa,
|
||||||
|
0x0, 0x1e, 0x22, 0xa9, 0x31, 0x0,
|
||||||
|
|
||||||
|
/* U+37 "7" */
|
||||||
|
0xef, 0xff, 0xd6, 0xec, 0xde, 0x40, 0x39, 0x9f,
|
||||||
|
0x88, 0x24, 0x3, 0xc2, 0xca, 0x20, 0x1e, 0x60,
|
||||||
|
0x90, 0xf, 0xa4, 0x8c, 0x3, 0xca, 0x36, 0x1,
|
||||||
|
0xf4, 0x8b, 0x0, 0x78, 0xcc, 0xc0, 0x1f, 0x48,
|
||||||
|
0x50, 0x7, 0x85, 0x50, 0x80, 0x3d, 0x21, 0xe0,
|
||||||
|
0x1f, 0x31, 0x20, 0x7, 0x98, 0x68, 0x3, 0xeb,
|
||||||
|
0x6, 0x0, 0xe0,
|
||||||
|
|
||||||
|
/* U+38 "8" */
|
||||||
|
0x0, 0x15, 0x77, 0xea, 0x80, 0x43, 0xaa, 0x8c,
|
||||||
|
0x15, 0x20, 0xb, 0xa, 0xa4, 0xe9, 0x31, 0x2,
|
||||||
|
0x2, 0x80, 0x54, 0x8, 0x6, 0x1, 0xf1, 0x82,
|
||||||
|
0x2, 0x80, 0x54, 0x8, 0x12, 0x75, 0x49, 0xd2,
|
||||||
|
0xa1, 0x0, 0x50, 0x2b, 0x11, 0xa0, 0x1, 0xe5,
|
||||||
|
0x77, 0xe8, 0xb0, 0x42, 0xa, 0x88, 0x16, 0xc9,
|
||||||
|
0x8c, 0x10, 0x3, 0x20, 0x60, 0x0, 0xc0, 0x31,
|
||||||
|
0x80, 0xc, 0x54, 0x80, 0x2b, 0xd, 0xa, 0xd,
|
||||||
|
0xa8, 0xc6, 0x36, 0x4, 0xc4, 0x57, 0x17, 0xc0,
|
||||||
|
|
||||||
|
/* U+39 "9" */
|
||||||
|
0x0, 0x26, 0x7f, 0x51, 0x0, 0x4d, 0x64, 0xca,
|
||||||
|
0xac, 0x10, 0x4, 0x8f, 0xcd, 0xc8, 0xd8, 0x28,
|
||||||
|
0x48, 0x80, 0x18, 0x94, 0x34, 0xc, 0x3, 0x28,
|
||||||
|
0x27, 0x80, 0x7b, 0x80, 0x48, 0xc, 0x3, 0x70,
|
||||||
|
0x1a, 0x4, 0x88, 0x0, 0xdc, 0xc, 0x5c, 0x7e,
|
||||||
|
0x6b, 0x4, 0x4, 0x22, 0x4d, 0x9e, 0x1c, 0x18,
|
||||||
|
0x0, 0xdb, 0xfa, 0xea, 0x24, 0x1, 0xe3, 0x33,
|
||||||
|
0x80, 0x79, 0x34, 0x60, 0x2, 0x5b, 0xeb, 0xd,
|
||||||
|
0x10, 0xb, 0x54, 0x9f, 0xcc, 0x0,
|
||||||
|
|
||||||
|
/* U+3A ":" */
|
||||||
|
0x5f, 0xb0, 0xf0, 0x42, 0x93, 0x62, 0x3c, 0x90,
|
||||||
|
0xf, 0xfe, 0x29, 0xe4, 0x4, 0x9b, 0x97, 0x81,
|
||||||
|
0x90,
|
||||||
|
|
||||||
|
/* U+3B ";" */
|
||||||
|
0x6, 0xfa, 0x0, 0x68, 0x28, 0x3, 0xcd, 0xc0,
|
||||||
|
0x9, 0x90, 0x1, 0xff, 0xcf, 0x4a, 0x60, 0x1,
|
||||||
|
0x2f, 0x0, 0x4, 0x3, 0x70, 0x60, 0x1, 0x9,
|
||||||
|
0x0, 0xf, 0xc0, 0x0,
|
||||||
|
|
||||||
|
/* U+3C "<" */
|
||||||
|
0x0, 0xf9, 0x2c, 0x3, 0x9b, 0x6d, 0x40, 0x2,
|
||||||
|
0xfd, 0x26, 0xd8, 0x33, 0xd0, 0x55, 0xd2, 0x48,
|
||||||
|
0xc3, 0x78, 0xa0, 0x12, 0x28, 0xdd, 0x20, 0x4,
|
||||||
|
0x35, 0xac, 0xb7, 0xae, 0x20, 0x2, 0x9e, 0x83,
|
||||||
|
0x8f, 0x0, 0xc2, 0xfd, 0x24, 0x1, 0xf3, 0x60,
|
||||||
|
|
||||||
|
/* U+3D "=" */
|
||||||
|
0x39, 0x9f, 0xc6, 0xec, 0xdf, 0x95, 0x3f, 0xff,
|
||||||
|
0x30, 0x7, 0xf8, 0xa6, 0x7f, 0x1b, 0x37, 0xf2,
|
||||||
|
0x80,
|
||||||
|
|
||||||
|
/* U+3E ">" */
|
||||||
|
0x3a, 0x30, 0xf, 0x9d, 0x73, 0xa, 0x1, 0xc9,
|
||||||
|
0x8c, 0x75, 0xae, 0x1, 0x8e, 0x7e, 0x9a, 0x3e,
|
||||||
|
0x44, 0x3, 0x2d, 0xe1, 0x32, 0x0, 0x65, 0xbc,
|
||||||
|
0x25, 0x40, 0x28, 0xea, 0x57, 0xea, 0x13, 0xd7,
|
||||||
|
0x39, 0xe8, 0x10, 0x3, 0xa5, 0xeb, 0x0, 0x72,
|
||||||
|
0x5a, 0x0, 0x7c,
|
||||||
|
|
||||||
|
/* U+3F "?" */
|
||||||
|
0x0, 0x1d, 0xf7, 0xea, 0x80, 0x4b, 0x88, 0xaa,
|
||||||
|
0x3a, 0x80, 0x5, 0x86, 0xdd, 0x78, 0xb8, 0x89,
|
||||||
|
0xe0, 0x80, 0x2, 0xe0, 0x43, 0x2e, 0x1, 0x8c,
|
||||||
|
0x4, 0x3, 0xc4, 0xa4, 0x40, 0xf, 0x70, 0x48,
|
||||||
|
0x7, 0xb0, 0xe1, 0x0, 0x3a, 0x4d, 0xdc, 0x1,
|
||||||
|
0xe7, 0x18, 0x0, 0xf8, 0x9c, 0x3, 0xf6, 0x48,
|
||||||
|
0x7, 0xe1, 0x10, 0x7, 0xc3, 0xde, 0x1, 0xf8,
|
||||||
|
0x48, 0x3, 0x0,
|
||||||
|
|
||||||
|
/* U+40 "@" */
|
||||||
|
0x0, 0xd1, 0xbf, 0xae, 0x1, 0xc3, 0xab, 0x76,
|
||||||
|
0xa9, 0xb0, 0xd, 0x4d, 0xac, 0x8f, 0xea, 0xc0,
|
||||||
|
0x4, 0x5b, 0x9, 0xfd, 0x3b, 0xb0, 0x3, 0xe4,
|
||||||
|
0x25, 0x2d, 0x95, 0x44, 0x20, 0x8a, 0x2d, 0xc8,
|
||||||
|
0x2, 0x4, 0x43, 0x2, 0x41, 0x30, 0x72, 0x1,
|
||||||
|
0x77, 0x8, 0x12, 0x80, 0x5, 0xc0, 0x21, 0x30,
|
||||||
|
0xe2, 0x0, 0x10, 0x80, 0xb0, 0x98, 0x0, 0xc0,
|
||||||
|
0x40, 0xc4, 0xc9, 0x44, 0x5e, 0x88, 0xa0, 0x29,
|
||||||
|
0x40, 0x12, 0x67, 0xb, 0x26, 0xc5, 0xb0, 0x5,
|
||||||
|
0xc9, 0xf7, 0x26, 0x5d, 0xa2, 0x0, 0x64, 0xd8,
|
||||||
|
0x44, 0x3a, 0x80, 0x75, 0x4a, 0x55, 0xd9, 0xc0,
|
||||||
|
0x20,
|
||||||
|
|
||||||
|
/* U+41 "A" */
|
||||||
|
0x0, 0xec, 0xf0, 0xf, 0xe1, 0x30, 0x50, 0xf,
|
||||||
|
0xce, 0x0, 0xf0, 0xf, 0xda, 0x8, 0x80, 0xf,
|
||||||
|
0xc8, 0xba, 0x26, 0x1, 0xe4, 0xc, 0x70, 0xb0,
|
||||||
|
0xf, 0x68, 0x38, 0x92, 0x80, 0x79, 0xcc, 0x41,
|
||||||
|
0x48, 0x80, 0x18, 0xc6, 0xc0, 0x16, 0xa, 0x1,
|
||||||
|
0xac, 0x32, 0x66, 0xc, 0x0, 0xca, 0x8, 0xcc,
|
||||||
|
0x50, 0x41, 0x0, 0x11, 0x1b, 0xff, 0x50, 0x20,
|
||||||
|
0x1, 0x43, 0x40, 0x32, 0x7, 0x80, 0x30, 0x10,
|
||||||
|
0x3, 0x9, 0xa0, 0xa, 0x20, 0x3, 0xc8, 0x28,
|
||||||
|
|
||||||
|
/* U+42 "B" */
|
||||||
|
0x4f, 0xfd, 0xd8, 0xa0, 0x18, 0xd9, 0x88, 0x55,
|
||||||
|
0x40, 0xa, 0xe6, 0x55, 0xc6, 0xa8, 0x1, 0xf4,
|
||||||
|
0x86, 0x0, 0x7c, 0x61, 0xe0, 0x1e, 0x1b, 0x5,
|
||||||
|
0x0, 0x5c, 0x42, 0x7c, 0xa8, 0x80, 0x6, 0xee,
|
||||||
|
0x61, 0x36, 0x0, 0xa3, 0xfe, 0xb1, 0xc3, 0x0,
|
||||||
|
0xf2, 0x70, 0x40, 0x7, 0xc6, 0xa, 0x1, 0xf0,
|
||||||
|
0x81, 0x80, 0x7d, 0x0, 0xa0, 0xb, 0x88, 0x4e,
|
||||||
|
0xb1, 0xc0, 0x0, 0xdd, 0xcc, 0x11, 0x80,
|
||||||
|
|
||||||
|
/* U+43 "C" */
|
||||||
|
0x0, 0x15, 0xff, 0xb1, 0x80, 0x24, 0xd5, 0x53,
|
||||||
|
0x14, 0xc8, 0x1, 0x43, 0xf5, 0x3c, 0x6c, 0x6c,
|
||||||
|
0x30, 0x20, 0x17, 0x84, 0xe8, 0x38, 0x6, 0x35,
|
||||||
|
0x36, 0x11, 0x0, 0x75, 0x49, 0x18, 0x7, 0xff,
|
||||||
|
0x40, 0x8c, 0x3, 0xf3, 0x8, 0x80, 0x3a, 0x63,
|
||||||
|
0x41, 0xc0, 0x31, 0xb1, 0x30, 0xc0, 0x80, 0x50,
|
||||||
|
0x12, 0x14, 0x3f, 0x32, 0xd4, 0x73, 0x4, 0xc5,
|
||||||
|
0x76, 0x19, 0x80,
|
||||||
|
|
||||||
|
/* U+44 "D" */
|
||||||
|
0x7f, 0xfb, 0xb1, 0x80, 0x3c, 0xae, 0xe1, 0x9d,
|
||||||
|
0x10, 0xd, 0xf1, 0x3b, 0x25, 0x80, 0x1f, 0x99,
|
||||||
|
0x84, 0xc0, 0x1f, 0xa0, 0x34, 0x3, 0xf0, 0x92,
|
||||||
|
0x0, 0x7f, 0x8, 0x7, 0xf9, 0xc0, 0x40, 0x3f,
|
||||||
|
0x38, 0x8, 0x7, 0xe1, 0x0, 0xfe, 0x12, 0x40,
|
||||||
|
0xf, 0xd0, 0x1a, 0x1, 0xf3, 0xb1, 0xb0, 0x5,
|
||||||
|
0xf1, 0x3b, 0x5, 0xa0, 0x19, 0x5d, 0xc3, 0x3a,
|
||||||
|
0x20, 0x0,
|
||||||
|
|
||||||
|
/* U+45 "E" */
|
||||||
|
0x3f, 0xff, 0xcc, 0x0, 0x26, 0x6f, 0x28, 0x1,
|
||||||
|
0x26, 0x7c, 0x60, 0x1f, 0xfd, 0xe6, 0xff, 0xe8,
|
||||||
|
0x0, 0x89, 0xdf, 0xb0, 0x2, 0x48, 0x8e, 0x40,
|
||||||
|
0xf, 0xfe, 0xaa, 0x44, 0x79, 0x0, 0x4, 0xef,
|
||||||
|
0xec,
|
||||||
|
|
||||||
|
/* U+46 "F" */
|
||||||
|
0x2f, 0xff, 0xd2, 0x0, 0x26, 0x6f, 0x60, 0x1,
|
||||||
|
0xe6, 0x7c, 0xa0, 0x1f, 0xfd, 0xe5, 0xff, 0xe9,
|
||||||
|
0x0, 0x89, 0xdf, 0xb0, 0x2, 0x78, 0x8e, 0x50,
|
||||||
|
0xf, 0xff, 0x38,
|
||||||
|
|
||||||
|
/* U+47 "G" */
|
||||||
|
0x0, 0x8a, 0xff, 0xd8, 0xa0, 0x19, 0x35, 0x10,
|
||||||
|
0xa5, 0x52, 0x1, 0x50, 0xed, 0xd7, 0x1b, 0x20,
|
||||||
|
0x38, 0xc1, 0x0, 0x5e, 0x1e, 0x18, 0xe, 0x1,
|
||||||
|
0x8e, 0x78, 0x14, 0x44, 0x1, 0xcc, 0xa0, 0x24,
|
||||||
|
0x1, 0xff, 0xc2, 0x68, 0x89, 0xc0, 0x3d, 0xae,
|
||||||
|
0xf4, 0x80, 0x90, 0x5, 0x7f, 0xe2, 0x0, 0x28,
|
||||||
|
0x88, 0x3, 0xf6, 0x84, 0x80, 0x7e, 0x62, 0x74,
|
||||||
|
0x0, 0x88, 0x80, 0x17, 0x8d, 0xda, 0x6f, 0x42,
|
||||||
|
0x80, 0x5, 0xec, 0xac, 0xc7, 0xd4,
|
||||||
|
|
||||||
|
/* U+48 "H" */
|
||||||
|
0x9f, 0x10, 0xc, 0x3f, 0x20, 0x1f, 0xff, 0x2e,
|
||||||
|
0xff, 0xdc, 0x1, 0x99, 0xdf, 0x30, 0x6, 0x88,
|
||||||
|
0xf0, 0x7, 0xff, 0xa0,
|
||||||
|
|
||||||
|
/* U+49 "I" */
|
||||||
|
0x4f, 0xff, 0xc8, 0xcd, 0x80, 0xc, 0xd8, 0xa6,
|
||||||
|
0x60, 0x19, 0x98, 0x80, 0x3f, 0xff, 0xe0, 0x1f,
|
||||||
|
0xfc, 0xd2, 0x99, 0x80, 0x66, 0x62, 0x66, 0xc0,
|
||||||
|
0x6, 0x6c,
|
||||||
|
|
||||||
|
/* U+4A "J" */
|
||||||
|
0x0, 0xfd, 0x3e, 0x60, 0x1f, 0xff, 0xf0, 0xf,
|
||||||
|
0xfe, 0x6b, 0xb0, 0x7, 0x18, 0x5, 0x52, 0x1,
|
||||||
|
0xce, 0x6, 0x14, 0x12, 0x1, 0x39, 0x28, 0x1,
|
||||||
|
0xcd, 0xb6, 0x72, 0xa, 0xc0, 0x2c, 0x80, 0x62,
|
||||||
|
0x6c, 0x10,
|
||||||
|
|
||||||
|
/* U+4B "K" */
|
||||||
|
0x4f, 0x80, 0xc, 0x9f, 0xa0, 0x1f, 0x15, 0x7,
|
||||||
|
0x80, 0x7d, 0xc3, 0x44, 0x1, 0xe9, 0x36, 0x50,
|
||||||
|
0xf, 0x2b, 0x14, 0x80, 0x78, 0xa8, 0x3c, 0x3,
|
||||||
|
0xc3, 0xc1, 0x4, 0x1, 0xe6, 0x30, 0xa0, 0xf,
|
||||||
|
0xc8, 0xa5, 0x0, 0x1e, 0x2a, 0xb1, 0x72, 0x0,
|
||||||
|
0xe5, 0x11, 0x40, 0x70, 0x7, 0xe6, 0x33, 0x30,
|
||||||
|
0x7, 0xee, 0x8, 0x10, 0xf, 0x89, 0xc6, 0xc0,
|
||||||
|
0x3f, 0x41, 0x2a, 0x0,
|
||||||
|
|
||||||
|
/* U+4C "L" */
|
||||||
|
0xf, 0xb0, 0xf, 0xff, 0xf8, 0x7, 0xff, 0xa9,
|
||||||
|
0x62, 0x3c, 0xc0, 0x1, 0x77, 0xf6, 0x0,
|
||||||
|
|
||||||
|
/* U+4D "M" */
|
||||||
|
0x8f, 0xd0, 0xd, 0x5f, 0x60, 0x2, 0x20, 0x4,
|
||||||
|
0xa0, 0x1c, 0xa0, 0x5, 0x0, 0xe2, 0xb0, 0x7,
|
||||||
|
0x88, 0x80, 0x24, 0x31, 0x5, 0x60, 0xd, 0xa0,
|
||||||
|
0xea, 0x16, 0x1, 0x98, 0xb7, 0xc4, 0xc4, 0x3,
|
||||||
|
0x2a, 0x2b, 0x80, 0x7a, 0xc0, 0x1a, 0x1, 0xc2,
|
||||||
|
0x62, 0x24, 0x0, 0xf9, 0x98, 0x1, 0xfa, 0x20,
|
||||||
|
0x1, 0xff, 0xd6,
|
||||||
|
|
||||||
|
/* U+4E "N" */
|
||||||
|
0x9f, 0x70, 0xc, 0x7f, 0x20, 0x9, 0x0, 0xfe,
|
||||||
|
0x17, 0x0, 0xfe, 0x90, 0xf, 0xca, 0x2e, 0x1,
|
||||||
|
0xf7, 0xc, 0x80, 0x7c, 0xf0, 0x2c, 0x1, 0xf3,
|
||||||
|
0xc, 0x0, 0x7e, 0x81, 0x60, 0xf, 0x98, 0x61,
|
||||||
|
0xc0, 0x3e, 0x91, 0xe0, 0xf, 0x9c, 0x54, 0x3,
|
||||||
|
0xf4, 0x80, 0x7f, 0x38, 0x80, 0x7f, 0x48, 0x0,
|
||||||
|
|
||||||
|
/* U+4F "O" */
|
||||||
|
0x0, 0x1d, 0xff, 0xac, 0x80, 0x24, 0xc4, 0x33,
|
||||||
|
0x26, 0x98, 0x2, 0x87, 0x73, 0x20, 0xd0, 0x61,
|
||||||
|
0x92, 0x0, 0x1c, 0xb, 0x60, 0x30, 0x6, 0x60,
|
||||||
|
0xc7, 0x11, 0x0, 0x61, 0x13, 0x91, 0x80, 0x78,
|
||||||
|
0xcc, 0x2, 0x1, 0xf0, 0x80, 0x80, 0x7c, 0x24,
|
||||||
|
0x60, 0x1e, 0x33, 0x38, 0x88, 0x3, 0x8, 0x9f,
|
||||||
|
0x1, 0x80, 0x33, 0x6, 0x30, 0xc1, 0x80, 0xa,
|
||||||
|
0x45, 0x82, 0x83, 0x2e, 0xda, 0x34, 0x0, 0x4d,
|
||||||
|
0x44, 0xd8, 0x80,
|
||||||
|
|
||||||
|
/* U+50 "P" */
|
||||||
|
0x2f, 0xfe, 0xe9, 0x10, 0xc, 0x4e, 0xf2, 0xb7,
|
||||||
|
0x90, 0x4, 0xf1, 0x15, 0xc8, 0xc8, 0x7, 0xe6,
|
||||||
|
0x24, 0x10, 0xf, 0xce, 0x6, 0x1, 0xf9, 0x80,
|
||||||
|
0xc0, 0x3e, 0x53, 0x41, 0x0, 0x3c, 0x45, 0x74,
|
||||||
|
0x32, 0x1, 0x13, 0xbc, 0xad, 0xe4, 0x1, 0x2f,
|
||||||
|
0xfd, 0xd2, 0x20, 0x1f, 0xfe, 0xd0,
|
||||||
|
|
||||||
|
/* U+51 "Q" */
|
||||||
|
0x0, 0x8e, 0xff, 0xd6, 0x60, 0x1c, 0x98, 0x86,
|
||||||
|
0x64, 0xc4, 0x0, 0x86, 0xc7, 0x73, 0x1a, 0x36,
|
||||||
|
0x20, 0x6, 0x8, 0x20, 0x1, 0x58, 0x30, 0x2,
|
||||||
|
0xc1, 0x80, 0x32, 0x85, 0x80, 0xc, 0x80, 0x3c,
|
||||||
|
0x46, 0x1, 0x30, 0x7, 0x98, 0x0, 0x20, 0x1f,
|
||||||
|
0xe1, 0x10, 0x7, 0xf8, 0x40, 0xc, 0x1, 0xe6,
|
||||||
|
0x0, 0x8c, 0x80, 0x3c, 0x46, 0x0, 0xb0, 0x50,
|
||||||
|
0xc, 0xa1, 0x60, 0x6, 0xb, 0x20, 0x1, 0x58,
|
||||||
|
0x30, 0x0, 0x6c, 0x76, 0xed, 0xa3, 0x42, 0x1,
|
||||||
|
0x26, 0x22, 0x42, 0x1a, 0x1, 0xc7, 0x7f, 0xf1,
|
||||||
|
0xbd, 0x0, 0x7e, 0x1c, 0x47, 0x10, 0xf, 0xeb,
|
||||||
|
0xd1,
|
||||||
|
|
||||||
|
/* U+52 "R" */
|
||||||
|
0x3f, 0xfe, 0xc6, 0x0, 0xe3, 0x77, 0x31, 0x4d,
|
||||||
|
0x0, 0x64, 0x88, 0x4f, 0x1a, 0xa8, 0x3, 0xf7,
|
||||||
|
0x87, 0x80, 0x7e, 0x20, 0x10, 0xf, 0xc4, 0x2,
|
||||||
|
0x1, 0xfb, 0xc3, 0x80, 0x24, 0x88, 0x4f, 0x1b,
|
||||||
|
0x20, 0x4, 0x6e, 0xe6, 0x19, 0x90, 0x6, 0x7f,
|
||||||
|
0xf5, 0x7, 0x0, 0x7e, 0x51, 0x71, 0x0, 0xfd,
|
||||||
|
0x0, 0xc0, 0x1f, 0x98, 0x64, 0x3, 0xfa, 0x45,
|
||||||
|
0xc0, 0x3f, 0x30, 0x48, 0x0,
|
||||||
|
|
||||||
|
/* U+53 "S" */
|
||||||
|
0x0, 0x1d, 0xf7, 0xe2, 0x80, 0x65, 0xc4, 0x55,
|
||||||
|
0x15, 0x58, 0x0, 0x68, 0x76, 0xeb, 0x91, 0xe,
|
||||||
|
0x8, 0xc, 0x40, 0x14, 0x85, 0x0, 0x42, 0x1,
|
||||||
|
0x8a, 0x6c, 0x10, 0x19, 0x40, 0x33, 0x30, 0x6,
|
||||||
|
0xc2, 0xb1, 0x84, 0x3, 0x93, 0x50, 0xe7, 0xa0,
|
||||||
|
0x3, 0x8a, 0xfa, 0x5, 0xf4, 0x3, 0xc2, 0xfc,
|
||||||
|
0xa5, 0x40, 0xac, 0x1, 0xd4, 0xa, 0x1d, 0x28,
|
||||||
|
0x1, 0xfb, 0xc2, 0x44, 0x2, 0x70, 0x40, 0x47,
|
||||||
|
0x2e, 0xa9, 0xc8, 0x19, 0x0, 0x45, 0xa2, 0x18,
|
||||||
|
0x63, 0xc8, 0x0,
|
||||||
|
|
||||||
|
/* U+54 "T" */
|
||||||
|
0x3f, 0xff, 0xf2, 0xb, 0x36, 0x0, 0x33, 0x71,
|
||||||
|
0x4c, 0xe2, 0x19, 0x9c, 0x40, 0x1f, 0xff, 0xf0,
|
||||||
|
0xf, 0xff, 0xc8,
|
||||||
|
|
||||||
|
/* U+55 "U" */
|
||||||
|
0xaf, 0x10, 0xc, 0x5f, 0x20, 0x1f, 0xfc, 0x73,
|
||||||
|
0x0, 0xff, 0xef, 0x18, 0x7, 0xff, 0x3c, 0xc0,
|
||||||
|
0x40, 0x30, 0x81, 0xf8, 0x20, 0x6, 0x40, 0xf7,
|
||||||
|
0x9, 0x20, 0x1, 0x48, 0x38, 0xd0, 0xed, 0x53,
|
||||||
|
0x46, 0x84, 0x17, 0x11, 0x54, 0x98, 0xa0,
|
||||||
|
|
||||||
|
/* U+56 "V" */
|
||||||
|
0x2f, 0xc0, 0xf, 0x6f, 0x89, 0x10, 0xc0, 0x38,
|
||||||
|
0x48, 0xc4, 0x10, 0x14, 0x3, 0x38, 0x58, 0x3,
|
||||||
|
0x43, 0x0, 0x36, 0x2, 0x0, 0x10, 0x1c, 0x3,
|
||||||
|
0x20, 0x98, 0x4, 0xa2, 0x40, 0x3, 0x17, 0x0,
|
||||||
|
0xde, 0x8, 0x0, 0xb0, 0xd0, 0xc, 0x81, 0xa0,
|
||||||
|
0x4, 0x4, 0x0, 0xc2, 0x68, 0x2, 0x68, 0x1,
|
||||||
|
0xeb, 0x4, 0x40, 0x68, 0x7, 0x94, 0x33, 0xc1,
|
||||||
|
0xc0, 0x3c, 0x44, 0x54, 0x31, 0x0, 0xf9, 0x8,
|
||||||
|
0x50, 0x3, 0xf6, 0x80, 0x2c, 0x3, 0xf2, 0x0,
|
||||||
|
0x98, 0x6,
|
||||||
|
|
||||||
|
/* U+57 "W" */
|
||||||
|
0x3f, 0x70, 0x5, 0xf8, 0x0, 0xfd, 0xc8, 0x38,
|
||||||
|
0x0, 0xa0, 0x40, 0xc0, 0x42, 0x6, 0x2, 0x20,
|
||||||
|
0x70, 0x30, 0x10, 0x16, 0x2, 0x0, 0x68, 0x70,
|
||||||
|
0x30, 0x11, 0x1, 0x40, 0xc8, 0x4, 0x8, 0x18,
|
||||||
|
0x43, 0xc9, 0x5c, 0x8, 0x40, 0x4, 0x2, 0x4f,
|
||||||
|
0xe4, 0xc, 0x40, 0xe, 0x3, 0x52, 0x20, 0x11,
|
||||||
|
0xb0, 0x0, 0x81, 0xc7, 0x54, 0x1c, 0x48, 0x0,
|
||||||
|
0xe1, 0x80, 0xc2, 0x2c, 0xf, 0x0, 0x10, 0x38,
|
||||||
|
0x18, 0x13, 0x81, 0x0, 0x4, 0x4, 0x80, 0xa,
|
||||||
|
0x20, 0xc0, 0x11, 0x3, 0x0, 0x38, 0x0, 0x40,
|
||||||
|
0x13, 0x1, 0x80, 0xc, 0x0, 0x20, 0x11, 0x7,
|
||||||
|
0x0, 0x14, 0x8, 0x0,
|
||||||
|
|
||||||
|
/* U+58 "X" */
|
||||||
|
0xc, 0xf5, 0x0, 0xc3, 0xfe, 0x10, 0xf0, 0x80,
|
||||||
|
0xd, 0x61, 0x2, 0x6, 0xa4, 0xc0, 0x2, 0x51,
|
||||||
|
0x70, 0xa, 0x2, 0x0, 0x12, 0x16, 0x1, 0x89,
|
||||||
|
0xc5, 0xcd, 0xd, 0x40, 0x3a, 0x46, 0x7c, 0x3c,
|
||||||
|
0x3, 0xc3, 0x2, 0x68, 0x60, 0x1f, 0x38, 0x3,
|
||||||
|
0x80, 0x3f, 0x48, 0x2, 0x40, 0x3e, 0x17, 0x26,
|
||||||
|
0x35, 0x0, 0xf5, 0x84, 0x40, 0x20, 0x3, 0x8d,
|
||||||
|
0x49, 0x45, 0xc9, 0x80, 0x37, 0x84, 0x80, 0x24,
|
||||||
|
0x20, 0x40, 0xa, 0x66, 0x40, 0x0, 0xb8, 0xc8,
|
||||||
|
0x2, 0x3, 0xc0, 0x34, 0xb, 0x90,
|
||||||
|
|
||||||
|
/* U+59 "Y" */
|
||||||
|
0x2f, 0xd0, 0xe, 0x1f, 0xe0, 0x24, 0x25, 0x0,
|
||||||
|
0xd2, 0x12, 0x0, 0x80, 0x90, 0xc, 0xc0, 0xc0,
|
||||||
|
0x3, 0x3c, 0x0, 0x61, 0x71, 0x0, 0xa0, 0x24,
|
||||||
|
0x1, 0x61, 0x20, 0x19, 0x9, 0x45, 0x49, 0x84,
|
||||||
|
0x3, 0xa0, 0x26, 0x41, 0x60, 0x1e, 0x52, 0x73,
|
||||||
|
0x52, 0x0, 0xfa, 0xc0, 0x12, 0x1, 0xf9, 0x80,
|
||||||
|
0xcc, 0x1, 0xff, 0xd6, 0x70, 0xf, 0xfe, 0x88,
|
||||||
|
|
||||||
|
/* U+5A "Z" */
|
||||||
|
0xcf, 0xff, 0xc9, 0x6c, 0xde, 0x0, 0x33, 0xcc,
|
||||||
|
0xf6, 0x2, 0x90, 0x7, 0xac, 0x2c, 0x3, 0xd0,
|
||||||
|
0x30, 0x20, 0x1c, 0x4e, 0x4e, 0x1, 0xe9, 0x9,
|
||||||
|
0x0, 0xf2, 0x21, 0x50, 0x3, 0xd2, 0x16, 0x1,
|
||||||
|
0xe7, 0x28, 0x10, 0xe, 0x18, 0x27, 0x0, 0xf5,
|
||||||
|
0x84, 0x0, 0x79, 0x15, 0x14, 0x3, 0xd0, 0x0,
|
||||||
|
0x88, 0xf2, 0x8, 0x23, 0xbf, 0xb0,
|
||||||
|
|
||||||
|
/* U+5B "[" */
|
||||||
|
0x68, 0x88, 0x2d, 0xde, 0x0, 0x17, 0xf8, 0x3,
|
||||||
|
0xff, 0xfe, 0x0, 0x28, 0x80, 0x4, 0xee, 0x0,
|
||||||
|
|
||||||
|
/* U+5C "\\" */
|
||||||
|
0x9f, 0x10, 0xe, 0xa0, 0x60, 0xe, 0x32, 0xa0,
|
||||||
|
0xf, 0x51, 0x18, 0x7, 0x30, 0x58, 0x7, 0xa,
|
||||||
|
0x30, 0x7, 0xb8, 0x50, 0x3, 0x94, 0x78, 0x3,
|
||||||
|
0xce, 0xa2, 0x1, 0xd4, 0xe, 0x1, 0xc6, 0x54,
|
||||||
|
0x1, 0xea, 0x32, 0x0, 0xe6, 0xa, 0x0, 0xe1,
|
||||||
|
0x46, 0x0, 0xf7, 0xa, 0x0, 0x72, 0x87, 0x0,
|
||||||
|
|
||||||
|
/* U+5D "]" */
|
||||||
|
0x8, 0x89, 0x81, 0xde, 0xb0, 0xff, 0x10, 0x7,
|
||||||
|
0xff, 0xfc, 0x1, 0x10, 0x20, 0x3, 0xb8, 0x0,
|
||||||
|
|
||||||
|
/* U+5E "^" */
|
||||||
|
0x0, 0xb7, 0x40, 0x1c, 0x64, 0x43, 0x0, 0xd4,
|
||||||
|
0x0, 0xa0, 0xc, 0xca, 0xa6, 0x0, 0x98, 0x3b,
|
||||||
|
0x80, 0xa0, 0xa, 0x14, 0x40, 0xc8, 0x11, 0xb0,
|
||||||
|
0x1, 0x8c, 0xa8, 0x28, 0x1, 0x41, 0x40,
|
||||||
|
|
||||||
|
/* U+5F "_" */
|
||||||
|
0x37, 0x7f, 0xc6, 0x91, 0x1f, 0x90,
|
||||||
|
|
||||||
|
/* U+60 "`" */
|
||||||
|
0x57, 0x30, 0x4a, 0xe0, 0x1f, 0x39,
|
||||||
|
|
||||||
|
/* U+61 "a" */
|
||||||
|
0x0, 0x26, 0x7f, 0x62, 0x80, 0x4d, 0x62, 0xee,
|
||||||
|
0x3a, 0x60, 0x19, 0x2d, 0x89, 0xd0, 0x90, 0x4,
|
||||||
|
0x48, 0x4, 0x48, 0x4, 0x2e, 0x80, 0x18, 0x40,
|
||||||
|
0x21, 0x9d, 0xff, 0x94, 0x2, 0xc6, 0x4a, 0xbc,
|
||||||
|
0x40, 0x3, 0x14, 0x4a, 0xa1, 0x88, 0x7, 0xe1,
|
||||||
|
0x70, 0x3, 0x8c, 0x4b, 0xcf, 0x90, 0x8, 0xb1,
|
||||||
|
0x5e, 0x16, 0x1c, 0x14,
|
||||||
|
|
||||||
|
/* U+62 "b" */
|
||||||
|
0x4f, 0x80, 0xf, 0xfe, 0xe3, 0xef, 0xeb, 0x0,
|
||||||
|
0x67, 0x87, 0x53, 0x97, 0x0, 0x87, 0x6a, 0x98,
|
||||||
|
0x30, 0x20, 0x6, 0x20, 0x1, 0x48, 0x38, 0x7,
|
||||||
|
0xc8, 0x1e, 0x1, 0xf0, 0x81, 0x80, 0x7c, 0x20,
|
||||||
|
0x60, 0x1f, 0x28, 0x78, 0x1, 0x40, 0x35, 0x83,
|
||||||
|
0x80, 0xb, 0x5d, 0xb0, 0xa0, 0x40, 0x10, 0xb3,
|
||||||
|
0x21, 0x97, 0x0,
|
||||||
|
|
||||||
|
/* U+63 "c" */
|
||||||
|
0x0, 0x1d, 0xf7, 0xea, 0x80, 0x49, 0x88, 0xec,
|
||||||
|
0x15, 0x20, 0xa, 0xc, 0x99, 0x6a, 0x31, 0xa8,
|
||||||
|
0xb9, 0x80, 0x5e, 0x4b, 0xa1, 0x80, 0x19, 0x35,
|
||||||
|
0x84, 0x1c, 0x3, 0xe1, 0x7, 0x0, 0xfb, 0x43,
|
||||||
|
0x0, 0x31, 0x42, 0x28, 0xb9, 0x0, 0x50, 0xee,
|
||||||
|
0xa, 0xd, 0x98, 0xd5, 0x73, 0x4, 0xc4, 0x77,
|
||||||
|
0xd, 0xc0, 0x0,
|
||||||
|
|
||||||
|
/* U+64 "d" */
|
||||||
|
0x0, 0xfa, 0x3d, 0x0, 0x3f, 0xfa, 0x8b, 0xbf,
|
||||||
|
0xce, 0x1, 0x9a, 0x89, 0x52, 0x1c, 0x0, 0x32,
|
||||||
|
0x3b, 0x54, 0xd1, 0x0, 0x38, 0x31, 0x0, 0x9,
|
||||||
|
0x80, 0x1e, 0x18, 0x1, 0xf1, 0x83, 0x80, 0x7c,
|
||||||
|
0x60, 0xe0, 0x1f, 0x78, 0x60, 0x7, 0xce, 0xc,
|
||||||
|
0x40, 0x1, 0x50, 0x0, 0xc8, 0xed, 0x53, 0xc8,
|
||||||
|
0x2, 0x6a, 0x25, 0x46, 0x80, 0x0,
|
||||||
|
|
||||||
|
/* U+65 "e" */
|
||||||
|
0x0, 0x15, 0x77, 0xe2, 0x80, 0x47, 0xaa, 0x8e,
|
||||||
|
0x55, 0x0, 0xd, 0x1d, 0xa8, 0xe3, 0x72, 0x61,
|
||||||
|
0x92, 0x0, 0xa4, 0x17, 0xc3, 0x26, 0x77, 0x87,
|
||||||
|
0x18, 0x23, 0x36, 0x50, 0x30, 0x6, 0x7f, 0xfa,
|
||||||
|
0xb4, 0x2c, 0x3, 0xe6, 0x7, 0x40, 0x8, 0xac,
|
||||||
|
0x86, 0xc2, 0xea, 0x2b, 0x54, 0xc1, 0x35, 0x51,
|
||||||
|
0xde, 0xf1,
|
||||||
|
|
||||||
|
/* U+66 "f" */
|
||||||
|
0x0, 0xe2, 0x68, 0x74, 0x0, 0xe7, 0xd9, 0x78,
|
||||||
|
0xb0, 0xc, 0x70, 0x57, 0xfe, 0xd0, 0xd, 0x61,
|
||||||
|
0x8, 0x0, 0x20, 0xc, 0x20, 0xc0, 0x1d, 0x1f,
|
||||||
|
0xe6, 0xc, 0xff, 0x90, 0x2e, 0x64, 0x60, 0xf3,
|
||||||
|
0x32, 0x81, 0xb3, 0x14, 0x2d, 0x9a, 0x10, 0xf,
|
||||||
|
0xff, 0xf8, 0x7, 0xff, 0x8,
|
||||||
|
|
||||||
|
/* U+67 "g" */
|
||||||
|
0x0, 0x36, 0xff, 0x43, 0xfa, 0x3, 0xc8, 0x44,
|
||||||
|
0xa4, 0x0, 0x6, 0x7, 0x1d, 0xd8, 0x60, 0x7,
|
||||||
|
0x9, 0x10, 0x9, 0x0, 0x1e, 0x6, 0x1, 0xfc,
|
||||||
|
0xe0, 0x1f, 0xce, 0x1, 0xf7, 0x86, 0x0, 0x7c,
|
||||||
|
0xe0, 0xc4, 0x0, 0x16, 0x0, 0xc, 0x8e, 0xd5,
|
||||||
|
0x3c, 0x40, 0x26, 0xa2, 0x57, 0x67, 0x0, 0xcb,
|
||||||
|
0xbf, 0xb0, 0x40, 0xc1, 0xa, 0x1, 0x12, 0x91,
|
||||||
|
0x0, 0xea, 0xe2, 0xb4, 0x24, 0x1, 0x72, 0xee,
|
||||||
|
0x54, 0xc4, 0x0,
|
||||||
|
|
||||||
|
/* U+68 "h" */
|
||||||
|
0x4f, 0x70, 0xf, 0xfe, 0xe1, 0xdf, 0xf4, 0x88,
|
||||||
|
0x5, 0x78, 0xc, 0x6d, 0xa0, 0x11, 0x6d, 0xce,
|
||||||
|
0x91, 0x98, 0x0, 0xc4, 0x1, 0x50, 0x28, 0x3,
|
||||||
|
0xc0, 0x30, 0x80, 0x7f, 0x18, 0x7, 0xff, 0xa0,
|
||||||
|
|
||||||
|
/* U+69 "i" */
|
||||||
|
0x0, 0xcd, 0xe8, 0x1, 0xf7, 0x1, 0x0, 0x7d,
|
||||||
|
0x1c, 0xc0, 0x1f, 0x84, 0x3, 0xbf, 0xf9, 0x80,
|
||||||
|
0x33, 0x34, 0x60, 0x1e, 0x99, 0xa8, 0x3, 0xff,
|
||||||
|
0xed, 0x33, 0x50, 0x54, 0xc9, 0xc1, 0x9a, 0x30,
|
||||||
|
0x36, 0x65, 0x0,
|
||||||
|
|
||||||
|
/* U+6A "j" */
|
||||||
|
0x0, 0xd3, 0xc4, 0x1, 0x8c, 0x44, 0x1, 0xab,
|
||||||
|
0x8c, 0x3, 0x84, 0x7, 0xff, 0x8c, 0x59, 0xa2,
|
||||||
|
0x0, 0xa6, 0x65, 0x0, 0xff, 0xf9, 0x10, 0x7,
|
||||||
|
0xa, 0x81, 0xc4, 0x27, 0xc2, 0x1, 0x5d, 0x8a,
|
||||||
|
0x9c, 0x0,
|
||||||
|
|
||||||
|
/* U+6B "k" */
|
||||||
|
0x4f, 0x80, 0xf, 0xff, 0x1a, 0xfe, 0x88, 0x7,
|
||||||
|
0x92, 0x8b, 0x4, 0x3, 0x92, 0xc7, 0xc4, 0x3,
|
||||||
|
0x8e, 0xc7, 0x8, 0x3, 0x8b, 0x42, 0xc8, 0x3,
|
||||||
|
0xca, 0x21, 0x20, 0x1f, 0xad, 0x4e, 0x40, 0x3c,
|
||||||
|
0xe9, 0x64, 0xca, 0x1, 0xf0, 0xf0, 0x51, 0x0,
|
||||||
|
0x7c, 0x72, 0x1e, 0x1, 0xf9, 0x94, 0xa8, 0x0,
|
||||||
|
|
||||||
|
/* U+6C "l" */
|
||||||
|
0xf, 0xfe, 0x60, 0xc, 0xcd, 0x18, 0x7, 0xa6,
|
||||||
|
0x6a, 0x0, 0xff, 0xff, 0x80, 0x7f, 0xf4, 0xe6,
|
||||||
|
0x6a, 0xa, 0x99, 0x38, 0x33, 0x46, 0x6, 0xcc,
|
||||||
|
0xa0,
|
||||||
|
|
||||||
|
/* U+6D "m" */
|
||||||
|
0x1f, 0x9b, 0xfd, 0x5b, 0xfd, 0x30, 0x9, 0xb1,
|
||||||
|
0xca, 0x8a, 0xb, 0x80, 0x25, 0x78, 0x11, 0x4b,
|
||||||
|
0xa9, 0x0, 0x46, 0x0, 0x33, 0x0, 0xc, 0x4,
|
||||||
|
0x3, 0xff, 0xfe, 0x1, 0xfc,
|
||||||
|
|
||||||
|
/* U+6E "n" */
|
||||||
|
0x4f, 0x54, 0xcf, 0xd9, 0x10, 0xb, 0xad, 0x98,
|
||||||
|
0xd, 0xa0, 0x12, 0xed, 0x4e, 0x99, 0x88, 0x0,
|
||||||
|
0xc4, 0x1, 0x58, 0x38, 0x3, 0xc0, 0x30, 0x81,
|
||||||
|
0x80, 0x7f, 0xfc, 0x0,
|
||||||
|
|
||||||
|
/* U+6F "o" */
|
||||||
|
0x0, 0x25, 0xff, 0xad, 0x0, 0x26, 0xb5, 0x66,
|
||||||
|
0x2d, 0xb0, 0x14, 0x97, 0xcc, 0xbc, 0xa4, 0xa8,
|
||||||
|
0x2c, 0x40, 0x3, 0x61, 0x46, 0xe, 0x1, 0x90,
|
||||||
|
0xd, 0xc0, 0x40, 0x31, 0x3, 0xb8, 0x4, 0x3,
|
||||||
|
0x8, 0x39, 0x82, 0x0, 0x64, 0x3, 0xa0, 0x81,
|
||||||
|
0x0, 0xc, 0x5, 0x14, 0x97, 0xcc, 0xbc, 0xa4,
|
||||||
|
0x81, 0xac, 0x99, 0x85, 0x6c, 0x0,
|
||||||
|
|
||||||
|
/* U+70 "p" */
|
||||||
|
0x4f, 0x67, 0xdf, 0xd6, 0x0, 0xd1, 0x2e, 0xa5,
|
||||||
|
0x2e, 0x1, 0x1f, 0xd5, 0x30, 0x20, 0x40, 0xa,
|
||||||
|
0x20, 0x3, 0x70, 0x70, 0x7, 0x80, 0x6c, 0xe,
|
||||||
|
0x0, 0xf9, 0xc0, 0x40, 0x3e, 0x70, 0x10, 0xf,
|
||||||
|
0xb0, 0x34, 0x1, 0x60, 0x11, 0x30, 0x20, 0x0,
|
||||||
|
0xf6, 0x65, 0xa3, 0x2, 0x0, 0x75, 0x76, 0x29,
|
||||||
|
0x70, 0xb, 0xe3, 0xbf, 0x58, 0x3, 0xff, 0xa8,
|
||||||
|
|
||||||
|
/* U+71 "q" */
|
||||||
|
0x0, 0x2e, 0xff, 0x4c, 0x7a, 0x3, 0xd0, 0x4c,
|
||||||
|
0x2b, 0x80, 0x6, 0x7, 0x19, 0x98, 0x80, 0x7,
|
||||||
|
0x9, 0x10, 0x8, 0xc0, 0x1e, 0x6, 0x1, 0xfc,
|
||||||
|
0xe0, 0x1f, 0xce, 0x1, 0xf7, 0x86, 0x0, 0x7c,
|
||||||
|
0xe0, 0xc4, 0x0, 0x15, 0x0, 0xc, 0xe, 0x4c,
|
||||||
|
0xbc, 0x80, 0x27, 0xa3, 0x67, 0x67, 0x0, 0xcb,
|
||||||
|
0xbf, 0xd0, 0x1, 0xff, 0xd5,
|
||||||
|
|
||||||
|
/* U+72 "r" */
|
||||||
|
0xcf, 0x6, 0xdf, 0xe5, 0x0, 0x4c, 0x88, 0x82,
|
||||||
|
0x20, 0x3, 0xdf, 0xef, 0xa0, 0x2, 0xd0, 0x3,
|
||||||
|
0xca, 0x1, 0xff, 0xe9,
|
||||||
|
|
||||||
|
/* U+73 "s" */
|
||||||
|
0x0, 0x1d, 0xf7, 0xeb, 0x80, 0x49, 0x8a, 0xec,
|
||||||
|
0x11, 0x60, 0x9, 0xf, 0x99, 0x6a, 0x24, 0x1,
|
||||||
|
0x8, 0x5, 0x34, 0xc1, 0x61, 0xce, 0x60, 0x4a,
|
||||||
|
0x40, 0xd6, 0xb1, 0x9f, 0x44, 0x1, 0x25, 0xfd,
|
||||||
|
0xb2, 0xe0, 0x93, 0xa0, 0x1, 0x26, 0x42, 0xc7,
|
||||||
|
0x12, 0x20, 0x10, 0x80, 0x8a, 0xb, 0xe6, 0x2e,
|
||||||
|
0x9, 0x81, 0xe9, 0x59, 0xd9, 0xf0, 0x0,
|
||||||
|
|
||||||
|
/* U+74 "t" */
|
||||||
|
0x0, 0x99, 0xc0, 0x3f, 0x5c, 0x0, 0x7f, 0xf0,
|
||||||
|
0xe7, 0xfc, 0x41, 0xff, 0x83, 0x66, 0x42, 0x13,
|
||||||
|
0x38, 0x11, 0x98, 0x60, 0xcd, 0x80, 0x3f, 0xfd,
|
||||||
|
0x4c, 0x8, 0x1, 0xf7, 0x5, 0xd4, 0xd9, 0x80,
|
||||||
|
0x4b, 0x44, 0xac, 0xe0,
|
||||||
|
|
||||||
|
/* U+75 "u" */
|
||||||
|
0x3f, 0x80, 0xd, 0x1e, 0x80, 0x1f, 0xfe, 0x81,
|
||||||
|
0x0, 0xf8, 0x40, 0x3f, 0x88, 0x1c, 0x3, 0x28,
|
||||||
|
0x4, 0xe3, 0x6c, 0xfa, 0x60, 0x14, 0x41, 0x66,
|
||||||
|
0xae, 0x0, 0x0,
|
||||||
|
|
||||||
|
/* U+76 "v" */
|
||||||
|
0xd, 0xf0, 0xe, 0x1f, 0xc0, 0xa0, 0x50, 0xc,
|
||||||
|
0xe1, 0x40, 0xc1, 0xc0, 0x1a, 0x81, 0x80, 0x55,
|
||||||
|
0x4, 0x0, 0x26, 0xc0, 0x17, 0x3, 0x0, 0x18,
|
||||||
|
0x28, 0x2, 0x42, 0xa0, 0x5, 0x11, 0x80, 0x6a,
|
||||||
|
0x22, 0xd4, 0x1, 0xcc, 0x15, 0x40, 0x60, 0xe,
|
||||||
|
0x14, 0x65, 0x50, 0x80, 0x7b, 0xc4, 0xb8, 0x3,
|
||||||
|
0xe4, 0x11, 0x20, 0x4,
|
||||||
|
|
||||||
|
/* U+77 "w" */
|
||||||
|
0x6f, 0x20, 0x5, 0x58, 0x5, 0xf0, 0xa0, 0xe0,
|
||||||
|
0x4, 0x40, 0x0, 0xc3, 0x4c, 0x34, 0x8, 0x40,
|
||||||
|
0xc1, 0x41, 0x0, 0x88, 0xe, 0x24, 0x81, 0xc2,
|
||||||
|
0x20, 0x47, 0xc, 0x57, 0xc0, 0x35, 0x0, 0x79,
|
||||||
|
0x2, 0x66, 0x14, 0x14, 0xc0, 0xa, 0x8, 0x48,
|
||||||
|
0x81, 0x31, 0xc0, 0x1, 0x87, 0x1, 0x90, 0xd0,
|
||||||
|
0x28, 0x4, 0x6a, 0x80, 0x4, 0x71, 0x10, 0x4,
|
||||||
|
0xa1, 0x80, 0xc, 0x15, 0x0, 0xde, 0x6, 0x0,
|
||||||
|
0x40, 0xc0, 0x0,
|
||||||
|
|
||||||
|
/* U+78 "x" */
|
||||||
|
0x7f, 0x90, 0xc, 0xff, 0x40, 0xe8, 0xca, 0x0,
|
||||||
|
0x38, 0x2a, 0x0, 0x50, 0xd8, 0x87, 0x7, 0x0,
|
||||||
|
0x43, 0x43, 0x52, 0x50, 0x60, 0x19, 0x1d, 0x19,
|
||||||
|
0x1c, 0x3, 0xd2, 0x0, 0xf0, 0xf, 0xac, 0x1,
|
||||||
|
0x20, 0x1e, 0x65, 0x54, 0x94, 0x80, 0x62, 0x91,
|
||||||
|
0xa6, 0x46, 0x40, 0xb, 0x83, 0x40, 0x14, 0x34,
|
||||||
|
0x21, 0x6, 0xe6, 0x0, 0x1b, 0x1a, 0x0,
|
||||||
|
|
||||||
|
/* U+79 "y" */
|
||||||
|
0x1f, 0xe0, 0xf, 0x77, 0x88, 0x94, 0x54, 0x3,
|
||||||
|
0x28, 0xa8, 0x84, 0x87, 0x0, 0x6e, 0x9, 0x0,
|
||||||
|
0x19, 0x90, 0x80, 0x2, 0x86, 0x60, 0xa, 0x42,
|
||||||
|
0xc0, 0xc, 0x12, 0x1, 0x94, 0x98, 0x1, 0x22,
|
||||||
|
0xa0, 0x1d, 0x60, 0xc8, 0x32, 0x1, 0xe6, 0x1b,
|
||||||
|
0xe0, 0x60, 0xf, 0x98, 0x95, 0x84, 0x3, 0xe9,
|
||||||
|
0x0, 0x58, 0x7, 0xe1, 0x12, 0x10, 0x7, 0xe7,
|
||||||
|
0x1f, 0x0, 0xfc, 0x50, 0x48, 0x1, 0xe3, 0xac,
|
||||||
|
0xe, 0x0, 0xf9, 0x54, 0x76, 0x60, 0x1e,
|
||||||
|
|
||||||
|
/* U+7A "z" */
|
||||||
|
0x5f, 0xff, 0xc6, 0xef, 0xe5, 0x0, 0x11, 0x22,
|
||||||
|
0x39, 0xc2, 0x84, 0x3, 0xa8, 0x9d, 0x40, 0x39,
|
||||||
|
0x94, 0xe0, 0x3, 0x8e, 0x47, 0x40, 0x38, 0x74,
|
||||||
|
0x34, 0x40, 0x3a, 0x86, 0x4c, 0x3, 0xa1, 0x15,
|
||||||
|
0x80, 0x39, 0x1c, 0x9, 0xdf, 0x90, 0x80, 0xf,
|
||||||
|
0x11, 0xda,
|
||||||
|
|
||||||
|
/* U+7B "{" */
|
||||||
|
0x0, 0xc9, 0x92, 0x1, 0x1d, 0xb5, 0x80, 0x50,
|
||||||
|
0x14, 0x40, 0x12, 0x20, 0x3, 0x8, 0x7, 0xe1,
|
||||||
|
0x0, 0xc6, 0x1, 0xe4, 0xd, 0x0, 0x13, 0x41,
|
||||||
|
0x30, 0x3, 0xe4, 0xf0, 0x40, 0x12, 0xc5, 0x40,
|
||||||
|
0x12, 0x4c, 0x22, 0x80, 0x64, 0xc, 0x0, 0xc4,
|
||||||
|
0x6, 0x1, 0xe1, 0x0, 0xc2, 0xe, 0x1, 0xc6,
|
||||||
|
0x60, 0xe, 0x80, 0x90, 0xc, 0x94, 0xd4, 0x1,
|
||||||
|
0x97, 0xec,
|
||||||
|
|
||||||
|
/* U+7C "|" */
|
||||||
|
0xbb, 0x0, 0x7f, 0xf6, 0x0,
|
||||||
|
|
||||||
|
/* U+7D "}" */
|
||||||
|
0xac, 0x30, 0xd, 0xf, 0x86, 0x1, 0x15, 0x4,
|
||||||
|
0x80, 0x61, 0x24, 0x0, 0xe1, 0x10, 0x7, 0xff,
|
||||||
|
0x1, 0xc0, 0x40, 0x31, 0x82, 0x80, 0x69, 0x1a,
|
||||||
|
0x52, 0x0, 0xe, 0x5, 0x48, 0x5, 0xc2, 0xfe,
|
||||||
|
0x0, 0x73, 0x98, 0x40, 0x6, 0x3, 0x80, 0x67,
|
||||||
|
0x1, 0x0, 0xff, 0x84, 0x40, 0x18, 0x49, 0x40,
|
||||||
|
0x35, 0x4, 0x0, 0x58, 0xb6, 0x60, 0x16, 0xf2,
|
||||||
|
0x0, 0x60,
|
||||||
|
|
||||||
|
/* U+7E "~" */
|
||||||
|
0x3, 0xdf, 0xd5, 0x0, 0xcc, 0x63, 0xa6, 0xa7,
|
||||||
|
0x52, 0x0, 0x29, 0x57, 0x1f, 0xae, 0x56, 0xea,
|
||||||
|
0xc1, 0x64, 0xa1, 0x0, 0x54, 0x9a, 0x96, 0x0
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------
|
||||||
|
* GLYPH DESCRIPTION
|
||||||
|
*--------------------*/
|
||||||
|
|
||||||
|
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||||
|
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||||
|
{.bitmap_index = 0, .adv_w = 192, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 0, .adv_w = 192, .box_w = 3, .box_h = 15, .ofs_x = 4, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 13, .adv_w = 192, .box_w = 6, .box_h = 5, .ofs_x = 3, .ofs_y = 10},
|
||||||
|
{.bitmap_index = 26, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 110, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
|
||||||
|
{.bitmap_index = 193, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 269, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 346, .adv_w = 192, .box_w = 3, .box_h = 5, .ofs_x = 4, .ofs_y = 10},
|
||||||
|
{.bitmap_index = 353, .adv_w = 192, .box_w = 6, .box_h = 22, .ofs_x = 3, .ofs_y = -5},
|
||||||
|
{.bitmap_index = 413, .adv_w = 192, .box_w = 6, .box_h = 22, .ofs_x = 3, .ofs_y = -5},
|
||||||
|
{.bitmap_index = 472, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 5},
|
||||||
|
{.bitmap_index = 518, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 1},
|
||||||
|
{.bitmap_index = 543, .adv_w = 192, .box_w = 4, .box_h = 6, .ofs_x = 3, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 555, .adv_w = 192, .box_w = 8, .box_h = 2, .ofs_x = 2, .ofs_y = 6},
|
||||||
|
{.bitmap_index = 561, .adv_w = 192, .box_w = 4, .box_h = 3, .ofs_x = 4, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 567, .adv_w = 192, .box_w = 9, .box_h = 16, .ofs_x = 2, .ofs_y = -1},
|
||||||
|
{.bitmap_index = 617, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 689, .adv_w = 192, .box_w = 6, .box_h = 15, .ofs_x = 2, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 708, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 774, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 841, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 893, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 957, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1027, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1078, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1150, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1220, .adv_w = 192, .box_w = 4, .box_h = 11, .ofs_x = 5, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1237, .adv_w = 192, .box_w = 5, .box_h = 15, .ofs_x = 4, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 1265, .adv_w = 192, .box_w = 9, .box_h = 10, .ofs_x = 1, .ofs_y = 1},
|
||||||
|
{.bitmap_index = 1305, .adv_w = 192, .box_w = 10, .box_h = 6, .ofs_x = 1, .ofs_y = 4},
|
||||||
|
{.bitmap_index = 1322, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1},
|
||||||
|
{.bitmap_index = 1365, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1424, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1513, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1585, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1648, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1707, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1765, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1798, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1825, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1895, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1915, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1941, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 1975, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2035, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2050, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2101, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2149, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2216, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2262, .adv_w = 192, .box_w = 12, .box_h = 18, .ofs_x = 0, .ofs_y = -3},
|
||||||
|
{.bitmap_index = 2351, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2412, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2487, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2506, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2545, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2619, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2711, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2789, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2845, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 2899, .adv_w = 192, .box_w = 5, .box_h = 20, .ofs_x = 4, .ofs_y = -3},
|
||||||
|
{.bitmap_index = 2915, .adv_w = 192, .box_w = 8, .box_h = 16, .ofs_x = 2, .ofs_y = -1},
|
||||||
|
{.bitmap_index = 2963, .adv_w = 192, .box_w = 5, .box_h = 20, .ofs_x = 3, .ofs_y = -3},
|
||||||
|
{.bitmap_index = 2979, .adv_w = 192, .box_w = 8, .box_h = 8, .ofs_x = 2, .ofs_y = 7},
|
||||||
|
{.bitmap_index = 3010, .adv_w = 192, .box_w = 10, .box_h = 2, .ofs_x = 1, .ofs_y = -1},
|
||||||
|
{.bitmap_index = 3016, .adv_w = 192, .box_w = 4, .box_h = 3, .ofs_x = 4, .ofs_y = 12},
|
||||||
|
{.bitmap_index = 3022, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3074, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3125, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3176, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3230, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3280, .adv_w = 192, .box_w = 11, .box_h = 16, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3325, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 3392, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3424, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3459, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 2, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 3493, .adv_w = 192, .box_w = 11, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3541, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3566, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3595, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3623, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3677, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 3733, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 3786, .adv_w = 192, .box_w = 8, .box_h = 11, .ofs_x = 3, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3806, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3861, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3897, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3924, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 3976, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 4043, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 4098, .adv_w = 192, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 4169, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||||
|
{.bitmap_index = 4211, .adv_w = 192, .box_w = 7, .box_h = 20, .ofs_x = 3, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 4269, .adv_w = 192, .box_w = 2, .box_h = 19, .ofs_x = 5, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 4274, .adv_w = 192, .box_w = 7, .box_h = 20, .ofs_x = 3, .ofs_y = -4},
|
||||||
|
{.bitmap_index = 4332, .adv_w = 192, .box_w = 12, .box_h = 4, .ofs_x = 0, .ofs_y = 4}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*---------------------
|
||||||
|
* CHARACTER MAPPING
|
||||||
|
*--------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*Collect the unicode lists and glyph_id offsets*/
|
||||||
|
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
|
||||||
|
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------
|
||||||
|
* ALL CUSTOM DATA
|
||||||
|
*--------------------*/
|
||||||
|
|
||||||
|
/*Store all the custom data of the font*/
|
||||||
|
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||||
|
.glyph_bitmap = gylph_bitmap,
|
||||||
|
.glyph_dsc = glyph_dsc,
|
||||||
|
.cmaps = cmaps,
|
||||||
|
.kern_dsc = NULL,
|
||||||
|
.kern_scale = 0,
|
||||||
|
.cmap_num = 1,
|
||||||
|
.bpp = 4,
|
||||||
|
.kern_classes = 0,
|
||||||
|
.bitmap_format = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*-----------------
|
||||||
|
* PUBLIC FONT
|
||||||
|
*----------------*/
|
||||||
|
|
||||||
|
/*Initialize a public general font descriptor*/
|
||||||
|
lv_font_t font_3 = {
|
||||||
|
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
|
||||||
|
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
|
||||||
|
.line_height = 22, /*The maximum line height required by the font*/
|
||||||
|
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||||
|
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||||
|
.subpx = LV_FONT_SUBPX_NONE,
|
||||||
|
#endif
|
||||||
|
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /*#if FONT_3*/
|
||||||
|
|
||||||
@@ -23,6 +23,63 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
static lv_fs_res_t open_cb(struct _lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode)
|
||||||
|
{
|
||||||
|
(void) drv;
|
||||||
|
(void) mode;
|
||||||
|
|
||||||
|
FILE * fp = fopen(path, "rb"); // only reading is supported
|
||||||
|
|
||||||
|
*((FILE **)file_p) = fp;
|
||||||
|
return NULL == fp ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static lv_fs_res_t close_cb(struct _lv_fs_drv_t * drv, void * file_p)
|
||||||
|
{
|
||||||
|
(void) drv;
|
||||||
|
|
||||||
|
FILE * fp = *((FILE **) file_p);
|
||||||
|
fclose(fp);
|
||||||
|
return LV_FS_RES_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static lv_fs_res_t read_cb(struct _lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br)
|
||||||
|
{
|
||||||
|
(void) drv;
|
||||||
|
|
||||||
|
FILE * fp = *((FILE **) file_p);
|
||||||
|
*br = fread(buf, 1, btr, fp);
|
||||||
|
return (*br <= 0) ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static lv_fs_res_t seek_cb(struct _lv_fs_drv_t * drv, void * file_p, uint32_t pos)
|
||||||
|
{
|
||||||
|
(void) drv;
|
||||||
|
|
||||||
|
FILE * fp = *((FILE **) file_p);
|
||||||
|
fseek (fp, pos, SEEK_SET);
|
||||||
|
|
||||||
|
return LV_FS_RES_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static lv_fs_res_t tell_cb(struct _lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p)
|
||||||
|
{
|
||||||
|
(void) drv;
|
||||||
|
|
||||||
|
FILE * fp = *((FILE **) file_p);
|
||||||
|
*pos_p = ftell(fp);
|
||||||
|
|
||||||
|
return LV_FS_RES_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ready_cb(struct _lv_fs_drv_t * drv)
|
||||||
|
{
|
||||||
|
(void) drv;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void hal_init(void)
|
static void hal_init(void)
|
||||||
{
|
{
|
||||||
static lv_disp_buf_t disp_buf;
|
static lv_disp_buf_t disp_buf;
|
||||||
@@ -35,8 +92,23 @@ static void hal_init(void)
|
|||||||
disp_drv.buffer = &disp_buf;
|
disp_drv.buffer = &disp_buf;
|
||||||
disp_drv.flush_cb = dummy_flush_cb;
|
disp_drv.flush_cb = dummy_flush_cb;
|
||||||
lv_disp_drv_register(&disp_drv);
|
lv_disp_drv_register(&disp_drv);
|
||||||
}
|
|
||||||
|
|
||||||
|
#if LV_USE_FILESYSTEM
|
||||||
|
lv_fs_drv_t drv;
|
||||||
|
lv_fs_drv_init(&drv); /*Basic initialization*/
|
||||||
|
|
||||||
|
drv.letter = 'f'; /*An uppercase letter to identify the drive */
|
||||||
|
drv.file_size = sizeof(FILE *); /*Size required to store a file object*/
|
||||||
|
drv.ready_cb = ready_cb; /*Callback to tell if the drive is ready to use */
|
||||||
|
drv.open_cb = open_cb; /*Callback to open a file */
|
||||||
|
drv.close_cb = close_cb; /*Callback to close a file */
|
||||||
|
drv.read_cb = read_cb; /*Callback to read a file */
|
||||||
|
drv.seek_cb = seek_cb; /*Callback to seek in a file (Move cursor) */
|
||||||
|
drv.tell_cb = tell_cb; /*Callback to tell the cursor position */
|
||||||
|
|
||||||
|
lv_fs_drv_register(&drv); /*Finally register the drive*/
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
|
static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user