tasn pushed a commit to branch evas-1.7.

commit 6309aaf3b49243268df4d45282db678bc29b5d2f
Author: Tom Hacohen <[email protected]>
Date:   Mon Apr 8 13:38:09 2013 +0100

    Evas font: Fixed a bug with cluster sizes and ligatures.
    
    This casused cursor position (among other things) to look wrong with
    texts ending with ligatures.
    
    Thanks to Yakov Goldberg for reporting.
---
 ChangeLog                             |  5 +++++
 NEWS                                  |  2 ++
 src/lib/engines/common/evas_font_ot.c |  2 +-
 src/tests/evas_test_textblock.c       | 21 +++++++++++++++++++++
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 94c916e..93b60b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1249,3 +1249,8 @@
 2013-04-05  Cedric Bail
 
        * Fix over redrawing of Evas_Map when applied on smart object.
+
+2013-04-04 Tom Hacohen
+
+        * Evas font: Fix a bug with cluster size calculation with texts ending
+       with ligatures.
diff --git a/NEWS b/NEWS
index 67a7364..71ac35f 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Changes since Evas 1.7.6:
 
 Fixes:
    * Fix over redrawing of Evas_Map when applied on smart object.
+   * Evas font: Fix a bug with cluster size calculation with texts ending
+   with ligatures.
 
 Evas 1.7.6
 
diff --git a/src/lib/engines/common/evas_font_ot.c 
b/src/lib/engines/common/evas_font_ot.c
index 9ed92c7..9fcf6bb 100644
--- a/src/lib/engines/common/evas_font_ot.c
+++ b/src/lib/engines/common/evas_font_ot.c
@@ -166,7 +166,7 @@ evas_common_font_ot_cluster_size_get(const Evas_Text_Props 
*props, size_t char_i
      }
    else
      {
-        if (right_bound >= (int) (props->text_offset + props->text_len))
+        if (right_bound >= (int) (props->start + props->len))
           {
              items = props->text_offset + props->text_len - base_cluster;
           }
diff --git a/src/tests/evas_test_textblock.c b/src/tests/evas_test_textblock.c
index 7df767b..e6ac41b 100644
--- a/src/tests/evas_test_textblock.c
+++ b/src/tests/evas_test_textblock.c
@@ -598,6 +598,27 @@ START_TEST(evas_textblock_cursor)
         fail_if(1 != evas_textblock_cursor_pos_get(cur));
      }
 
+   /* Make sure coords are correct for ligatures */
+     {
+        evas_object_textblock_text_markup_set(tb, "fi<br/>fii");
+
+        for (i = 0 ; i < 2 ; i++)
+          {
+             evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
+             ck_assert_int_eq(w, 3);
+             evas_textblock_cursor_char_next(cur);
+          }
+
+        evas_textblock_cursor_char_next(cur);
+
+        for (i = 0 ; i < 3 ; i++)
+          {
+             evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
+             ck_assert_int_eq(w, 3);
+             evas_textblock_cursor_char_next(cur);
+          }
+     }
+
    END_TB_TEST();
 }
 END_TEST

-- 

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

Reply via email to