Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277830 - x11-terms/rxvt-unicode: optionally change treatment of character width when using XFT font
Summary: x11-terms/rxvt-unicode: optionally change treatment of character width when u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Jeroen Roovers (RETIRED)
URL: http://lists.schmorp.de/pipermail/rxv...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-14 16:20 UTC by Slava Gorbunov
Modified: 2010-02-03 05:07 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for rxvt-unicode-9.06 (rxvt-font-width.diff,791 bytes, patch)
2009-10-30 11:36 UTC, Slava Gorbunov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Slava Gorbunov 2009-07-14 16:20:38 UTC
rxvt-unicode treats XFT character sizes slightly different from most other terminals. Perhaps its treatment is more correct, but it causes increase of character spacing by about 10% for most (if not all) fonts. Read the following message for details:

http://lists.schmorp.de/pipermail/rxvt-unicode/2007q4/000514.html

The author of rxvt refuses to include this patch into his code - he claims that his treatment of character width is the only correct. But it causes increase of intercharacter space above ACTUAL font character spacing, so text rendered in rxvt looks worse than the same text with the same font but in another terminal due to excess space between characters.

So I propose including of the patch mentioned above into portage tree as an optional patch for rxvt-unicode, which could be enabled by USE-flag.

Reproducible: Always
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2009-10-25 17:06:53 UTC
Please attach a patch or a link to a patch.
Comment 2 Slava Gorbunov 2009-10-30 11:29:53 UTC
(In reply to comment #1)
> Please attach a patch or a link to a patch.
> 

The url of message mentioned above has changed, the correct one is:

http://lists.schmorp.de/pipermail/rxvt-unicode/2007q4/000511.html

Here is the patch from this e-mail message:

--- src/rxvtfont.C.bukind	2007-11-30 14:36:33.000000000 +0600
+++ src/rxvtfont.C	2007-11-30 14:39:29.000000000 +0600
@@ -1171,12 +1171,21 @@
           XGlyphInfo g;
           XftTextExtents16 (disp, f, &ch, 1, &g);
 
+/*  
+ * bukind: don't use g.width as a width of a character!
+ * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial
+
           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;
+ */
+          int wcw = WCWIDTH (ch);
+          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;
         }
Comment 3 Slava Gorbunov 2009-10-30 11:36:08 UTC
Created attachment 208727 [details, diff]
Patch for rxvt-unicode-9.06

Here is the patch slightly cleaned up (and which applies cleanly on latest rxvt-unicode)
Comment 4 Víctor Ostorga (RETIRED) gentoo-dev 2009-10-30 14:17:20 UTC
Information provided, reopening
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-02-03 05:07:57 UTC
I added this patch in rxvt-unicode-9.07-r1. You need USE=-vanilla to apply it.