Use the pitch provided by FreeType. Fixes bug 894.

svn path=/trunk/; revision=18424
This commit is contained in:
Gé van Geldorp 2005-10-13 08:15:52 +00:00
parent 035526b30e
commit 7b39c07e8a

View file

@ -1458,7 +1458,7 @@ NtGdiExtTextOut(
FT_Face face; FT_Face face;
FT_GlyphSlot glyph; FT_GlyphSlot glyph;
LONGLONG TextLeft, RealXStart; LONGLONG TextLeft, RealXStart;
ULONG TextTop, pitch, previous, BackgroundLeft; ULONG TextTop, previous, BackgroundLeft;
FT_Bool use_kerning; FT_Bool use_kerning;
RECTL DestRect, MaskRect, SpecifiedDestRect; RECTL DestRect, MaskRect, SpecifiedDestRect;
POINTL SourcePoint, BrushOrigin; POINTL SourcePoint, BrushOrigin;
@ -1805,9 +1805,6 @@ NtGdiExtTextOut(
DPRINT1("WARNING: Failed to render glyph!\n"); DPRINT1("WARNING: Failed to render glyph!\n");
goto fail; goto fail;
} }
pitch = glyph->bitmap.pitch;
} else {
pitch = glyph->bitmap.width;
} }
if (fuOptions & ETO_OPAQUE) if (fuOptions & ETO_OPAQUE)
@ -1845,9 +1842,17 @@ NtGdiExtTextOut(
* We should create the bitmap out of the loop at the biggest possible * We should create the bitmap out of the loop at the biggest possible
* glyph size. Then use memset with 0 to clear it and sourcerect to * glyph size. Then use memset with 0 to clear it and sourcerect to
* limit the work of the transbitblt. * limit the work of the transbitblt.
*
* FIXME: DIB bitmaps should have an lDelta which is a multiple of 4.
* Here we pass in the pitch from the FreeType bitmap, which is not
* guaranteed to be a multiple of 4. If it's not, we should expand
* the FreeType bitmap to a temporary bitmap.
*/ */
HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, BMF_TOPDOWN, glyph->bitmap.buffer); HSourceGlyph = EngCreateBitmap(bitSize, glyph->bitmap.pitch,
(glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ?
BMF_8BPP : BMF_1BPP, BMF_TOPDOWN,
glyph->bitmap.buffer);
if ( !HSourceGlyph ) if ( !HSourceGlyph )
{ {
DPRINT1("WARNING: EngLockSurface() failed!\n"); DPRINT1("WARNING: EngLockSurface() failed!\n");