| [AD] ugetx() constness patch and new font subsystem |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Hi,
The patch for ugetx() const-correctness has not yet been applied, and I
have a new patch - a rewrite of the font subsystem. A quick summary:
ugetx() patch
- adds a new function, ugetxc()
- ugetx() is prototyped as `int ugetx(char**)'
- ugetxc() is prototype as `int ugetxc(AL_CONST char**)'
- ugetxc() doesn't have to be implemented; since ugetx and ugetxc are
actually function pointers, we can simply cast the value of ugetx
into ugetxc :-)
font subsystem patch
- allows for extensions to use textout() and family even when they have
bizarre data structures (such as generated-on-demand).
- achieved by changing internals of the FONT structure.
- much grabber code was rewritten; this may have introduced a bug
here or there. It seems to work 100% ok, however; I did test it
quite well, but I don't have access to old-format datafiles.
- adds `int allegro_404_char;' - this is the character used when
textout() needs to render a string containing a glyph not present
in the font. Defaults to the `^' caret character, but you can
change it at runtime. Why? because generate-on-demand fonts may
have a specific way to render undefined glyphs (eg. truetype fonts
use glyph 0).
- needs to be applied after ugetx() patch.
- could somebody please reformat it? I still haven't figured out
Allegro's system...
And a quick note: If you create a font which has glyphs of different
heights, using the current Allegro system, text_height() may return the
wrong height (it returns the height of the first glyph in the first
range). My patch doesn't change this behaviour. Should I fix it?
I haven't posted these (they are too large), so you can grab them from
here:
http://www.lwithers.demon.co.uk/prog/allegro/patches/
There is a small bit of work left to be done; documentation and (I
think) I wrote this against a pre-ugetx-const-corrected version of
Allegro, so a few ugetx() calls will need to be changed to ugetxc().
Bye for now,
--
Laurence Withers, lwithers@xxxxxxxxxx
http://www.lwithers.demon.co.uk/
Attachment:
signature.asc
Description: PGP signature
| Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |