Re: [AD] new font system

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


In reply to Vincent Penquerc'h <vincent@xxxxxxxxxx>:
>while updating to a new version of allegro (i now have wip35, woohoo!),
>i had to upgrade code dealing with fonts to the new font system, and i
>found that some things (like a glyph output function for instance) would
>be a good addition to the vtable.

I think I understand what you are saying now -- you would prefer
textout() to parse the string and call a glyph output function in the
font's vtable rather than pass the whole string to the vtable.

I chose against that method for two reasons:

 - it requires an additional function call for each glyph (perhaps this
   would create overhead in a textout()-intensive application)

 - we can't have subpixel precision, kerning, etc. within a string, 
   since the vtable entry wouldn't be aware of the context of the glyph
   it is rendering. Specific reference to FreeType here...

However, I do agree that it might be nice to have a separate method for
outputting glyphs. Perhaps you could add one? It would be trivial to do
(another advantage of using vtables).

> it would also be nice to be able to tell
>whether a font is color or not (without having to use a hackish method).

Firstly, why? Before I made decisions on what should/should not be
possible, I considered the context of each problem. IIRC, the only place
where this is needed is within the grabber.

And secondly, this is not hackish. Somebody once proposed adding an `id'
field to the vtable, but there simply is no point -- just use the vtable
address (which, as an added bonus, is guaranteed to be unique).

Comparing vtable addresses is not hackish in any way I can think of,
because there aren't any dodgy situations that could come up (eg. two
libraries using the same ID value). Admittedly, it is not heuristic; if
you wrote code that checks for font_color_vtable and somebody else
creates a font_rainbow_vtable, you won't know that their font is color,
but which situation would you encounter this in?

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/