]> git.eshelyaron.com Git - emacs.git/commitdiff
(face_for_char): Optimize for the case of no charset property.
authorKenichi Handa <handa@m17n.org>
Sun, 25 May 2008 11:02:11 +0000 (11:02 +0000)
committerKenichi Handa <handa@m17n.org>
Sun, 25 May 2008 11:02:11 +0000 (11:02 +0000)
src/fontset.c

index bafe1ca22559df0663bdbdb89372d715e54e2cbb..c61bcae88af1e4ab49443a8ac47fa1058f7b2371 100644 (file)
@@ -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))
     {