summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAbdullehGhujeh <abdullahhasan10@gmail.com>2020-06-22 17:02:05 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-06-22 17:02:05 +0900
commitc43630c22aa103798211c82a383213062ca98b82 (patch)
tree8887a684cb14ffeafc5063771e67979ae2440819 /src/lib
parent1bbd03b7683dc6f163fff94130d017367178d0f1 (diff)
evas textblock : update font source when it set using font_source_set
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() Reviewers: ali.alzyod, woohyun, bowonryu, cedric Reviewed By: ali.alzyod Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11757
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 0889de197d..7c18f8c175 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -4343,6 +4343,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt,
4343 fmt->font.fdesc->weight = _FMT_INFO(font_weight); 4343 fmt->font.fdesc->weight = _FMT_INFO(font_weight);
4344 fmt->font.fdesc->slant = _FMT_INFO(font_slant); 4344 fmt->font.fdesc->slant = _FMT_INFO(font_slant);
4345 fmt->font.fdesc->width = _FMT_INFO(font_width); 4345 fmt->font.fdesc->width = _FMT_INFO(font_width);
4346 eina_stringshare_replace(&(fmt->font.source), _FMT_INFO(font_source));
4346 evas_font_name_parse(fmt->font.fdesc, _FMT_INFO(font)); 4347 evas_font_name_parse(fmt->font.fdesc, _FMT_INFO(font));
4347 fmt->font.font = evas_font_load(evas_obj->layer->evas->font_path, 4348 fmt->font.font = evas_font_load(evas_obj->layer->evas->font_path,
4348 evas_obj->layer->evas->hinting, 4349 evas_obj->layer->evas->hinting,