Evas font-engine: Move, rename and make *_text_font_style_match static.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Apr 2011 10:55:59 +0000 (10:55 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Apr 2011 10:55:59 +0000 (10:55 +0000)
It's only really used (and will ever be used) in a very specific place,
no need to put it in a place that's visible to all the lib.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58627 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_font_dir.c
src/lib/engines/common/evas_text_utils.c
src/lib/engines/common/evas_text_utils.h

index c011887..a0c4b9f 100644 (file)
@@ -254,6 +254,45 @@ evas_load_fontconfig(Evas *evas, FcFontSet *set, int size,
 }
 #endif
 
+static Eina_Bool
+_font_style_name_match(const char *font_name, const char *style_name)
+{
+   char *style_key = NULL;
+
+   if (!font_name) return EINA_FALSE;
+   if (!style_name) return EINA_FALSE;
+   style_key = strchr(font_name, ':');
+   if (!style_key) return EINA_FALSE;
+   if (strlen(style_key) > 2) style_key++;
+   if (strstr(style_key, "style="))
+     {
+        if (!strcmp(style_name, "Italic"))
+          {
+             if (strstr(style_key, "Italic")
+                 || strstr(style_key, "italic")
+                 || strstr(style_key, "Cursiva")
+                 || strstr(style_key, "cursiva"))
+                return EINA_TRUE;
+             else
+                return EINA_FALSE;
+          }
+        else if (!strcmp(style_name, "Bold"))
+          {
+             if (strstr(style_key, "Bold")
+                 || strstr(style_key, "bold")
+                 || strstr(style_key, "Negreta")
+                 || strstr(style_key, "negreta"))
+                return EINA_TRUE;
+             else
+                return EINA_FALSE;
+          }
+        else
+           return EINA_FALSE;
+     }
+   else
+      return EINA_FALSE;
+}
+
 struct _FcPattern {   
    int             num;
    int             size;
@@ -275,9 +314,9 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
    char *nm;
    Font_Rend_Flags wanted_rend = 0;
 
-   if (evas_common_text_font_style_match(name, "Italic"))
+   if (_font_style_name_match(name, "Italic"))
       wanted_rend |= FONT_REND_ITALIC;
-   if (evas_common_text_font_style_match(name, "Bold"))
+   if (_font_style_name_match(name, "Bold"))
       wanted_rend |= FONT_REND_BOLD;
 
    if (!name) return NULL;
index 67c3fb2..8cd5ccc 100644 (file)
@@ -384,43 +384,3 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
    return EINA_TRUE;
 }
 
-Eina_Bool
-evas_common_text_font_style_match(const char *font_name, const char *style_name)
-{
-   char *style_key = NULL;
-
-   if (!font_name) return EINA_FALSE;
-   if (!style_name) return EINA_FALSE;
-   style_key = strchr(font_name, ':');
-   if (!style_key) return EINA_FALSE;
-   if (strlen(style_key) > 2) style_key++;
-   if (strstr(style_key, "style="))
-     {
-        if (!strcmp(style_name, "Italic"))
-          {
-             if (strstr(style_key, "Italic")
-                 || strstr(style_key, "italic")
-                 || strstr(style_key, "Cursiva")
-                 || strstr(style_key, "cursiva"))
-                return EINA_TRUE;
-             else
-                return EINA_FALSE;
-          }
-        else if (!strcmp(style_name, "Bold"))
-          {
-             if (strstr(style_key, "Bold")
-                 || strstr(style_key, "bold")
-                 || strstr(style_key, "Negreta")
-                 || strstr(style_key, "negreta"))
-                return EINA_TRUE;
-             else
-                return EINA_FALSE;
-          }
-        else
-           return EINA_FALSE;
-     }
-   else
-      return EINA_FALSE;
-}
-
-
index 6144ce4..76efa14 100644 (file)
@@ -78,7 +78,4 @@ evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,
 EAPI void
 evas_common_text_props_merge(Evas_Text_Props *item1, const Evas_Text_Props *item2);
 
-Eina_Bool
-evas_common_text_font_style_match(const char *font_name, const char *style_name);
-
 #endif