freetype
[Top][All Lists]
Advanced

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

Re: [ft] bitmap buffer length


From: Werner LEMBERG
Subject: Re: [ft] bitmap buffer length
Date: Fri, 26 Feb 2010 17:16:09 +0100 (CET)

> The pitch is positive when the bitmap has a ‘down’ flow,
> and negative when it has an ‘up’ flow.
> 
>  rows * pitch
> 
> When i multiply a negative pitch i will get a negative number of bytes
> right?? or my assumption is wrong?

Simply take the absolute value...

> I would like to read the bitmap->buffer,
> 
> for (i=0; i < size ; i++)
> 
> printf("%.2x ",slot->bitmap.buffer[i]);
> if size = rows*pitch,
> I got the following data for unicode val 0x40 (which represents @)
> 
> I got pitch as 4.
> 
> Font Data:00 07 fc 00
>           00 00 00 3f
>           ff 80 00 00
>           00 ff ff e0
>           00 00 03 f0
>           01 f0 00 00
>           07 c0 00 78
>           00 00 0f 00
>           00 3c 00 00
>           0e 00 00 1e
>           00 00 1c 07
>           c3 8e 00 00
>           3c 0f f3 87
>           00 00 38 3f
>           ff 87 00 00
>           70 3c 1f 03
>           00 00

There is something wrong...  The number of bytes must be a multiple of
four if you have a pitch value of 4.

> so, 4 bytes represents one row.  I got bit map *width as 22*, does
> it mean the glyph data is actually in *3 bytes(22/8) * and the
> otherbyte is for padding?

Yes, it should be like this if you have 8 pixels per byte.


    Werner

reply via email to

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