updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / rxvt-unicode-patched / font-width-fix.patch
blob811d9e615ab40c7a806ad488a523b43da2ab2487
1 --- src/rxvtfont.C.bukind 2007-11-30 14:36:33.000000000 +0600
2 +++ src/rxvtfont.C 2007-11-30 14:39:29.000000000 +0600
3 @@ -1171,12 +1171,21 @@
4 XGlyphInfo g;
5 XftTextExtents16 (disp, f, &ch, 1, &g);
7 +/*
8 + * bukind: don't use g.width as a width of a character!
9 + * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial
11 g.width -= g.x;
13 int wcw = WCWIDTH (ch);
14 if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
16 if (width < g.width ) width = g.width;
17 + */
18 + int wcw = WCWIDTH (ch);
19 + if (wcw > 1) g.xOff = g.xOff / wcw;
20 + if (width < g.xOff) width = g.xOff;
22 if (height < g.height ) height = g.height;
23 if (glheight < g.height - g.y) glheight = g.height - g.y;