Font Question "Text"

Description

I used the font converted by “Font Converter”. As a result, when the font is displayed, the white “Text” that I did not draw is displayed in the upper left corner of the string. I don’t know how to remove it.

What MCU/Processor/Board and compiler are you using?

ARM

What do you want to achieve?

I want to remove the white “Text”.

What have you tried so far?

I tried to use the default font and found that there is still a white “Text”. This is not a problem with “Font Converter”. I found in lv_label.c that when the label is created, copy==NULL will automatically fill the label. “Text” character, I think my program has a logical error, but I did not find out where?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*typedef struct
{
lv_obj_t * par_obj;
lv_coord_t width; 
lv_coord_t height; 
lv_style_t style;

Str_t power;
}Self_Check_t;

void Init_Self_Check_param(Self_Check_t * Self_Check, lv_coord_t width, lv_coord_t height)
{
Self_Check->par_obj = lv_obj_create(lv_scr_act(), NULL);
Self_Check->width = width;
Self_Check->height = height;
lv_obj_set_size(Self_Check->par_obj, width, height);

lv_style_copy(&Self_Check->style, &lv_style_plain);
Self_Check->style.text.color = LV_COLOR_RED;
Self_Check->style.text.font  = &simsong_33px;

Self_Check->power.label      = lv_label_create(Self_Check->par_obj, NULL);

Self_Check->power.str_pass  = Self_Check_str[0];
Self_Check->power.str_fail  = Self_Check_str[1];
Self_Check->power.alignment = LV_ALIGN_IN_RIGHT_MID;
Self_Check->power.x_mod = 0;	
Self_Check->power.y_mod = 0;	
}

void Self_Test_Display (Self_Check_t * Self_Check, uint8_t info)
{
switch(info)
{
case POWER_TEST_PASS:
my_draw_text (Self_Check->par_obj, &Self_Check->style, &Self_Check->power, Self_Check->power.str_pass);
break;
case POWER_TEST_FAIL:
my_draw_text (Self_Check->par_obj, &Self_Check->style, &Self_Check->power, Self_Check->power.str_fail);
break;
default:break;
}
}

void my_draw_text (lv_obj_t * par, lv_style_t * style, Str_t * label_obj, char * str)
{
lv_obj_t * label = NULL;
if(mul_line_flag == true)
{
label = lv_label_create(par, NULL);
/Modify the Label’s text/
lv_label_set_text(label, str);
lv_label_set_style(label,LV_LABEL_STYLE_MAIN,style);
/* Align the Label to the center
* NULL means align on parent (which is the screen now)
* 0, 0 at the end means an x, y offset after alignment*/
lv_obj_align(label, par, label_obj->alignment, label_obj->x_mod, label_obj->y_mod);

}
else
{
	/*Modify the Label's text*/
	lv_label_set_text(label_obj->label, str);
	lv_label_set_style(label_obj->label,LV_LABEL_STYLE_MAIN,style);
	/* Align the Label to the center
	 * NULL means align on parent (which is the screen now)
	 * 0, 0 at the end means an x, y offset after alignment*/
	lv_obj_align(label_obj->label, par, label_obj->alignment, label_obj->x_mod, label_obj->y_mod); 

}
}
*/

label.c

/*
    ......
    ......
 /*Init the new label*/
    if(copy == NULL) {
        lv_obj_set_click(new_label, false);
        lv_label_set_long_mode(new_label, LV_LABEL_LONG_EXPAND);
        lv_label_set_text(new_label, "Text");
        lv_label_set_style(new_label, LV_LABEL_STYLE_MAIN, NULL); /*Inherit parent's style*/
    }
    /*Copy 'copy' if not NULL*/
    else {
    ......
*/

Screenshot and/or video


If possible, add screenshots and/or videos about the current state.

I found this problem, I created too many label objects but no assignments, so the default assignment is “Text”.