diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 5a6f8479bbc..8deb9e6820b 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -6795,7 +6795,8 @@ IntExtTextOutW( FONT_CACHE_ENTRY Cache; FT_Matrix mat; BOOL bNoTransform; - DWORD ch0, ch1, etx = 3; // etx is ASCII End of Text + DWORD ch0, ch1; + const DWORD del = 0x7f, nbsp = 0xa0; // DEL is ASCII DELETE and nbsp is a non-breaking space FONTLINK_CHAIN Chain; SIZE spaceWidth; @@ -7063,13 +7064,14 @@ IntExtTextOutW( bitSize.cx = realglyph->bitmap.width; bitSize.cy = realglyph->bitmap.rows; - /* Do chars other than space and etx have a bitSize.cx of zero? */ - if (ch0 != L' ' && ch0 != etx && bitSize.cx == 0) + /* Do chars > space & not DEL & not nbsp have a bitSize.cx of zero? */ + if (ch0 > L' ' && ch0 != del && ch0 != nbsp && bitSize.cx == 0) DPRINT1("WARNING: WChar 0x%04x has a bitSize.cx of zero\n", ch0); - /* Don't ignore spaces when computing offset. + /* Don't ignore spaces or non-breaking spaces when computing offset. * This completes the fix of CORE-11787. */ - if ((pdcattr->flTextAlign & TA_UPDATECP) && ch0 == L' ' && bitSize.cx == 0) + if ((pdcattr->flTextAlign & TA_UPDATECP) && bitSize.cx == 0 && + (ch0 == L' ' || ch0 == nbsp)) // Space chars needing x-dim widths { IntUnLockFreeType(); /* Get the width of the space character */