Hello list,

Edje's text chopping code seems to be mixing up the usage of UTF-8
character index with Unicode character index.  This causes Chinese
text strings to be cut off at the very beginning leaving lots of
spaces following the elipsis.

Please see the patch for the fix/hack.  And it's not a properly patch
since my own comment is not removed.

Thanks in advance.


brian

-- 
brian
------------------

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
Index: edje/src/lib/edje_text.c
===================================================================
--- edje/src/lib/edje_text.c    (revision 53139)
+++ edje/src/lib/edje_text.c    (working copy)
@@ -161,6 +161,28 @@
    if ((c1 == 0) && (c2 == 0))
      return text;
 
+   /* coolbrian: convert c1 and c2 to utf8 pos */
+   {
+          int i;
+          int pos;
+
+          if (c1 > 0) {
+                  pos = 0;
+                  for (i = 0 ; i < c1; i++) {
+                               pos += evas_string_char_len_get(text + pos);
+                  }
+                  c1 = pos;
+          }
+
+          if (c2 > 0) {
+                  pos = 0;
+                  for (i = 0 ; i < c2; i++) {
+                               pos += evas_string_char_len_get(text + pos);
+                  }
+                  c2 = pos;
+          }
+   }
+
    orig_len = strlen(text);
 
    /* don't overflow orig_len by adding extra
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to