[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r99472: * nsfont.m (nsfont_open): The
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r99472: * nsfont.m (nsfont_open): The system's value for the font descent |
Date: |
Mon, 08 Feb 2010 18:39:01 -0500 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 99472
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2010-02-08 18:39:01 -0500
message:
* nsfont.m (nsfont_open): The system's value for the font descent
is negative, so round it down to avoid clipping.
modified:
src/ChangeLog
src/nsfont.m
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-02-06 13:29:05 +0000
+++ b/src/ChangeLog 2010-02-08 23:39:01 +0000
@@ -1,3 +1,8 @@
+2010-02-08 Francis Devereux <address@hidden>
+
+ * nsfont.m (nsfont_open): The system's value for the font descent
+ is negative, so round it down to avoid clipping.
+
2010-02-06 Chong Yidong <address@hidden>
* charset.c (load_charset_map_from_file)
=== modified file 'src/nsfont.m'
--- a/src/nsfont.m 2010-01-13 08:35:10 +0000
+++ b/src/nsfont.m 2010-02-08 23:39:01 +0000
@@ -844,8 +844,10 @@
/* max bounds */
font_info->max_bounds.ascent =
lrint (hshrink * [sfont ascender] + expand * hd/2);
+ /* [sfont descender] is usually negative. Use floor to avoid
+ clipping descenders. */
font_info->max_bounds.descent =
- -lrint (hshrink* [sfont descender] - expand*hd/2);
+ -lrint (floor(hshrink* [sfont descender] - expand*hd/2));
font_info->height =
font_info->max_bounds.ascent + font_info->max_bounds.descent;
font_info->max_bounds.width = lrint (font_info->width);
@@ -880,8 +882,8 @@
#endif
/* set up metrics portion of font struct */
- font->ascent = [sfont ascender];
- font->descent = -[sfont descender];
+ font->ascent = lrint([sfont ascender]);
+ font->descent = -lrint(floor([sfont descender]));
font->min_width = ns_char_width(sfont, '|');
font->space_width = lrint (ns_char_width (sfont, ' '));
font->average_width = lrint (font_info->width);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r99472: * nsfont.m (nsfont_open): The system's value for the font descent,
Chong Yidong <=