Use the pitch provided by FreeType. Fixes bug 894.
Modified: trunk/reactos/subsys/win32k/objects/text.c
_____
Modified: trunk/reactos/subsys/win32k/objects/text.c
--- trunk/reactos/subsys/win32k/objects/text.c 2005-10-13 08:05:12 UTC
(rev 18423)
+++ trunk/reactos/subsys/win32k/objects/text.c 2005-10-13 08:15:52 UTC
(rev 18424)
@@ -1458,7 +1458,7 @@
FT_Face face;
FT_GlyphSlot glyph;
LONGLONG TextLeft, RealXStart;
- ULONG TextTop, pitch, previous, BackgroundLeft;
+ ULONG TextTop, previous, BackgroundLeft;
FT_Bool use_kerning;
RECTL DestRect, MaskRect, SpecifiedDestRect;
POINTL SourcePoint, BrushOrigin;
@@ -1805,9 +1805,6 @@
DPRINT1("WARNING: Failed to render glyph!\n");
goto fail;
}
- pitch = glyph->bitmap.pitch;
- } else {
- pitch = glyph->bitmap.width;
}
if (fuOptions & ETO_OPAQUE)
@@ -1845,9 +1842,17 @@
* 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
* 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 )
{
DPRINT1("WARNING: EngLockSurface() failed!\n");
Show replies by date