[10/10] gdiplus: Filter tabs out until they are properly supported using stringformat.
Dmitry Timoshkov
dmitry at baikal.ru
Thu Aug 16 23:52:17 CDT 2012
Right now tabs are printed as squares (instead of changing next glyph
position).
---
dlls/gdiplus/graphics.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index ce65c5d..34adf1e 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -6394,8 +6394,20 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI
DWORD glyphsize;
int left, top, right, bottom;
- glyphsize = GetGlyphOutlineW(hdc, text[i], ggo_flags,
- &glyphmetrics, 0, NULL, &identity);
+ /* FIXME: tabs should be handled using tabstops from stringformat */
+ if (text[i] == '\t')
+ {
+ glyphsize = 0;
+ glyphmetrics.gmptGlyphOrigin.x = 0;
+ glyphmetrics.gmptGlyphOrigin.y = 0;
+ glyphmetrics.gmBlackBoxX = 0;
+ glyphmetrics.gmBlackBoxY = 0;
+ glyphmetrics.gmCellIncX = 0;
+ glyphmetrics.gmCellIncY = 0;
+ }
+ else
+ glyphsize = GetGlyphOutlineW(hdc, text[i], ggo_flags,
+ &glyphmetrics, 0, NULL, &identity);
if (glyphsize == GDI_ERROR)
{
@@ -6445,6 +6457,9 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI
{
int left, top, stride;
+ /* FIXME: tabs should be handled using tabstops from stringformat */
+ if (text[i] == '\t') continue;
+
GetGlyphOutlineW(hdc, text[i], ggo_flags,
&glyphmetrics, max_glyphsize, glyph_mask, &identity);
@@ -6537,7 +6552,9 @@ GpStatus WINGDIPAPI GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT16
if (graphics->hdc &&
((flags & DriverStringOptionsRealizedAdvance) || length <= 1) &&
brush->bt == BrushTypeSolidColor &&
- (((GpSolidFill*)brush)->color & 0xff000000) == 0xff000000)
+ (((GpSolidFill*)brush)->color & 0xff000000) == 0xff000000 &&
+ /* FIXME: tabs should be handled using tabstops from stringformat */
+ !memchrW(text, '\t', length))
stat = GDI32_GdipDrawDriverString(graphics, text, length, font, brush,
positions, flags, matrix);
--
1.7.11.5
More information about the wine-patches
mailing list