patch for underline and strikeout text in xrender

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Aug 27 17:09:00 CDT 2003


On Wed, Aug 27, 2003 at 05:34:53PM -0400, Dimitrie O. Paun wrote:
> 
> 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 );
>     }
> 

Actually you want to use the otmsUnderscoreSize,
otmsUnderscorePosition, otmsStrikeoutSize and otmsStrikeoutPosition
members of OUTLINETEXTMETRIC, rather than hard coding those 2s and 3.5s.

You may also want to think about what happens when the text is rotated :)

Huw.




More information about the wine-devel mailing list