Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See issue https://github.com/lvgl/lv_font_conv/issues/120 #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pavmick
Copy link

@pavmick pavmick commented Sep 5, 2024

In LVGL export format, avoid storing duplicate bitmap data for identical glyphs. Instead, reference existing bitmap data.

In LVGL export format, avoid storing duplicate bitmap data for identical glyphs. Instead, reference existing bitmap data.
@pavmick pavmick marked this pull request as ready for review September 6, 2024 12:38
@kisvegabor
Copy link
Member

Could you give an example font the parameters for the conversation to test it?

@pavmick
Copy link
Author

pavmick commented Sep 12, 2024

lv_font_conv --bpp 2 --size 24 --format lvgl --font arial.ttf -r 0x40-0x43 -r 0x410-0x413 -o arial24.c
I did some testing, it's looking good.

@kisvegabor
Copy link
Member

Thanks! Working here too:


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 = 390, .box_w = 23, .box_h = 23, .ofs_x = 1, .ofs_y = -5},
    {.bitmap_index = 122, .adv_w = 256, .box_w = 18, .box_h = 18, .ofs_x = -1, .ofs_y = 0},
    {.bitmap_index = 191, .adv_w = 256, .box_w = 14, .box_h = 18, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 238, .adv_w = 277, .box_w = 16, .box_h = 18, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 122, .adv_w = 256, .box_w = 18, .box_h = 18, .ofs_x = -1, .ofs_y = 0}, //Reused
    {.bitmap_index = 300, .adv_w = 252, .box_w = 14, .box_h = 18, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 191, .adv_w = 256, .box_w = 14, .box_h = 18, .ofs_x = 1, .ofs_y = 0}, //Reused
    {.bitmap_index = 336, .adv_w = 208, .box_w = 12, .box_h = 18, .ofs_x = 1, .ofs_y = 0}
};

@kisvegabor
Copy link
Member

cc @puzrin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants