Re: [AD] monochrome 8x8 builtin font + upscaling algorithm

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


On 9 Jul 2012 at 14:36, Elias Pschernig wrote:
> On Mon, Jul 9, 2012 at 12:48 PM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> >
> > Keeping in mind the reason for introducing the builtin font in the first
> > place (quick debugging) I think there should just be one function that
> > returns a ready to use font.
> >
> 
> True. Just something like this would work I think:
> 
> ALLEGRO_FONT *al_create_builtin_font(void);


So we're back at the beginning. :-)
Done. New patch is attached. The two information functions were 
unnecessary in that case, so I removed them.

The only public function is now:
ALLEGRO_FONT *al_create_builtin_font(void);

(I) still need a way to create a bitmap sheet...


> For the future, if we actually want something like bitmap scaling
> algorithms or special font effects, maybe there can be functions like:
> 
> ALLEGRO_BITMAP *al_create_font_sheet(ALLEGRO_FONT *font);
> int al_get_font_ranges(int *ranges);

> They would create a glyph sheet (for bitmap fonts, just clone the
> existing one) which could then be processed and passed back to
> al_grab_font_from_bitmap. And so for the builtin font, if you really
> need it as a bitmap, you would be able to use this.

...
As we (Elias and I) briefly discussed in IRC, the sheet creation 
could possibly better be left to be done in user code instead.
It's a special case which no one (except me for the builtin font?) 
seems to need in the library at the moment.
(I only need it asap so I can scale the font in my code.)

The only additional information the library needs to expose about 
fonts to enable users(me) to create font sheets (for custom 
processing) is glyph ranges and character dimensions of a font.

For getting character ranges, something like
int *al_get_glyph_ranges(ALLEGRO_FONT *src, int* range_count);
is needed.
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  0001-simple-builtin-8x8-font-creation-function.patch
     Date:  9 Jul 2012, 17:17
     Size:  30087 bytes.
     Type:  Unknown

Attachment: 0001-simple-builtin-8x8-font-creation-function.patch
Description: Binary data



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