Merge from trunk:
Use the pitch provided by FreeType. Fixes bug 894.
Modified: branches/ros-branch-0_2_8/reactos/subsys/win32k/objects/text.c

Modified: branches/ros-branch-0_2_8/reactos/subsys/win32k/objects/text.c
--- branches/ros-branch-0_2_8/reactos/subsys/win32k/objects/text.c	2005-10-13 18:39:30 UTC (rev 18431)
+++ branches/ros-branch-0_2_8/reactos/subsys/win32k/objects/text.c	2005-10-13 18:43:49 UTC (rev 18432)
@@ -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");