Underline and strikethrough support

Warren_Baird at cimmetry.com Warren_Baird at cimmetry.com
Wed Feb 5 17:18:50 CST 2003



This is the first of a fairly long set of patches done by myself and my
development team - the patches are built against the jan 15th release.  I'm the
only person on the team with an external email address, so I've put my name on
all of the patches, and then the names of other team members that worked on the
patch.

ChangeLog:

     Add support for underline and strikethrough font in XRender.

Description:

     Use lfUnderline or lfStrikeOut logical font field in
     X11DRV_XRender_ExtTextOut to determine if we should draw a
     line using TSXDrawLine across or under the font that just got
     rendered.


Warren Baird : Warren_Baird at cimmetry.com
Dave Belanger


diff -ur clean/wine/dlls/x11drv/xrender.c wine/dlls/x11drv/xrender.c
--- clean/wine/dlls/x11drv/xrender.c     Wed Jan 29 15:30:55 2003
+++ wine/dlls/x11drv/xrender.c     Thu Jan 30 11:16:06 2003
@@ -30,6 +30,7 @@
 #include "windef.h"
 #include "wownt32.h"
 #include "x11drv.h"
+#include "x11font.h"
 #include "bitmap.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
@@ -1224,6 +1225,31 @@
         }
     }
     wine_tsx11_unlock();
+
+    // check for underline or strike-through
+    long lineWidth = tm.tmDescent / 4;
+
+    if (lf.lfUnderline) {
+        long linePos = tm.tmDescent / 2;
+
+         TSXSetForeground( gdi_display, physDev->gc, physDev->textPixel );
+         TSXSetLineAttributes( gdi_display, physDev->gc, lineWidth,
+                                    LineSolid, CapProjecting, JoinBevel );
+        TSXDrawLine( gdi_display, physDev->drawable, physDev->gc,
+                         physDev->org.x + x, physDev->org.y + y + linePos,
+                         physDev->org.x + x + width, physDev->org.y + y +
linePos );
+    } //added
+
+    if (lf.lfStrikeOut) {
+        long linePos = tm.tmAscent / 3.5;
+
+         TSXSetForeground( gdi_display, physDev->gc, physDev->textPixel );
+         TSXSetLineAttributes( gdi_display, physDev->gc, lineWidth,
+                                    LineSolid, CapProjecting, JoinBevel );
+         TSXDrawLine( gdi_display, physDev->drawable, physDev->gc,
+                         physDev->org.x + x, physDev->org.y + y - linePos,
+                         physDev->org.x + x + width, physDev->org.y + y -
linePos );
+      }

     } else {
         INT offset = 0, xoff = 0, yoff = 0;





More information about the wine-patches mailing list