RE: [AD] load_font patch

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


> int get_font_begin(FONT *f)
> int get_font_end(FONT *f)

get_font_[character_]range_begin/end()?

Begin seems rather vague to me.


> FONT *merge_fonts(FONT *f1, FONT *f2) 

merge_font_[character_]ranges?

It probably won't support merging arbitrary fonts.



-----Original Message-----
From: alleg-developers-admin@xxxxxxxxxx
[mailto:alleg-developers-admin@xxxxxxxxxx] On Behalf Of Evert
Glebbeek
Sent: Sunday, January 16, 2005 9:18 AM
To: alleg-developers@xxxxxxxxxx
Subject: Re: [AD] load_font patch

On Sunday 16 January 2005 12:23, Evert Glebbeek wrote:
> Forgot to mention, there's the matter of scripted fonts that are not 
> working yet. I have working code for this that also extends the FONT 
> vtable a little, hopefully also making it easier for addon-writers to 
hook 
> into this. I still need to clean it up and do some more testing with
it 
> this afternoon.

Update #1
This doesn't yet add the scripted font loading, but it adds the font
vtable 
entries I needed and some other funky stuff. This patch adds the
functions

int get_font_begin(FONT *f)
int get_font_end(FONT *f)
FONT *extract_font_range(FONT *f, int begin, int end)
FONT *merge_fonts(FONT *f1, FONT *f2)

to both the FONT vtable and the api.
The first two are used to query the range of characters a font (may) 
support. There may be gaps in this range though.
extract_font_range() does just that: it makes a new font out of an
existing 
font by copying character ranges from the old structure to the new one. 
One might envision a create_sub_font() function similar to 
create_sub_bitmap() as well, that doesn't do any copying but just sets 
some pointers (hmm... I may just have to do something like that now that

I've thought of it).
merge_font merges two fonts. As a special case, this function can
convert a 
monochrome font to a colour (bitmapped) font before merging them. These 
functions are mainly needed to be able to support scripted fonts, but
they 
can be used for some nice effects as well.
The attached example program (which isn't intended as `the' exfont.c as
the 
code is too ugly and un-safe) loads the GRX font ncen11.fnt and the 
bitmapped font mys_b16a.pcx, and then combines the capital letters from 
the latter with the first and prints a string using this result.

Undocumented as yet, but (I hope well) tested on Linux.

Evert




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