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

Default fonts not clear on red background #6232

Closed
keerthansys22 opened this issue May 16, 2024 · 4 comments
Closed

Default fonts not clear on red background #6232

keerthansys22 opened this issue May 16, 2024 · 4 comments

Comments

@keerthansys22
Copy link

keerthansys22 commented May 16, 2024

LVGL version

v8.3

What happened?

I’m using default lvgl fonts - montserrat in my screens. While displaying white fonts on red background, there is no clarity and readability. But if the same white fonts displayed on green background, it is displaying perfectly fine.

I have tried changing the shades of the red background but no major impact on readability.

@liamHowatt
Copy link
Collaborator

Could you please send screenshots/pictures? Or even better, a code snippet to reproduce the issue? If you're using one of the special drawing backends there might be a blending issue with the red color channel specifically. Are you using dave2d, nxp, renesas or any other special drawing backend? Anything else exceptional about your configuration that might be a factor?

image
image

(on v8.3)

static void red_green_font(void)
{
    lv_obj_set_style_bg_color(lv_scr_act(), lv_palette_main(LV_PALETTE_RED), 0);
    lv_obj_t * lab = lv_label_create(lv_scr_act());
    lv_obj_set_style_text_font(lab, &lv_font_montserrat_48, 0);
    lv_obj_set_style_text_color(lab, lv_color_white(), 0);
    lv_label_set_text(lab, "Lorem Ipsum");
    lv_obj_center(lab);
}

@keerthansys22
Copy link
Author

keerthansys22 commented May 20, 2024

Thanks for your response @liamHowatt, I have attached the snapshot below:-

image

I have not used any special drawing backends for this case. Infact, I'm using the same font on green background and its clear.


lv_obj_t* screenmain = lv_obj_create(NULL);
lv_obj_set_style_bg_color(screenmain, lv_color_hex(0xf800), LV_PART_MAIN);
lv_obj_t* label3 = lv_label_create(screenmain);
lv_label_set_long_mode(label3, LV_LABEL_LONG_SCROLL_CIRCULAR);   
lv_obj_set_size(label3, 120, 13);
lv_label_set_text_static(label3, "Scrolling details........................");
// lv_obj_set_style_text_font(label3, &lv_font_montserrat_12, LV_PART_MAIN);
lv_obj_set_style_text_color(label3, lv_color_white(), LV_PART_MAIN);  

@keerthansys22
Copy link
Author

Hi @liamHowatt,

I tried enabling this option in lv_config.h file - /Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)/
#define LV_COLOR_16_SWAP 1

It’s working now and the fonts are more clear and readable. Thanks for your help.

@liamHowatt
Copy link
Collaborator

Nice! 🙂

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

No branches or pull requests

2 participants