Implementation of underline and strikeout text in xrender.

This commit is contained in:
Dave Belanger 2003-10-11 05:24:22 +00:00 committed by Alexandre Julliard
parent 4db092c0eb
commit 9973af57e9
2 changed files with 38 additions and 1 deletions

View File

@ -2225,7 +2225,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont font, UINT cbSize,
strcatW((WCHAR*)cp, style_nameW);
ret = needed;
if(needed <= cbSize)
if(potm && needed <= cbSize)
memcpy(potm, font->potm, font->potm->otmSize);
end:

View File

@ -1234,6 +1234,43 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
}
wine_tsx11_unlock();
if (lf.lfUnderline || lf.lfStrikeOut) {
int linePos;
unsigned int lineWidth;
UINT nMetricsSize = GetOutlineTextMetricsW(hdc, 0, NULL);
OUTLINETEXTMETRICW* otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize);
if (!otm) goto done;
GetOutlineTextMetricsW(hdc, nMetricsSize, otm);
wine_tsx11_lock();
XSetForeground( gdi_display, physDev->gc, physDev->textPixel );
if (lf.lfUnderline) {
linePos = INTERNAL_YWSTODS(dc, otm->otmsUnderscorePosition);
lineWidth = INTERNAL_YWSTODS(dc, otm->otmsUnderscoreSize);
XSetLineAttributes( gdi_display, physDev->gc, lineWidth,
LineSolid, CapProjecting, JoinBevel );
XDrawLine( 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) {
linePos = INTERNAL_YWSTODS(dc, otm->otmsStrikeoutPosition);
lineWidth = INTERNAL_YWSTODS(dc, otm->otmsStrikeoutSize);
XSetLineAttributes( gdi_display, physDev->gc, lineWidth,
LineSolid, CapProjecting, JoinBevel );
XDrawLine( 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 );
}
wine_tsx11_unlock();
HeapFree(GetProcessHeap(), 0, otm);
}
} else {
INT offset = 0, xoff = 0, yoff = 0;
wine_tsx11_lock();