Re: [AD] grabber in beta 3 vs beta 2

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> The font contains a depth of 255. Evert, you know more about this? If
> 255 is allowed, then we must translate it to 8 on loading.

255 is not allowed, and never was. I think I may have a clue on how it got 
there or at least on where to start looking.
I don't have time to look at this right now in detail, so let me explain 
how the font's colour depth is stored, because it's a bit problematic.

Older versions of Allegro stored `1' to indicate a monochrome font and `0' 
to indicate an 8-bit colour font. This is somewhat unfortunate since it 
makes it a bit more tricky to store higher colourdepth fonts.

Currently, the font's colour depth is stored, with monochrome fonts neatly 
mapped to `1 bit'. A colourdepth of 0 is still interpreted as a depth of 
8, and for compatibility, the grabber and dat utilities also write `0' 
rather than `8' for the colourdepth of the font.

So, allowed values are 0, 1, 8, 15, 16, 24, 32, with 0 being interpreted as 
8 and 8 being written as 0.
Now for the tricky part. Have a look at tools/plugins/datfont.c, line 647. 
It deals with 32 bit true colour fonts, which have a reported colourdepth 
of -32. I don't know how this would end up as 255 (or -1) in the datafile, 
but it's the only thing I can think of right now. I'd imagine the fix 
would be to simply store it as `32', because that's the depth of the image 
that has to be created. Not sure how to easily read back the alpha channel 
in that case.
If the font in this case is not supposed to be 32 bit with alpha channel, 
then this probably has nothing to do with anything and I don't know what 
to do.

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/