freetypy.Bitmap.pitch

Bitmap.pitch

The number of bytes taken by one bitmap row.

Includes padding.

The pitch is positive when the bitmap has a ‘down’ flow, and negative when it has an ‘up’ flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row.

Note that ‘padding’ means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value.

For the B/W rasterizer, pitch is always an even number.

To change the pitch of a bitmap (say, to make it a multiple of 4), use Bitmap.convert. Alternatively, you might use callback functions to directly render to the application’s surface.