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

Support for lvgl v9 #96

Closed
stwirth opened this issue Jan 7, 2024 · 2 comments · Fixed by #97
Closed

Support for lvgl v9 #96

stwirth opened this issue Jan 7, 2024 · 2 comments · Fixed by #97

Comments

@stwirth
Copy link

stwirth commented Jan 7, 2024

I'm seeing this definition in fonts included in the lvgl repo master branch:

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t lv_font_montserrat_18 = {
#else
lv_font_t lv_font_montserrat_18 = {
#endif
    .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 = 21,          /*The maximum line height required by the font*/
    .base_line = 4,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -1,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};

However, when I generate a font using this repo (npx github:lvgl/lv_font_conv ...) then the definition looks like this:

/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t inter_tight_bold_18 = {
#else
lv_font_t inter_tight_bold_18 = {
#endif
    .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 = 23,          /*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
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -3,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};

So it seems the generation of the version check needs an update?

@stwirth
Copy link
Author

stwirth commented Jan 7, 2024

I'm also getting

error: unknown type name ‘lv_font_fmt_txt_glyph_cache_t’
 2348 | static  lv_font_fmt_txt_glyph_cache_t cache;
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is there a version of this converter that supports the master version of lvgl?

@kisvegabor
Copy link
Member

Thank you for reporting it. I've just created this PR: #97 Could you test it?

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 a pull request may close this issue.

2 participants