changeset 95291:5ad7b7aaa2a5

(face_for_char): Optimize for the case of no charset property.
author Kenichi Handa <handa@m17n.org>
date Sun, 25 May 2008 11:02:11 +0000
parents e3e5f8759ca5
children fb55eb329b54
files src/fontset.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fontset.c	Sun May 25 11:00:52 2008 +0000
+++ b/src/fontset.c	Sun May 25 11:02:11 2008 +0000
@@ -908,6 +908,17 @@
 	  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))
     {