tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2cb9db171ead5bc9920234e27c2e12b7c7b3883a

commit 2cb9db171ead5bc9920234e27c2e12b7c7b3883a
Author: Tom Hacohen <[email protected]>
Date:   Wed Jan 29 14:10:40 2014 +0000

    Evas font: Added support for weight/width/slant font tags.
    
    This let's you set those directly, instead of using the style tag.
---
 src/lib/evas/canvas/evas_font_dir.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_font_dir.c 
b/src/lib/evas/canvas/evas_font_dir.c
index d258232..51db3ad 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -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))

-- 


Reply via email to