summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c1
-rw-r--r--src/tests/evas/evas_test_textblock.c32
-rw-r--r--src/tests/evas/fonts/TestFontSource.eetbin0 -> 3742912 bytes
3 files changed, 33 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,
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index e56b1d3912..440d405105 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -27,6 +27,7 @@ _evas_textblock_format_offset_get(const Evas_Object_Textblock_Node_Format *n);
27/* end of functions defined in evas_object_textblock.c */ 27/* end of functions defined in evas_object_textblock.c */
28 28
29#define TEST_FONT "font=DejaVuSans,UnDotum,malayalam font_source=" TESTS_SRC_DIR "/fonts/TestFont.eet" 29#define TEST_FONT "font=DejaVuSans,UnDotum,malayalam font_source=" TESTS_SRC_DIR "/fonts/TestFont.eet"
30#define TEST_FONT_SOURCE TESTS_SRC_DIR "/fonts/TestFontSource.eet"
30 31
31static const char *style_buf = 32static const char *style_buf =
32 "DEFAULT='" TEST_FONT " font_size=10 color=#000 text_class=entry'" 33 "DEFAULT='" TEST_FONT " font_size=10 color=#000 text_class=entry'"
@@ -5075,6 +5076,36 @@ EFL_START_TEST(efl_text_markup)
5075} 5076}
5076EFL_END_TEST 5077EFL_END_TEST
5077 5078
5079EFL_START_TEST(efl_text_font_source)
5080{
5081 START_EFL_CANVAS_TEXTBLOCK_TEST();
5082
5083 Eina_Size2D size1, size2;
5084
5085 efl_canvas_textblock_style_apply(txt,"\tfont_size=30\t");
5086 efl_text_markup_set(txt, "Hello, This Text Use The Font : Does_Not_Exists_Font");
5087
5088 efl_text_font_family_set(txt, "Does_Not_Exists_Font_1");
5089 size1 = efl_canvas_textblock_size_native_get(txt);
5090
5091 efl_text_font_source_set(txt, TEST_FONT_SOURCE);
5092 efl_text_font_family_set(txt, "Does_Not_Exists_Font_1");
5093 size2 = efl_canvas_textblock_size_native_get(txt);
5094 ck_assert_int_ne(size1.w, size2.w);
5095
5096 efl_text_font_source_set(txt, "");
5097 efl_text_font_family_set(txt, "Does_Not_Exists_Font_2");
5098 size1 = efl_canvas_textblock_size_native_get(txt);
5099
5100 efl_text_font_source_set(txt, TEST_FONT_SOURCE);
5101 efl_text_font_family_set(txt, "Does_Not_Exists_Font_2");
5102 size2 = efl_canvas_textblock_size_native_get(txt);
5103 ck_assert_int_ne(size1.w, size2.w);
5104
5105 END_EFL_CANVAS_TEXTBLOCK_TEST();
5106}
5107EFL_END_TEST
5108
5078void evas_test_textblock(TCase *tc) 5109void evas_test_textblock(TCase *tc)
5079{ 5110{
5080 tcase_add_test(tc, evas_textblock_simple); 5111 tcase_add_test(tc, evas_textblock_simple);
@@ -5115,5 +5146,6 @@ void evas_test_textblock(TCase *tc)
5115 tcase_add_test(tc, efl_canvas_textblock_style); 5146 tcase_add_test(tc, efl_canvas_textblock_style);
5116 tcase_add_test(tc, efl_text_style); 5147 tcase_add_test(tc, efl_text_style);
5117 tcase_add_test(tc, efl_text_markup); 5148 tcase_add_test(tc, efl_text_markup);
5149 tcase_add_test(tc, efl_text_font_source);
5118} 5150}
5119 5151
diff --git a/src/tests/evas/fonts/TestFontSource.eet b/src/tests/evas/fonts/TestFontSource.eet
new file mode 100644
index 0000000000..082fd956e1
--- /dev/null
+++ b/src/tests/evas/fonts/TestFontSource.eet
Binary files differ