Evas Text: parse font string everytime for updating lang properly 44/84444/2
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 18 Aug 2016 10:33:08 +0000 (13:33 +0300)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 18 Aug 2016 13:30:47 +0000 (06:30 -0700)
Summary:
We can't assume the given font is same with current fdesc by comparing string.
Since Evas starts to supporting "auto" for language,
the given font string should be parsed once before comparing it.
@fix

Test Plan: N/A

Reviewers: tasn, raster, cedric, herdsman

Subscribers: jpeg, minudf, z-wony, Blackmole, woohyun

Differential Revision: https://phab.enlightenment.org/D4227

Change-Id: I764fb623309a64632970090d900cdf96331c1046
Signed-off-by: Youngbok Shin <youngb.shin@samsung.com>
src/lib/evas/canvas/evas_object_text.c

index 05516d9..6b86d63 100644 (file)
@@ -419,18 +419,15 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha
    if ((!font) || (size <= 0)) return;
 
    evas_object_async_block(obj);
-   if (!(o->cur.font && !strcmp(font, o->cur.font)))
-     {
-        fdesc = evas_font_desc_new();
 
-        /* Set default language according to locale. */
-        eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize("auto"));
-        evas_font_name_parse(fdesc, font);
-     }
-   else
-     {
-        fdesc = evas_font_desc_ref(o->cur.fdesc);
-     }
+   /* We can't assume the given font is same with current fdesc by comparing string.
+      Since Evas starts to supporting "auto" for language,
+      the given font string should be parsed once before comparing it. */
+   fdesc = evas_font_desc_new();
+
+   /* Set default language according to locale. */
+   eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize("auto"));
+   evas_font_name_parse(fdesc, font);
 
    if (o->cur.fdesc && !evas_font_desc_cmp(fdesc, o->cur.fdesc) &&
        (size == o->cur.size))