diff src/fontset.c @ 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 993b2f1f702e
children f472b6b1baa8
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))
     {