On Wed, Jul 28, 2010 at 7:59 PM, Tom Hacohen
<tom.haco...@partner.samsung.com> wrote:
> Hi all,
>
> Although the commit (and log) gives enough information by itself, I
> decided to write this post to further clarify the subject.
>
> This commit changed the font engine, textblock object and text object to
> use Eina_Unicode instead of utf8 internally. This commit does not affect
> API in any way (except for engine writing API which is pretty internal).
> There are a couple of reasons for this commit:
> 1. With utf8 you can't jump to specific string indexes for example: the
> 4th letter of a string.
> 2. All the internal font functions already work with Unicode code
> points, so we had to convert encodings all the time.
> 3. The BiDi algorithm in general and fribidi in specific, require the
> text to be encoded in Unicode because jumping between text positions,
> resolving visual<->logical indexes and reordering letters are pretty
> common there.
> 4. This cleaned the code quite a lot, because retrieving specific
> indexes was now made easier.
>
> In this commit I also started relying on the "new" FriBiDi version
> (0.19.2 which was released an year and a half ago) as implied in my
> previous mail about BiDi.
>
> This commit also includes a bit of renaming, evas_intl_* got renamed to
> evas_bidi_*, evas_common_font_utf8_* got renamed to
> evas_common_encoding_utf8_* (the previous ones still exist but marked as
> deprecated).
>
> Currently, the changes I did in the font engine are pretty clean, though
> I can't say same about the textblock object. In the textblock object I
> still do stuff as if the string is stored in utf8, that is, I still kept
> the current design and didn't do any major changes (that change flow too
> dramatically). The code works, and it's not uglier than it was, it's
> just not a clean as it will be once I get over with it. I had to commit
> now in order to allow raster to "uncrustify" everything, let other
> people continue to work on other parts of Evas without a merging hell,
> and because it's better than how it was.
>
> I will overhaul the textblock object in the following weeks (hopefully
> will do a small API breaking commit tomorrow in order to make get it in
> efl 1.0) and after that will redesign textblock to work more naturally
> with unicode.
>
> I did a lot of testing, but I still can't be sure everything works ok,
> to me it seemed that everything is exactly as it was except for the bugs
> I fixed. If you find anything fishy, please let me know. Sorry for the
> big commit, but it includes many interdependent changes. It's also time
> to mention I did *not* test on Mac OS/Windows/Exotic engines, although I
> did modify the code where needed, I can't assure it works there, so
> again, if you find anything, drop me an email.
>
> If you have any questions, please let me know,
> Tom.

Hello Tom,

I can confirm this commit breaks evas text handling for Chinese characters.
Please find the attached file for reproducing the problem.

I reverted evas to r50594 and elm_entry_cursor_content_get() works properly.
Then I tried r50595 evas, which is this svn commit, it fails.  Chinese
characters are returned with garbage bytes appended.
Any ideas what went wrong?  I am happy to help test more.

Thanks.


brian

>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



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

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

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
#include <Elementary.h>

static void _entry_retrieve_clicked_word(Evas_Object *obj)
{
        const char *content;

        while ((content = elm_entry_cursor_content_get(obj))) {
                if (!content[0])
                        break;
                printf("Content: '%s'\n", content);
                if (!elm_entry_cursor_next(obj))
                        break;
        }
}

static void _entry_clicked(void *data, Evas_Object *obj, void *event_info)
{
        printf("%s in\n", __FUNCTION__);

        _entry_retrieve_clicked_word(obj);
}

/* if someone presses the close button on our window - exit nicely */
static void
win_del(void *data, Evas_Object *obj, void *event_info)
{
   /* cleanly exit */
   elm_exit();
}

EAPI int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *bx, *en;

   win = elm_win_add(NULL, "dialog", ELM_WIN_BASIC);
   evas_object_smart_callback_add(win, "delete-request", win_del, NULL);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   bx = elm_box_add(win);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   en = elm_entry_add(win);
   elm_entry_line_wrap_set(en, 1);
   elm_entry_line_char_wrap_set(en, 1);
   elm_entry_editable_set(en, 0);
   elm_object_scale_set(en, 1.6);
#if 1
   /* Chinese + English */
   elm_entry_entry_set(en, "中英混合 english mixed with chinese");
#else
   elm_entry_entry_set(en, "english mixed with chinese");
#endif
   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(bx, en);
   evas_object_show(en);
   elm_entry_editable_set(en, 0);

   evas_object_smart_callback_add(en, "clicked", _entry_clicked, NULL);

   /* show the window */
   evas_object_show(win);
   evas_object_resize(win, 320, 240);

   /* get going and draw/respond to the user */
   elm_run();
   /* standard shutdown */
   elm_shutdown();
   /* return/exit code of app signals ok/cancel (0 == ok), (-1 == cancel) */
   return 0;
}
ELM_MAIN()
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to