win32ss/gdi/ntgdi/freetype.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 6a72112f2c9..aa8795fcf7b 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -6797,6 +6797,7 @@ IntExtTextOutW( BOOL bNoTransform; DWORD ch0, ch1; FONTLINK_CHAIN Chain; + SIZE sz; /* Check if String is valid */ if (Count > 0xFFFF || (Count > 0 && String == NULL)) @@ -7062,6 +7063,18 @@ IntExtTextOutW( bitSize.cx = realglyph->bitmap.width; bitSize.cy = realglyph->bitmap.rows; + /* Don't ignore spaces when computing offset */ + /* Do other characters return a bitSize.cx of zero? */ + if ((pdcattr->flTextAlign & TA_UPDATECP) && ch0 == 32 && bitSize.cx == 0) + { + IntUnLockFreeType(); + /* Get the width of the space character */ + TextIntGetTextExtentPoint(dc, TextObj, L" ", 1, 0, NULL, 0, &sz, 0); + IntLockFreeType(); + bitSize.cx = sz.cx; + realglyph->left = 0; + } + MaskRect.right = realglyph->bitmap.width; MaskRect.bottom = realglyph->bitmap.rows; @@ -7166,8 +7179,8 @@ IntExtTextOutW( previous = glyph_index; } - - if (pdcattr->flTextAlign & TA_UPDATECP) + /* Don't update position if String == NULL */ + if (pdcattr->flTextAlign & TA_UPDATECP && String) pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x; if (plf->lfUnderline || plf->lfStrikeOut) /* Underline or strike-out? */