aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2010-10-15 16:49:11 +0900
committerKenichi Handa2010-10-15 16:49:11 +0900
commit31daa5e17c73c0830ef5094eb38702450965a938 (patch)
tree91455108b7f9a19719cee3f47c6fd1509a215207 /src
parente6673d01cab4b7a380367749e8401e66f14b5cd7 (diff)
downloademacs-31daa5e17c73c0830ef5094eb38702450965a938.tar.gz
emacs-31daa5e17c73c0830ef5094eb38702450965a938.zip
Fix incorrect font metrics when the same font is opened with different pixelsizes.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/xftfont.c21
2 files changed, 30 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 40c0cb231e4..46913c8a8b0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12010-10-15 Kenichi Handa <handa@m17n.org>
2
3 Fix incorrect font metrics when the same font is opened with
4 different pixelsizes.
5
6 * xftfont.c: Include composite.h.
7 (xftfont_shape): New function.
8 (syms_of_xftfont): Set xftfont_driver.shape.
9
12010-10-13 Damyan Pepper <damyanp@gmail.com> 102010-10-13 Damyan Pepper <damyanp@gmail.com>
2 11
3 Fix handling of font properties on Windows (bug#6303). 12 Fix handling of font properties on Windows (bug#6303).
diff --git a/src/xftfont.c b/src/xftfont.c
index 197cc9c1f5b..71fd1475280 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include "blockinput.h" 32#include "blockinput.h"
33#include "character.h" 33#include "character.h"
34#include "charset.h" 34#include "charset.h"
35#include "composite.h"
35#include "fontset.h" 36#include "fontset.h"
36#include "font.h" 37#include "font.h"
37#include "ftfont.h" 38#include "ftfont.h"
@@ -702,6 +703,23 @@ xftfont_draw (s, from, to, x, y, with_background)
702 return len; 703 return len;
703} 704}
704 705
706Lisp_Object
707xftfont_shape (Lisp_Object lgstring)
708{
709 struct font *font;
710 struct xftfont_info *xftfont_info;
711 FT_Face ft_face;
712 Lisp_Object val;
713
714 CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
715 xftfont_info = (struct xftfont_info *) font;
716 ft_face = XftLockFace (xftfont_info->xftfont);
717 xftfont_info->ft_size = ft_face->size;
718 val = ftfont_driver.shape (lgstring);
719 XftUnlockFace (xftfont_info->xftfont);
720 return val;
721}
722
705static int 723static int
706xftfont_end_for_frame (f) 724xftfont_end_for_frame (f)
707 FRAME_PTR f; 725 FRAME_PTR f;
@@ -796,6 +814,9 @@ syms_of_xftfont ()
796 xftfont_driver.draw = xftfont_draw; 814 xftfont_driver.draw = xftfont_draw;
797 xftfont_driver.end_for_frame = xftfont_end_for_frame; 815 xftfont_driver.end_for_frame = xftfont_end_for_frame;
798 xftfont_driver.cached_font_ok = xftfont_cached_font_ok; 816 xftfont_driver.cached_font_ok = xftfont_cached_font_ok;
817#if defined (HAVE_M17N_FLT) && defined (HAVE_LIBOTF)
818 xftfont_driver.shape = xftfont_shape;
819#endif
799 820
800 register_font_driver (&xftfont_driver, NULL); 821 register_font_driver (&xftfont_driver, NULL);
801} 822}