Nikita Egorov wrote:
> Hi Denis,
> I have a bug when setting A1(A4) font format. After deep digging I
> found incorrect definition of "align" variable in
> dfb_font_get_glyph_data():
> 
> fonts.c:253  align = MAX( 8 / (DFB_BYTES_PER_PIXEL( font->pixel_format ) ? : 
> 1),
>                   DFB_PIXELFORMAT_ALIGNMENT( font->pixel_format ) );
> 
> What did you mean here?

I wanted an alignment of at least eight bytes.

> I'm not sure but the first argument of MAX() always is great than second one !
> In case of font format A1(A4) we have align=8 and therefore the next
> glyph's position is wrong :
> 
> fonts.c:428  row->next_x  += (data->width + align) & ~align;
> 
> I have found you had commited it in 2008-01-08 instead align =
> DFB_PIXELFORMAT_ALIGNMENT( font->pixel_format );

I forgot to decrease by one to get a proper mask:

  align = MAX( 8 / (DFB_BYTES_PER_PIXEL( font->pixel_format ) ? : 1) - 1,
               DFB_PIXELFORMAT_ALIGNMENT( font->pixel_format ) );


Committing the fix, thanks for spotting!

-- 
Best regards,
   Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to