From b831d3c1e114c40f5f5a9c8f309b032028c769e3 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 18 May 2011 11:18:08 +0000 Subject: [PATCH] Evas font-engine: Fix searching of fonts to ignore more control characters. SVN revision: 59499 --- .../src/lib/engines/common/evas_text_utils.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/legacy/evas/src/lib/engines/common/evas_text_utils.c b/legacy/evas/src/lib/engines/common/evas_text_utils.c index 6938634207..f12a685f71 100644 --- a/legacy/evas/src/lib/engines/common/evas_text_utils.c +++ b/legacy/evas/src/lib/engines/common/evas_text_utils.c @@ -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;