From: root Date: Sat, 18 Jun 2005 10:02:35 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=1ce6d2cc3980731f3db18d8f0239fe3c0ca24f81;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index bab5f07b..9af1ab49 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,9 @@ WISH: just for fun, do shade and tint with XRender. - font names are now considered to be utf-8 encoded (xft apperently uses this convention. X Core fonts might not, but it should be rare). Affects display in iso14755 box. + - rewrote the low-level xft drawing function ("xft backend" for the + hipper parts of the world) to hopefully cope better with proportional + chars mixed with fixed-width ones. 5.5 Sat Apr 23 22:31:36 CEST 2005 - re-enabled modifer state matching as in 5.3, but implement diff --git a/src/rxvtfont.C b/src/rxvtfont.C index bdac107d..0531e822 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -1256,54 +1256,53 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y, FcChar32 *enc = (FcChar32 *) get_enc_buf (len * sizeof (FcChar32)); FcChar32 *ep = enc; int ewidth = 0; - int xoff = 0; while (len) { int cwidth = r->TermWin.fwidth; FcChar32 fc = *text++; len--; - FT_UInt gl; while (len && *text == NOCHAR) text++, len--, cwidth += r->TermWin.fwidth; - gl = XftCharIndex (d.display->display, f, fc); - XftGlyphExtents (d.display->display, f, &gl, 1, &extents); - - if (extents.xOff != cwidth && ep != enc) - { - if (xoff > ewidth) xoff = ewidth; - XftDrawGlyphs (d, &r->pix_colors[fg].c, f, - x + (ewidth - xoff >> 1), - y + base, enc, ep - enc); - x += ewidth; - - ep = enc; - ewidth = 0; - xoff = 0; - } - if (fc == ' ' && ep == enc) // skip leading spaces - { - x += cwidth; - continue; - } - + x += cwidth; else { - *ep++ = gl; - ewidth += cwidth; - xoff += extents.xOff; + FT_UInt gl = XftCharIndex (d.display->display, f, fc); + XftGlyphExtents (d.display->display, f, &gl, 1, &extents); + + if (extents.xOff != cwidth) + { + if (ewidth) + { + XftDrawGlyphs (d, &r->pix_colors[fg].c, f, + x, y + base, enc, ep - enc); + x += ewidth; + + ep = enc; + ewidth = 0; + } + + if (extents.xOff > cwidth) + extents.xOff = cwidth; + + XftDrawGlyphs (d, &r->pix_colors[fg].c, f, + x + (cwidth - extents.xOff >> 1), + y + base, &gl, 1); + x += cwidth; + } + else + { + *ep++ = gl; + ewidth += cwidth; + } } } if (ep != enc) - { - if (xoff > ewidth) xoff = ewidth; - XftDrawGlyphs (d, &r->pix_colors[fg].c, f, - x + (ewidth - xoff >> 1), - y + base, enc, ep - enc); - } + XftDrawGlyphs (d, &r->pix_colors[fg].c, f, + x, y + base, enc, ep - enc); } #endif