【转】rxvt-unicode (urxvt) 字间距过宽的patch

| | Comments (1) | TrackBacks (0)

依据 http://lists.schmorp.de/pipermail/rxvt-unicode/2007q4/000514.html 的说法。rxvt-unicode的字间距比其他terminal要大出很多,是因为计算公式有错误。使用如下patch即可消除这个问题。

diff -NBupr rxvt-unicode-9.02/src/rxvtfont.C rxvt-unicode-9.02-fixed/src/rxvtfont.C
--- rxvt-unicode-9.02/src/rxvtfont.C    2008-01-26 23:07:30.000000000 +0800
+++ rxvt-unicode-9.02-fixed/src/rxvtfont.C      2008-05-11 21:47:56.000000000 +0800
@@ -1198,9 +1198,14 @@ rxvt_font_xft::load (const rxvt_fontprop
           g.width -= g.x;

           int wcw = WCWIDTH (ch);
+/*
+ * see: http://lists.schmorp.de/pipermail/rxvt-unicode/2007q4/000514.html
           if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
-
           if (width    < g.width       ) width    = g.width;
+*/
+          if (wcw > 1) g.xOff = g.xOff / wcw;
+          if (width < g.xOff) width = g.xOff;
+
           if (height   < g.height      ) height   = g.height;
           if (glheight < g.height - g.y) glheight = g.height - g.y;
         }

0 TrackBacks

Listed below are links to blogs that reference this entry: 【转】rxvt-unicode (urxvt) 字间距过宽的patch.

TrackBack URL for this entry: http://blog.jianingy.com:4080/mt-tb.cgi/223

1 Comments

FW said:

pls contact me with email.about APIHook.

Leave a comment

声援SOFF|声援珊瑚虫:如果你是珊瑚虫用户,请坚决力挺声援珊瑚虫!

Archives