[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] Monochrome bitmaps uses two bytes??

From: Werner LEMBERG
Subject: Re: [ft] Monochrome bitmaps uses two bytes??
Date: Tue, 09 Feb 2010 07:47:12 +0100 (CET)

>> > I am using FT_LOAD_MONOCHROME to get a single bit bitmap.
>> > Irrespective of the Bitmap->width, It is allocating two bytes of
>> > data for each row.  Why is it so?  I thought it should have only
>> > a byte, if bitmap->width is (i mean x_max for each glyph) less
>> > than 8.
>> This is a good question for which I currently have no answer.
>> Please post a minimal example which I can use for debugging.
>> Either there is a bug somewhere or the documentation should be
>> improved.
> Though width is less than 8 bits you can find all the second bytes
> as zeros.

This is by design: The B/W rasterizer makes the padding value (the
number of bytes used for one row, irrespective of the actual number of
used bytes) always an even number.

If necessary, you can crop the bitmap afterwards.

I've updated the documentation accordingly (cf. the `pitch' value in
the `FT_Bitmap' structure).  Thanks for the report.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]