From: Robert O. <ROh...@nv...> - 2005-01-17 07:41:03
|
> 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)=20 merge_font_[character_]ranges? It probably won't support merging arbitrary fonts. -----Original Message----- From: all...@li... [mailto:all...@li...] On Behalf Of Evert Glebbeek Sent: Sunday, January 16, 2005 9:18 AM To: all...@li... 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=20 > working yet. I have working code for this that also extends the FONT=20 > vtable a little, hopefully also making it easier for addon-writers to=20 hook=20 > into this. I still need to clean it up and do some more testing with it=20 > this afternoon. Update #1 This doesn't yet add the scripted font loading, but it adds the font vtable=20 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)=20 support. There may be gaps in this range though. extract_font_range() does just that: it makes a new font out of an existing=20 font by copying character ranges from the old structure to the new one.=20 One might envision a create_sub_font() function similar to=20 create_sub_bitmap() as well, that doesn't do any copying but just sets=20 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=20 monochrome font to a colour (bitmapped) font before merging them. These=20 functions are mainly needed to be able to support scripted fonts, but they=20 can be used for some nice effects as well. The attached example program (which isn't intended as `the' exfont.c as the=20 code is too ugly and un-safe) loads the GRX font ncen11.fnt and the=20 bitmapped font mys_b16a.pcx, and then combines the capital letters from=20 the latter with the first and prints a string using this result. Undocumented as yet, but (I hope well) tested on Linux. Evert |