On Wed, 27 Aug 2003 Dave_Belanger(a)cimmetry.com wrote:
+
+ /* 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 );
+ }
+
+ 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 );
+ }
What about we simplify this a bit:
if (lf.lfUnderline || lf.lfStrikeOut) {
long linePos = (lf.lfUnderline ? tm.tmDescent / 2 : - 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 );
}
--
Dimi.