diff options
| author | Kenichi Handa | 2010-10-15 16:49:11 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2010-10-15 16:49:11 +0900 |
| commit | 31daa5e17c73c0830ef5094eb38702450965a938 (patch) | |
| tree | 91455108b7f9a19719cee3f47c6fd1509a215207 /src | |
| parent | e6673d01cab4b7a380367749e8401e66f14b5cd7 (diff) | |
| download | emacs-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/ChangeLog | 9 | ||||
| -rw-r--r-- | src/xftfont.c | 21 |
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 @@ | |||
| 1 | 2010-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 | |||
| 1 | 2010-10-13 Damyan Pepper <damyanp@gmail.com> | 10 | 2010-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 | ||
| 706 | Lisp_Object | ||
| 707 | xftfont_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 | |||
| 705 | static int | 723 | static int |
| 706 | xftfont_end_for_frame (f) | 724 | xftfont_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 | } |