changeset 102992:64cdf8a83bdd

(xftfont_has_char): Special handling of `ja' and `ko' adstyle.
author Kenichi Handa <handa@m17n.org>
date Thu, 16 Apr 2009 01:38:35 +0000
parents 18e317a87f12
children 2e2d289b5f6a
files src/xftfont.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xftfont.c	Thu Apr 16 01:38:07 2009 +0000
+++ b/src/xftfont.c	Thu Apr 16 01:38:35 2009 +0000
@@ -467,16 +467,28 @@
     }
 }
 
+extern Lisp_Object Qja, Qko;
+
 static int
 xftfont_has_char (font, c)
      Lisp_Object font;
      int c;
 {
   struct xftfont_info *xftfont_info;
+  struct charset *cs = NULL;
 
   if (FONT_ENTITY_P (font))
     return ftfont_driver.has_char (font, c);
 
+  if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qja)
+      && charset_jisx0208 >= 0)
+    cs = CHARSET_FROM_ID (charset_jisx0208);
+  else if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qko)
+      && charset_ksc5601 >= 0)
+    cs = CHARSET_FROM_ID (charset_ksc5601);
+  if (cs)
+    return (ENCODE_CHAR (cs, c) != CHARSET_INVALID_CODE (cs));
+
   xftfont_info = (struct xftfont_info *) XFONT_OBJECT (font);
   return (XftCharExists (xftfont_info->display, xftfont_info->xftfont,
 			 (FcChar32) c) == FcTrue);