Commit 9973af57 authored by Dave Belanger's avatar Dave Belanger Committed by Alexandre Julliard

Implementation of underline and strikeout text in xrender.

parent 4db092c0
......@@ -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:
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment