Compare commits

...

3 Commits

Author SHA1 Message Date
hydevcode
bcf844b3a9 chore(env_support/rt-thread): fix build break (#6933) 2024-10-14 10:47:11 +02:00
Gabor Kiss-Vamosi
09d9aaa846 chore: kick CI to rebuild the docs 2024-04-23 16:29:58 +02:00
liamHowatt
ecbd2ba4cd feat(font): add lv_font_glyph_release_draw_data api to release glyph data (#6052)
Co-authored-by: Benign X <1341398182@qq.com>
2024-04-10 14:43:50 +08:00
7 changed files with 20 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ jobs:
with:
repository: szepeviktor/astyle
path: astyle
ref: v3.4.10
- name: Install astyle
run: |
cd astyle/build/gcc/

View File

@@ -114,7 +114,6 @@ See some examples of creating widgets, using layouts and applying styles. You wi
For more examples check out the [Examples](https://github.com/lvgl/lvgl/tree/master/examples) folder.
### Hello world label
![Simple Hello world label example in LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_1.png)

View File

@@ -24,6 +24,7 @@ lvgl_cwd = cwd + '/../../'
lvgl_src_cwd = lvgl_cwd + 'src/'
inc = inc + [lvgl_src_cwd]
src = src + Glob(os.path.join(lvgl_src_cwd,'*.c'))
for root, dirs, files in os.walk(lvgl_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)

View File

@@ -13,8 +13,6 @@
#ifdef __RTTHREAD__
#include <lvgl.h>
#define LV_RTTHREAD_INCLUDE <rtthread.h>
#include LV_RTTHREAD_INCLUDE

View File

@@ -438,8 +438,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
dsc->g = &g;
cb(draw_unit, dsc, NULL, NULL);
if(g.resolved_font && font->release_glyph) {
font->release_glyph(font, &g);
}
lv_font_glyph_release_draw_data(&g);
LV_PROFILER_END;
}

View File

@@ -50,6 +50,15 @@ const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, uint32_t lett
return font_p->get_glyph_bitmap(g_dsc, letter, draw_buf);
}
void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc)
{
const lv_font_t * font = g_dsc->resolved_font;
if(font != NULL && font->release_glyph) {
font->release_glyph(font, g_dsc);
}
}
bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
uint32_t letter_next)
{

View File

@@ -133,6 +133,13 @@ const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, uint32_t lett
bool lv_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
uint32_t letter_next);
/**
* Release the bitmap of a font.
* @note You must call @lv_font_get_glyph_dsc to get @g_dsc (@lv_font_glyph_dsc_t) before you can call this function.
* @param g_dsc the glyph descriptor including which font to use, which supply the glyph_index and the format.
*/
void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc);
/**
* Get the width of a glyph with kerning
* @param font pointer to a font