rxvt-unicode-9.06-font-width.patch 790 B

12345678910111213141516171819202122
  1. --- a/src/rxvtfont.C 2008-07-09 12:21:45.000000000 +0400
  2. +++ b/src/rxvtfont.C 2009-10-30 14:32:53.000000000 +0300
  3. @@ -1195,12 +1195,14 @@
  4. XGlyphInfo g;
  5. XftTextExtents16 (disp, f, &ch, 1, &g);
  6. - g.width -= g.x;
  7. -
  8. +/*
  9. + * bukind: don't use g.width as a width of a character!
  10. + * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial
  11. + */
  12. int wcw = WCWIDTH (ch);
  13. - if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
  14. + if (wcw > 1) g.xOff = g.xOff / wcw;
  15. + if (width < g.xOff) width = g.xOff;
  16. - if (width < g.width ) width = g.width;
  17. if (height < g.height ) height = g.height;
  18. if (glheight < g.height - g.y) glheight = g.height - g.y;
  19. }