From b59e66b393afdc75407760b86deb61968cde07e1 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sun, 25 May 2008 11:02:11 +0000 Subject: [PATCH] (face_for_char): Optimize for the case of no charset property. --- src/fontset.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fontset.c b/src/fontset.c index bafe1ca2255..c61bcae88af 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -908,6 +908,17 @@ face_for_char (f, face, c, pos, object) id = XINT (CHARSET_SYMBOL_ID (charset)); } } + if (id < 0) + { + struct font *font = face->ascii_face->font; + + if (font && font->driver->encode_char (font, c) != FONT_INVALID_CODE) + return face->ascii_face->id; + font = face->font; + if (font && font->driver->encode_char (font, c) != FONT_INVALID_CODE) + return face->id; + } + rfont_def = fontset_font (fontset, c, face, id); if (VECTORP (rfont_def)) { -- 2.39.2