wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit e4121b422e6df6da6ec3a6104a539da63b03372f
parent 227327a2c607542f0b5cc04a38dab54e646266df
Author: Kris Maglione <jg@suckless.org>
Date:   Tue,  6 Feb 2007 17:03:07 -0500

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


Diffstat:
draw.c | 13++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/draw.c b/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)