|
Added
Link Here
|
| 1 |
--- src/rxvtfont.C 2013-03-27 18:59:20.000000000 +0200 |
| 2 |
+++ /tmp/rxvtfont.C 2014-01-11 10:11:32.000000000 +0200 |
| 3 |
@@ -1237,11 +1237,22 @@ |
| 4 |
|
| 5 |
FT_Face face = XftLockFace (f); |
| 6 |
|
| 7 |
+/* |
| 8 |
+ * use ascent, descent and height from XftFont *f instead of FT_Face face. |
| 9 |
+ * this somehow reproduces the behaviour of the line height as seen on xterm. |
| 10 |
+ |
| 11 |
ascent = (face->size->metrics.ascender + 63) >> 6; |
| 12 |
descent = (-face->size->metrics.descender + 63) >> 6; |
| 13 |
height = max (ascent + descent, (face->size->metrics.height + 63) >> 6); |
| 14 |
width = 0; |
| 15 |
|
| 16 |
+ */ |
| 17 |
+ |
| 18 |
+ ascent = f->ascent; |
| 19 |
+ descent = f->descent; |
| 20 |
+ height = max (ascent + descent, f->height); |
| 21 |
+ width = 0; |
| 22 |
+ |
| 23 |
bool scalable = face->face_flags & FT_FACE_FLAG_SCALABLE; |
| 24 |
|
| 25 |
XftUnlockFace (f); |
| 26 |
@@ -1265,12 +1276,21 @@ |
| 27 |
XGlyphInfo g; |
| 28 |
XftTextExtents16 (disp, f, &ch, 1, &g); |
| 29 |
|
| 30 |
+/* |
| 31 |
+ * bukind: don't use g.width as a width of a character! |
| 32 |
+ * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial |
| 33 |
+ |
| 34 |
g.width -= g.x; |
| 35 |
|
| 36 |
int wcw = WCWIDTH (ch); |
| 37 |
if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; |
| 38 |
|
| 39 |
if (width < g.width ) width = g.width; |
| 40 |
+ */ |
| 41 |
+ int wcw = WCWIDTH (ch); |
| 42 |
+ if (wcw > 1) g.xOff = g.xOff / wcw; |
| 43 |
+ if (width < g.xOff) width = g.xOff; |
| 44 |
+ |
| 45 |
if (height < g.height ) height = g.height; |
| 46 |
if (glheight < g.height - g.y) glheight = g.height - g.y; |
| 47 |
} |