Only use the ascent/descent from the first font in the fontset. Comments welcome.

This commit is contained in:
Kris Maglione 2007-02-06 17:03:07 -05:00
parent 227327a2c6
commit e4121b422e
1 changed files with 4 additions and 9 deletions

13
draw.c
View File

@ -40,17 +40,12 @@ loadfont(Blitz *blitz, BlitzFont *font) {
XFontSetExtents *font_extents;
XFontStruct **xfonts;
char **font_names;
unsigned int i;
font->ascent = font->descent = 0;
font_extents = XExtentsOfFontSet(font->set);
n = XFontsOfFontSet(font->set, &xfonts, &font_names);
for(i = 0, font->ascent = 0, font->descent = 0; i < n; i++) {
if(font->ascent < (*xfonts)->ascent)
font->ascent = (*xfonts)->ascent;
if(font->descent < (*xfonts)->descent)
font->descent = (*xfonts)->descent;
xfonts++;
}
XFontsOfFontSet(font->set, &xfonts, &font_names);
font->ascent = xfonts[0]->ascent;
font->descent = xfonts[0]->descent;
}
else {
if(font->xfont)