Skip navigation

依据 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);
+/*
+ * 
           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;
         }
Attachment: 

3 Comments

  1. hello jianingy! 我使用您提供的方法修改了程序,但是还是感觉比较大,是不是可以再缩小一些呢?

  2. 我测试的结果是…………用g.width + wcw - 2比较好……你这个patch不知为什么在我这里会unable to calculate font width for Monaco

    不太清楚-2会发生什么……但是感觉-1不太对称-_-


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>