From c9fd5a265f4b1f9a52ba27d8f30ddf855aeba55c Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 6 Jun 2007 15:20:16 +0100 Subject: [PATCH] winex11.drv: XRenderCompositeText has a problem with 0x0 glyphs, so we'll pretend they're 1x1. --- dlls/winex11.drv/xrender.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 612c048da9d..74a7e2b2072 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -633,6 +633,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) gsCacheEntryFormat *formatEntry; UINT ggo_format = GGO_GLYPH_INDEX; XRenderPictFormat pf; + const char zero = 0; switch(format) { case AA_Grey: @@ -790,7 +791,6 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) } } - memcpy(&formatEntry->gis[glyph], &gi, sizeof(gi)); if(formatEntry->glyphset) { if(format == AA_None && BitmapBitOrder(gdi_display) != MSBFirst) { @@ -809,14 +809,28 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) } } gid = glyph; + + /* + XRenderCompositeText seems to ignore 0x0 glyphs when + AA_None, which means we lose the advance width of glyphs + like the space. We'll pretend that such glyphs are 1x1 + bitmaps. + */ + + if(buflen == 0) + gi.width = gi.height = 1; + wine_tsx11_lock(); pXRenderAddGlyphs(gdi_display, formatEntry->glyphset, &gid, &gi, 1, - buf, buflen); + buflen ? buf : &zero, buflen ? buflen : 1); wine_tsx11_unlock(); HeapFree(GetProcessHeap(), 0, buf); } else { formatEntry->bitmaps[glyph] = buf; } + + memcpy(&formatEntry->gis[glyph], &gi, sizeof(gi)); + return TRUE; }