# HG changeset patch # User Chong Yidong # Date 1265672341 18000 # Node ID e5188f4e74034b3548ed7674fcfe7bbab4e7fc95 # Parent bb513dfefeafa0f9557ce7f966fcfb3202cd72bc * nsfont.m (nsfont_open): The system's value for the font descent is negative, so round it down to avoid clipping. diff -r bb513dfefeaf -r e5188f4e7403 src/ChangeLog --- a/src/ChangeLog Mon Feb 08 18:27:29 2010 -0500 +++ b/src/ChangeLog Mon Feb 08 18:39:01 2010 -0500 @@ -1,3 +1,8 @@ +2010-02-08 Francis Devereux + + * 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 * charset.c (load_charset_map_from_file) diff -r bb513dfefeaf -r e5188f4e7403 src/nsfont.m --- a/src/nsfont.m Mon Feb 08 18:27:29 2010 -0500 +++ b/src/nsfont.m Mon Feb 08 18:39:01 2010 -0500 @@ -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);