Mercurial > emacs
comparison src/nsfont.m @ 107158:a54a2fe12bf1
from trunk
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sat, 13 Feb 2010 09:37:27 +0900 |
parents | e5188f4e7403 |
children | 0255e27f26c9 |
comparison
equal
deleted
inserted
replaced
107109:79ae69c59078 | 107158:a54a2fe12bf1 |
---|---|
842 font_info->voffset = lrint (hshrink * [sfont ascender] + expand * hd / 2); | 842 font_info->voffset = lrint (hshrink * [sfont ascender] + expand * hd / 2); |
843 | 843 |
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); |
852 font_info->max_bounds.lbearing = lrint (brect.origin.x); | 854 font_info->max_bounds.lbearing = lrint (brect.origin.x); |
853 font_info->max_bounds.rbearing = | 855 font_info->max_bounds.rbearing = |
878 font_info->cgfont = CGFontCreateWithPlatformFont ((void*)&atsFont); | 880 font_info->cgfont = CGFontCreateWithPlatformFont ((void*)&atsFont); |
879 } | 881 } |
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); |
888 font->max_width = lrint (font_info->max_bounds.width); | 890 font->max_width = lrint (font_info->max_bounds.width); |
889 font->height = lrint (font_info->height); | 891 font->height = lrint (font_info->height); |