mirror of https://github.com/0intro/wmii
Only use the ascent/descent from the first font in the fontset. Comments welcome.
This commit is contained in:
parent
227327a2c6
commit
e4121b422e
13
draw.c
13
draw.c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue