Page MenuHomePhabricator

Middle Ellipsis (value = 0.5) in RTL Arabic does not work as expected
Open, Incoming QueuePublic

Description

Steps to produce:

  1. Run the code below.
  2. Decrement the window size gradually by dragging the window edge towards the center.

Issue:
Ellipsis does not occur in the middle and at the final steps, the middle character is removed and the remaining word is "نم" which consists of the first and the last characters.

Note:
Please check the GIFs to compare between the behavior in Arabic and in English.

Code:

#include <Elementary.h>


EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
   Evas_Object *win;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   win = elm_win_util_standard_add("ellipsis-test", "ellipsis-test");
   elm_win_autodel_set(win, EINA_TRUE);

   evas_object_resize(win, 320, 320);

   Evas_Object *box;
   box = elm_box_add(win);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_win_resize_object_add(win, box);
 
   Evas_Object *entry;
   entry = elm_entry_add(box);
   elm_entry_text_style_user_push(entry, "DEFAULT='font_size=40 wrap=word ellipsis=0.5'");
   //elm_entry_entry_set(entry, "<font='Arial'>Fellow</><font='Sans'> </><font='Arial'>Fellow</>");
   elm_entry_entry_set(entry, "نعم نعم");
   evas_object_resize(entry, 39,67);
   
   elm_entry_cursor_end_set(entry);
   Evas_Textblock_Cursor * cur = evas_object_textblock_cursor_get(elm_entry_textblock_get(entry));
   evas_textblock_cursor_word_start(cur);
   

   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);

   elm_box_pack_end(box, entry);

   evas_object_show(entry);
   evas_object_show(box);
   evas_object_show(win);

   elm_run();
   return 0;
}
ELM_MAIN()

Sara created this task.Jul 23 2020, 12:32 AM
Sara added a comment.Jul 29 2020, 1:24 AM

Behavior in QT

Sara added a comment.Jul 29 2020, 3:37 AM

Behavior in Android