How to make the font to Center

Description

Why my font dont move to Center?

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

F746

What do you want to achieve?

move font to center

What have you tried so far?

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:

lv_coord_t hres = lv_disp_get_hor_res(NULL);
    lv_coord_t vres = lv_disp_get_ver_res(NULL);
	
    tabview = lv_tabview_create(lv_scr_act(), NULL);
    lv_tabview_set_btns_hidden(tabview, true);
    lv_tabview_set_sliding(tabview, false);

    /* Screen 1 */
    lv_obj_t * scr1 = lv_tabview_add_tab(tabview, "scr1");
		lv_obj_set_size(scr1, hres, vres);
    lv_page_set_style(scr1, LV_PAGE_STYLE_BG, &lv_style_transp_fit);
    lv_page_set_style(scr1, LV_PAGE_STYLE_SCRL, &lv_style_transp);
    lv_page_set_scrl_layout(scr1, LV_LAYOUT_OFF);
		
    wp = lv_img_create(scr1, NULL);
    lv_obj_set_protect(wp, LV_PROTECT_PARENT);          /*Don't let to move the wallpaper by the layout */
    lv_obj_set_parent(wp, scr1);
    lv_obj_set_parent(lv_page_get_scrl(scr1), scr1);
    lv_img_set_src(wp, &M848_01);
    lv_obj_set_size(wp, hres, vres);
    lv_obj_set_pos(wp, 0, 0);
    lv_obj_set_hidden(wp, false);
    lv_img_set_style(wp, LV_IMG_STYLE_MAIN, &lv_style_plain);
    lv_img_set_auto_size(wp, false);
		
		lv_obj_t * btn;
//    lv_obj_t * btn = lv_btn_create(scr1, NULL);
//		lv_obj_set_pos(btn, 10, 10);
//    lv_obj_set_user_data(btn, (lv_obj_user_data_t)1); /* Store the next screen ID in user data */
//    lv_obj_set_event_cb(btn, btn_event_cb);
//    lv_obj_t * label = lv_label_create(btn, NULL);
//    lv_label_set_text(label, "Flip to Screen 2");
		
		lv_obj_t * imgbtn1 = lv_imgbtn_create(scr1, NULL);
    lv_obj_set_pos(imgbtn1, 36, 342);
    lv_imgbtn_set_toggle(imgbtn1, true);

    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_REL, &I848_01);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_PR, &I848_02);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_TGL_REL, &I848_02);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_TGL_PR, &I848_01);
		//image btn 2
		imgbtn1 = lv_imgbtn_create(scr1, NULL);
    lv_obj_set_pos(imgbtn1, 220, 342);
    lv_imgbtn_set_toggle(imgbtn1, true);

    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_REL, &I848_03);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_PR, &I848_04);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_TGL_REL, &I848_04);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_TGL_PR, &I848_03);
		
		//image btn 3
		imgbtn1 = lv_imgbtn_create(scr1, NULL);
    lv_obj_set_pos(imgbtn1, 404, 342);
    lv_imgbtn_set_toggle(imgbtn1, true);

    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_REL, &I848_05);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_PR, &I848_06);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_TGL_REL, &I848_06);
    lv_imgbtn_set_src(imgbtn1, LV_BTN_STATE_TGL_PR, &I848_05);
		
		lv_obj_t * imgbtn4 = lv_imgbtn_create(scr1, NULL);
    lv_obj_set_pos(imgbtn4, 588, 342);
    lv_imgbtn_set_toggle(imgbtn4, true);
    lv_obj_set_user_data(imgbtn4, (lv_obj_user_data_t)1); /* Store the next screen ID in user data */
    lv_obj_set_event_cb(imgbtn4, btn_event_cb);
		
    lv_imgbtn_set_src(imgbtn4, LV_BTN_STATE_REL, &I848_07);
    lv_imgbtn_set_src(imgbtn4, LV_BTN_STATE_PR, &I848_08);
    lv_imgbtn_set_src(imgbtn4, LV_BTN_STATE_TGL_REL, &I848_08);
    lv_imgbtn_set_src(imgbtn4, LV_BTN_STATE_TGL_PR, &I848_07);
		
		/*Create a style and use the new font*/
    static lv_style_t style1;
    lv_style_copy(&style1, &lv_style_plain);
    style1.text.font = &roboto_60; /*Set the base font whcih is concatenated with the others*/
    style1.text.color = LV_COLOR_RED;
		
    /*Create a label and set new text*/
lv_obj_t * label = lv_label_create(scr1, NULL);   
lv_label_set_style(label, LV_LABEL_STYLE_MAIN, &style1);
lv_obj_set_pos(label, 218, 162);
lv_obj_set_size(label, 300, 100);
//		lv_obj_set_protect(label, LV_PROTECT_NONE);
lv_label_set_text(label, "24.5");      /*Use ASCII and Cyrillic letters together*/
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
		/***************************Screen 2 Start*******************************8/
    /* Screen 2 */
    lv_obj_t * scr2 = lv_tabview_add_tab(tabview, "scr2");
		lv_obj_set_size(scr2, hres, vres);
    lv_page_set_style(scr2, LV_PAGE_STYLE_BG, &lv_style_transp_fit);
    lv_page_set_style(scr2, LV_PAGE_STYLE_SCRL, &lv_style_transp);
    lv_page_set_scrl_layout(scr2, LV_LAYOUT_OFF);
		/*Set Screen 2 WP*/
		tabview2wp = lv_img_create(scr2, NULL);
    lv_obj_set_protect(tabview2wp, LV_PROTECT_PARENT);          /*Don't let to move the wallpaper by the layout */
    lv_obj_set_parent(tabview2wp, scr2);
    lv_obj_set_parent(lv_page_get_scrl(scr2), scr2);
    lv_img_set_src(tabview2wp, &M848_03);
    lv_obj_set_size(tabview2wp, hres, vres);
    lv_obj_set_pos(tabview2wp, 0, 0);
    lv_obj_set_hidden(tabview2wp, false);
    lv_img_set_style(tabview2wp, LV_IMG_STYLE_MAIN, &lv_style_plain);
    lv_img_set_auto_size(tabview2wp, false);
		
    btn = lv_btn_create(scr2, NULL);
		lv_obj_set_pos(btn, 100, 100);
    lv_obj_set_user_data(btn, (lv_obj_user_data_t)0); /* Store the next screen ID in user data */
    lv_obj_set_event_cb(btn, btn_event_cb);
    label = lv_label_create(btn, NULL);
    lv_label_set_text(label, "Flip to Screen 1");

static lv_style_t style1;
lv_style_copy(&style1, &lv_style_plain);
style1.text.font = &roboto_60; /Set the base font whcih is concatenated with the others/
style1.text.color = LV_COLOR_RED;

/*Create a label and set new text*/

lv_obj_t * label = lv_label_create(scr1, NULL);
lv_label_set_style(label, LV_LABEL_STYLE_MAIN, &style1);
lv_obj_set_pos(label, 218, 162);
lv_obj_set_size(label, 300, 100);
// lv_obj_set_protect(label, LV_PROTECT_NONE);
lv_label_set_text(label, “24.5”); /Use ASCII and Cyrillic letters together/
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);

Screenshot and/or video

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

lv_label_set_align just aligns the text within the label (this makes more sense if you think about a label with multiple lines of differing lengths). You also need to call lv_obj_align to align the label object to the center of the screen.