Canvas text: favor font name parsing over set properties

Since font names can also specify styles like weight, width etc, we
should parse the font name AFTER setting the respective properties to
the font description, so it can override some if required.

This allows, for example, the following operation:

efl_text_font_weight_set(obj, EFL_TEXT_FONT_WEIGHT_NORMAL);
efl_text_font_set(obj, "Sans:Bold");

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Daniel Hirt 2017-10-08 14:00:24 +03:00 committed by Cedric BAIL
parent cf345cff74
commit a80209a59e
1 changed files with 1 additions and 1 deletions

View File

@ -3385,7 +3385,6 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt,
}
fmt->font.fdesc = evas_font_desc_new();
evas_font_name_parse(fmt->font.fdesc, _FMT_INFO(font));
eina_stringshare_replace(&(fmt->font.fdesc->lang),
evas_font_lang_normalize("auto"));
eina_stringshare_replace(&(fmt->font.fdesc->fallbacks),
@ -3396,6 +3395,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt,
fmt->font.fdesc->slant = _FMT_INFO(font_slant);
fmt->font.fdesc->width = _FMT_INFO(font_width);
fmt->font.fdesc->lang = _FMT_INFO(font_lang);
evas_font_name_parse(fmt->font.fdesc, _FMT_INFO(font));
fmt->font.font = evas_font_load(evas_obj->layer->evas->font_path,
evas_obj->layer->evas->hinting,
fmt->font.fdesc,