patch for underline and strikeout text in xrender

Vincent Béron vberon at mecano.gme.usherb.ca
Wed Aug 27 16:48:18 CDT 2003


Le mer 27/08/2003 à 17:43, Vincent Béron a écrit :
> Le mer 27/08/2003 à 17:34, Dimitrie O. Paun a écrit :
> > On Wed, 27 Aug 2003 Dave_Belanger at cimmetry.com wrote:
> ...
> > +       if (lf.lfUnderline) {
> ...
> > +       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) {
> ...
> > +               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 );
> >     }
> 
> Not sure it'll do the same thing, it's +linePos in the first case and
> -linePos in the second...

Do'h! Just saw the - in in front of tm.tmAscent. Forget this.

Vincent





More information about the wine-devel mailing list