aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-02-08 18:39:01 -0500
committerChong Yidong2010-02-08 18:39:01 -0500
commit14a225f9c27fa8ea76a0fbee70c9a34dee474bb6 (patch)
tree8cc0b48a04da465c46e2d4aeb1eba58a13ac3b14
parentf29fd8694cc85e5d6ba7adad3930c9cb27786d74 (diff)
downloademacs-14a225f9c27fa8ea76a0fbee70c9a34dee474bb6.tar.gz
emacs-14a225f9c27fa8ea76a0fbee70c9a34dee474bb6.zip
* nsfont.m (nsfont_open): The system's value for the font descent
is negative, so round it down to avoid clipping.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/nsfont.m8
2 files changed, 10 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4837d8ecb06..6cf78dbe084 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-02-08 Francis Devereux <francis@devrx.org>
2
3 * nsfont.m (nsfont_open): The system's value for the font descent
4 is negative, so round it down to avoid clipping.
5
12010-02-06 Chong Yidong <cyd@stupidchicken.com> 62010-02-06 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * charset.c (load_charset_map_from_file) 8 * charset.c (load_charset_map_from_file)
diff --git a/src/nsfont.m b/src/nsfont.m
index d5107f376dd..97d74a82f2b 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -844,8 +844,10 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
844 /* max bounds */ 844 /* max bounds */
845 font_info->max_bounds.ascent = 845 font_info->max_bounds.ascent =
846 lrint (hshrink * [sfont ascender] + expand * hd/2); 846 lrint (hshrink * [sfont ascender] + expand * hd/2);
847 /* [sfont descender] is usually negative. Use floor to avoid
848 clipping descenders. */
847 font_info->max_bounds.descent = 849 font_info->max_bounds.descent =
848 -lrint (hshrink* [sfont descender] - expand*hd/2); 850 -lrint (floor(hshrink* [sfont descender] - expand*hd/2));
849 font_info->height = 851 font_info->height =
850 font_info->max_bounds.ascent + font_info->max_bounds.descent; 852 font_info->max_bounds.ascent + font_info->max_bounds.descent;
851 font_info->max_bounds.width = lrint (font_info->width); 853 font_info->max_bounds.width = lrint (font_info->width);
@@ -880,8 +882,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
880#endif 882#endif
881 883
882 /* set up metrics portion of font struct */ 884 /* set up metrics portion of font struct */
883 font->ascent = [sfont ascender]; 885 font->ascent = lrint([sfont ascender]);
884 font->descent = -[sfont descender]; 886 font->descent = -lrint(floor([sfont descender]));
885 font->min_width = ns_char_width(sfont, '|'); 887 font->min_width = ns_char_width(sfont, '|');
886 font->space_width = lrint (ns_char_width (sfont, ' ')); 888 font->space_width = lrint (ns_char_width (sfont, ' '));
887 font->average_width = lrint (font_info->width); 889 font->average_width = lrint (font_info->width);