emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100115: Fix incorrect font metric


From: Kenichi Handa
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100115: Fix incorrect font metrics when the same font is opened with different pixelsizes.
Date: Fri, 15 Oct 2010 17:01:41 +0900
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100115 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: emacs-23
timestamp: Fri 2010-10-15 17:01:41 +0900
message:
  Fix incorrect font metrics when the same font is opened with different 
pixelsizes.
modified:
  src/ChangeLog
  src/xftfont.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-10-13 14:07:28 +0000
+++ b/src/ChangeLog     2010-10-15 07:49:11 +0000
@@ -1,3 +1,12 @@
+2010-10-15  Kenichi Handa  <address@hidden>
+
+       Fix incorrect font metrics when the same font is opened with
+       different pixelsizes.
+
+       * xftfont.c: Include composite.h.
+       (xftfont_shape): New function.
+       (syms_of_xftfont): Set xftfont_driver.shape.
+
 2010-10-13  Damyan Pepper  <address@hidden>
 
        Fix handling of font properties on Windows (bug#6303).

=== modified file 'src/xftfont.c'
--- a/src/xftfont.c     2010-06-30 14:22:18 +0000
+++ b/src/xftfont.c     2010-10-15 07:49:11 +0000
@@ -32,6 +32,7 @@
 #include "blockinput.h"
 #include "character.h"
 #include "charset.h"
+#include "composite.h"
 #include "fontset.h"
 #include "font.h"
 #include "ftfont.h"
@@ -702,6 +703,23 @@
   return len;
 }
 
+Lisp_Object
+xftfont_shape (Lisp_Object lgstring)
+{
+  struct font *font;
+  struct xftfont_info *xftfont_info;
+  FT_Face ft_face;
+  Lisp_Object val;
+
+  CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
+  xftfont_info = (struct xftfont_info *) font;
+  ft_face = XftLockFace (xftfont_info->xftfont);
+  xftfont_info->ft_size = ft_face->size;
+  val = ftfont_driver.shape (lgstring);
+  XftUnlockFace (xftfont_info->xftfont);
+  return val;
+}
+
 static int
 xftfont_end_for_frame (f)
      FRAME_PTR f;
@@ -796,6 +814,9 @@
   xftfont_driver.draw = xftfont_draw;
   xftfont_driver.end_for_frame = xftfont_end_for_frame;
   xftfont_driver.cached_font_ok = xftfont_cached_font_ok;
+#if defined (HAVE_M17N_FLT) && defined (HAVE_LIBOTF)
+  xftfont_driver.shape = xftfont_shape;
+#endif
 
   register_font_driver (&xftfont_driver, NULL);
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]