Page MenuHomePhabricator

evas textblock : update font source when it set using font_source_set
ClosedPublic

Authored by AbdullehGhujeh on Apr 27 2020, 12:29 AM.

Details

Summary

when we set font source, for example with efl_text_font_source_set, the font source will not be updated in the textblock.

this is have same results that has been done in D9548

Test Plan
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1

#include <Efl_Ui.h>

static void
_gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
   efl_exit(0);
}

static Eo *
_create_label(Eo *win, Eo *bx)
{
   Eo *en;
   en = efl_add(EFL_UI_TEXTBOX_CLASS, win);
   printf("Added Efl.Ui.Text object\n");
   efl_text_interactive_editable_set(en, EINA_FALSE);
   efl_pack(bx, en);
   return en;
}

static void
_gui_setup()
{
   char buf[512], f_buf[512];
   Eo *win, *bx;

   win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
               efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
               efl_text_set(efl_added, "Hello World"),
               efl_ui_win_autodel_set(efl_added, EINA_TRUE));

   // when the user clicks "close" on a window there is a request to delete
   efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);

   bx = efl_add(EFL_UI_BOX_CLASS, win,
               efl_content_set(win, efl_added),
               efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240)));

   snprintf(buf, sizeof(buf), "./TestFontSource.eet");

   Eo *en = _create_label(win, bx);
   efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_1 : Source + Font Name");
   efl_text_font_source_set(en, buf);
   efl_text_font_family_set(en, "Does_Not_Exists_Font_1");
   efl_text_font_size_set(en, 35);

   en = _create_label(win, bx);
   efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_1 : Font Name");
   efl_text_font_family_set(en, "Does_Not_Exists_Font_1");
   efl_text_font_size_set(en, 35);

   en = _create_label(win, bx);
   efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_2 : Source + Font Name");
   efl_text_font_source_set(en, buf);
   efl_text_font_family_set(en, "Does_Not_Exists_Font_2");
   efl_text_font_size_set(en, 35);

   en = _create_label(win, bx);
   efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_2 : Font Name");
   efl_text_font_family_set(en, "Does_Not_Exists_Font_2");
   efl_text_font_size_set(en, 35);
}

EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
   _gui_setup();
}
EFL_MAIN()

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

AbdullehGhujeh requested review of this revision.Apr 27 2020, 12:29 AM
AbdullehGhujeh edited the summary of this revision. (Show Details)Apr 27 2020, 12:33 AM
AbdullehGhujeh edited the test plan for this revision. (Show Details)
AbdullehGhujeh added a reviewer: ali.alzyod.
ali.alzyod added inline comments.Apr 27 2020, 4:01 AM
src/tests/evas/evas_test_textblock.c
5099

ck_assert

5105

ck_assert

5118

ck_assert

AbdullehGhujeh marked 3 inline comments as done.Apr 28 2020, 12:35 AM
ali.alzyod edited the summary of this revision. (Show Details)
ali.alzyod accepted this revision.Jun 11 2020, 12:19 AM

This seems fine to me

This revision is now accepted and ready to land.Jun 11 2020, 12:19 AM
This revision was automatically updated to reflect the committed changes.