Evas font-engine: Fix searching of fonts to ignore more control characters.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 18 May 2011 11:18:08 +0000 (11:18 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 18 May 2011 11:18:08 +0000 (11:18 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@59499 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_text_utils.c

index 6938634..f12a685 100644 (file)
@@ -225,9 +225,21 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
              text_props->script) ;
              base_char++)
            ;
-        if (!*base_char && (base_char > text)) base_char--;
+        if (!*base_char) base_char = text;
 
-        evas_common_font_glyph_search(fn, &fi, *base_char);
+        /* Find the first renderable char, and if there is none, find
+         * one that can show the replacement char. */
+        while (*base_char)
+          {
+             /* 0x1F is the last ASCII contral char. */
+             if ((*base_char > 0x1F) &&
+                   evas_common_font_glyph_search(fn, &fi, *base_char))
+                break;
+             base_char++;
+          }
+
+        if (!*base_char)
+           evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR);
      }
 
    text_props->font_instance = fi;