*** empty log message ***
authorroot <root>
Sat, 18 Jun 2005 10:02:35 +0000 (10:02 +0000)
committerroot <root>
Sat, 18 Jun 2005 10:02:35 +0000 (10:02 +0000)
Changes
src/rxvtfont.C

diff --git a/Changes b/Changes
index bab5f07b4f59011abf6032993781d28690c9f8b1..9af1ab4936492d3a6a9020acd7bca40c38a1da81 100644 (file)
--- 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
index bdac107d9a44a15b1f5790af7f60a798026ed498..0531e82250d154b16d3e5b42ef2c1bc002983077 100644 (file)
@@ -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