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 assert in lv_font.c #2533

Merged
merged 1 commit into from Sep 6, 2021
Merged

add assert in lv_font.c #2533

merged 1 commit into from Sep 6, 2021

Conversation

guoweilkd
Copy link
Contributor

@guoweilkd guoweilkd commented Sep 6, 2021

Description of the feature or fix

A clear and concise description of what the bug or new feature is.

Checkpoints

@kisvegabor
Copy link
Member

It seems like a reasonable update but I'm curious where did you see any issues due to it?

@guoweilkd
Copy link
Contributor Author

guoweilkd commented Sep 6, 2021

Opening fonts with freetype may fail (e.g. .ttf file does not exist). But the user does not judge the return value。eg:https://github.com/lvgl/lv_lib_freetype/blob/master/README.md

/Create a font/
static lv_ft_info_t info;
info.name = "./lv_lib_freetype/arial.ttf";
info.weight = 16;
info.style = FT_FONT_STYLE_NORMAL;
lv_ft_font_init(&info);

/Create style with the new font/
static lv_style_t style;
lv_style_init(&style);
lv_style_set_text_font(&style, info.font);

@kisvegabor
Copy link
Member

Seems fair. I merge it, thank you!

@kisvegabor kisvegabor merged commit a6527b0 into lvgl:master Sep 6, 2021
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.

None yet

2 participants