Evas Text: parse font string everytime for updating lang properly
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 18 Aug 2016 10:33:08 +0000 (13:33 +0300)
committerDaniel Hirt <daniel.hirt@samsung.com>
Thu, 18 Aug 2016 10:33:08 +0000 (13:33 +0300)
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

src/lib/evas/canvas/evas_object_text.c

index 2e4a418..b5c79a2 100644 (file)
@@ -420,18 +420,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))