changeset 101640:6a674ba1901f

(xftfont_has_char): New function. (syms_of_xftfont): Register xftfont_has_char in xftfont_driver.
author Kenichi Handa <handa@m17n.org>
date Thu, 29 Jan 2009 12:13:47 +0000
parents 789d88174e93
children 1f841b676a2c
files src/xftfont.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xftfont.c	Thu Jan 29 10:38:16 2009 +0000
+++ b/src/xftfont.c	Thu Jan 29 12:13:47 2009 +0000
@@ -144,6 +144,7 @@
 static void xftfont_close P_ ((FRAME_PTR, struct font *));
 static int xftfont_prepare_face P_ ((FRAME_PTR, struct face *));
 static void xftfont_done_face P_ ((FRAME_PTR, struct face *));
+static int xftfont_has_char P_ ((Lisp_Object, int));
 static unsigned xftfont_encode_char P_ ((struct font *, int));
 static int xftfont_text_extents P_ ((struct font *, unsigned *, int,
 				     struct font_metrics *));
@@ -466,6 +467,21 @@
     }
 }
 
+static int
+xftfont_has_char (font, c)
+     Lisp_Object font;
+     int c;
+{
+  struct xftfont_info *xftfont_info;
+
+  if (FONT_ENTITY_P (font))
+    return ftfont_driver.has_char (font, c);
+
+  xftfont_info = (struct xftfont_info *) XFONT_OBJECT (font);
+  return (XftCharExists (xftfont_info->display, xftfont_info->xftfont,
+			 (FcChar32) c) == FcTrue);
+}
+
 static unsigned
 xftfont_encode_char (font, c)
      struct font *font;
@@ -604,6 +620,7 @@
   xftfont_driver.close = xftfont_close;
   xftfont_driver.prepare_face = xftfont_prepare_face;
   xftfont_driver.done_face = xftfont_done_face;
+  xftfont_driver.has_char = xftfont_has_char;
   xftfont_driver.encode_char = xftfont_encode_char;
   xftfont_driver.text_extents = xftfont_text_extents;
   xftfont_driver.draw = xftfont_draw;