From 27cc4497e6d954fb2e8f62de609d80867b9a8f6c Mon Sep 17 00:00:00 2001 From: tasn Date: Mon, 1 Aug 2011 08:20:59 +0000 Subject: [PATCH] Evas textblock: Added font_width to markup. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61937 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 6 ++++++ src/lib/canvas/evas_object_textblock.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 245f181..57116a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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' diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index a686321..daf56af 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -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), -- 2.7.4