Evas textblock: Added font_width to markup.

SVN revision: 61937
This commit is contained in:
Tom Hacohen 2011-08-01 08:20:59 +00:00
parent 9ba3e192a5
commit b3995dfc6c
2 changed files with 16 additions and 1 deletions

View File

@ -443,3 +443,9 @@
* Textblock: Added font_weight and font_style formats.
These format allow overriding the font style set using:
font=':style=Bold'.
2011-07-31 Tom Hacohen (TAsn)
* Textblock: Added font_width.
This allows overriding the font width set using:
font=':style=Condensed'

View File

@ -991,6 +991,7 @@ static const char *font_sizestr = NULL;
static const char *font_sourcestr = NULL;
static const char *font_weightstr = NULL;
static const char *font_stylestr = NULL;
static const char *font_widthstr = NULL;
static const char *colorstr = NULL;
static const char *underline_colorstr = NULL;
static const char *underline2_colorstr = NULL;
@ -1034,6 +1035,7 @@ _format_command_init(void)
font_sourcestr = eina_stringshare_add("font_source");
font_weightstr = eina_stringshare_add("font_weight");
font_stylestr = eina_stringshare_add("font_style");
font_widthstr = eina_stringshare_add("font_width");
colorstr = eina_stringshare_add("color");
underline_colorstr = eina_stringshare_add("underline_color");
underline2_colorstr = eina_stringshare_add("underline2_color");
@ -1080,6 +1082,7 @@ _format_command_shutdown(void)
eina_stringshare_del(font_sourcestr);
eina_stringshare_del(font_weightstr);
eina_stringshare_del(font_stylestr);
eina_stringshare_del(font_widthstr);
eina_stringshare_del(colorstr);
eina_stringshare_del(underline_colorstr);
eina_stringshare_del(underline2_colorstr);
@ -1152,7 +1155,8 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char
_format_clean_param(tmp_param, param);
/* If we are changing the font, create the fdesc. */
if ((cmd == font_weightstr) || (cmd == font_stylestr) || (cmd == fontstr))
if ((cmd == font_weightstr) || (cmd == font_widthstr) ||
(cmd == font_stylestr) || (cmd == fontstr))
{
if (!fmt->font.fdesc)
{
@ -1212,6 +1216,11 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char
fmt->font.fdesc->slant = evas_font_style_find(tmp_param,
tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_SLANT);
}
if (cmd == font_widthstr)
{
fmt->font.fdesc->width = evas_font_style_find(tmp_param,
tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_WIDTH);
}
else if (cmd == colorstr)
_format_color_parse(tmp_param,
&(fmt->color.normal.r), &(fmt->color.normal.g),