Evas font: Added support for weight/width/slant font tags.

This let's you set those directly, instead of using the style tag.
This commit is contained in:
Tom Hacohen 2014-01-29 14:10:40 +00:00
parent 22813f5b52
commit 2cb9db171e
1 changed files with 13 additions and 1 deletions

View File

@ -466,11 +466,23 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name)
if (!strncmp(name, ":style=", 7))
{
#define _SET_STYLE(x) \
fdesc->x = _evas_font_style_find_internal(name + 7, tend, \
fdesc->x = _evas_font_style_find_internal(name + strlen(#x) + 2, tend, \
_style_##x##_map, _STYLE_MAP_LEN(_style_##x##_map));
_SET_STYLE(slant);
_SET_STYLE(weight);
_SET_STYLE(width);
}
else if (!strncmp(name, ":slant=", 7))
{
_SET_STYLE(slant);
}
else if (!strncmp(name, ":weight=", 8))
{
_SET_STYLE(weight);
}
else if (!strncmp(name, ":width=", 7))
{
_SET_STYLE(width);
#undef _SET_STYLE
}
else if (!strncmp(name, ":lang=", 6))