+2010-02-08 Francis Devereux <francis@devrx.org>
+
+ * 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 <cyd@stupidchicken.com>
* charset.c (load_charset_map_from_file)
/* 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);
#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);