summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorali <ali198724@gmail.com>2019-07-29 20:18:37 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-07-31 10:54:55 -0700
commit32cffb4494c46fa3705062c8e43294bf8f5eca87 (patch)
treeaf920b99b04ae43933f10f98d5b841523edc80eb /src/tests
parent6d0f51412626b13e495a3eed559880b1266403f7 (diff)
evas_textblock: change font-size/font-family only using EFL.Text.Font Interface
Currently: User cannot change font size only, he needs to set both font and font size with (**efl_text_font_font_set**) To change size only, you need to make two calls, one to get font (**efl_text_font_font_get**) , then pass it again with new size to (**efl_text_font_font_set**). New Behaviour: If user want to change size only, then he passes NULL as font argument to keep same font. If user want to change font only, then he passes 0 as font-size argument, to keep same font-size. Notes: This is not best solution, but it better than current behaviour. I think best solution to have separate function to set font size, but It might break current api or duplicate functions. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9158
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/evas/evas_test_textblock.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index dc3f22d136..ef81ae3172 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4654,6 +4654,35 @@ EFL_START_TEST(efl_canvas_text_markup)
4654} 4654}
4655EFL_END_TEST 4655EFL_END_TEST
4656 4656
4657EFL_START_TEST(efl_text_font)
4658{
4659 START_EFL_CANVAS_TEXT_TEST();
4660
4661 efl_text_set(txt, "\n\n\n");
4662
4663 const char * font;
4664 int font_size;
4665 efl_text_font_set(txt, "Sans", 20);
4666 efl_text_font_set(txt, NULL, 0);
4667
4668 efl_text_font_get(txt, &font, &font_size);
4669 fail_if(20 != font_size);
4670 fail_if(strcmp(font,"Sans"));
4671
4672 efl_text_font_set(txt, NULL, 30);
4673 efl_text_font_get(txt, &font, &font_size);
4674 fail_if(30 != font_size);
4675 fail_if(strcmp(font,"Sans"));
4676
4677 efl_text_font_set(txt, "arial", 0);
4678 efl_text_font_get(txt, &font, &font_size);
4679 fail_if(30 != font_size);
4680 fail_if(strcmp(font,"arial"));
4681
4682 END_EFL_CANVAS_TEXT_TEST();
4683}
4684EFL_END_TEST
4685
4657void evas_test_textblock(TCase *tc) 4686void evas_test_textblock(TCase *tc)
4658{ 4687{
4659 tcase_add_test(tc, evas_textblock_simple); 4688 tcase_add_test(tc, evas_textblock_simple);
@@ -4686,5 +4715,6 @@ void evas_test_textblock(TCase *tc)
4686 tcase_add_test(tc, efl_text); 4715 tcase_add_test(tc, efl_text);
4687 tcase_add_test(tc, efl_canvas_text_cursor); 4716 tcase_add_test(tc, efl_canvas_text_cursor);
4688 tcase_add_test(tc, efl_canvas_text_markup); 4717 tcase_add_test(tc, efl_canvas_text_markup);
4718 tcase_add_test(tc, efl_text_font);
4689} 4719}
4690 4720