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

Add fallback cli option #87

Closed
kutu opened this issue Mar 11, 2023 · 4 comments · Fixed by #102
Closed

Add fallback cli option #87

kutu opened this issue Mar 11, 2023 · 4 comments · Fixed by #102

Comments

@kutu
Copy link

kutu commented Mar 11, 2023

Currently const lv_font_t my_font is const, and fallback field can only be assigned by editing my_font.c directly.

after this line

const lv_font_t ${f.font_name} = {

add

.fallback = &lv_font_montserrat_12,

where lv_font_montserrat_12 will be fallback cli option

@kisvegabor
Copy link
Member

It's really useful. @puzrin?

@puzrin
Copy link
Collaborator

puzrin commented Mar 13, 2023

I dont' track current state of lvgl. Is .fallback something specific to new version?

@kutu
Copy link
Author

kutu commented Mar 13, 2023

https://docs.lvgl.io/8.3/overview/font.html#use-font-fallback
I started with lvgl8.3, so I don't know how old this option is

if I try to assign fallback option like in docs

my_font.fallback = &lv_font_montserrat_12;

I got error

Cannot assign to variable 'my_font' with const-qualified type 'const lv_font_t' (aka 'const struct _lv_font_t') ​clang(typecheck_assign_const)

@kisvegabor
Copy link
Member

It was added in v8.2.

neuschaefer added a commit to neuschaefer/lv_font_conv that referenced this issue Mar 13, 2024
neuschaefer added a commit to neuschaefer/lv_font_conv that referenced this issue Mar 13, 2024
neuschaefer added a commit to neuschaefer/lv_font_conv that referenced this issue Mar 14, 2024
Note that the fallback font is declared extern in the generated file.
This is done so that it's possible to use fallback fonts that are not
declared in LVGL's headers.

Fixes: lvgl#87
neuschaefer added a commit to neuschaefer/lv_font_conv that referenced this issue Mar 14, 2024
Note that the fallback font is declared extern in the generated file.
This is done so that it's possible to use fallback fonts that are not
declared in LVGL's headers.

Fixes: lvgl#87
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.

3 participants