[hackers] wmii: new tip (= 1761)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Tue, 06 Feb 2007 23:10:06 +0100

changeset: 1761:4813e030768b
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Feb 06 17:03:07 2007 -0500
files: draw.c
description:
Only use the ascent/descent from the first font in the fontset. Comments welcome.

diff -r 62f1a80511e1 -r 4813e030768b draw.c
--- a/draw.c Tue Feb 06 15:28:35 2007 -0500
+++ b/draw.c Tue Feb 06 17:03:07 2007 -0500
@@ -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)
Received on Tue Feb 06 2007 - 23:10:06 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:54:56 UTC