[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> What about fonts which don't use FONT_GLYPHs or BITMAPs? Perhaps it uses
> an RLE sprite or something. Then what? You could get a pointer to the
> glyph, but you wouldn't know anything about it.
huh ?
if adding a new font type, then it should be assigned a new id of course.
each of these types would have its particular id, as, eg, gfx modes have
their own ids. it's not much different from comparing vtables, except
that it's more in the line of what allegro does abd would not access
stuff declared in aintern.h.
or did i misunderstand what you meant ?
> >Basically, when i output a string, i first calculate how many
> entire chars
> >fill in the space i have allowed, and for this i need more control about
> >the structure of the font.
>
> What is wrong with text_length()? It is more general (ie. because we
> don't have to access individual glyphs and add up their lengths, we can
> just ask the library to do it for us).
text_length is indeed more general, but when you want to know the size of
a single character, i dislike to have to do:
int char_lengh(int c)
{
char str[16]={0};
usetc(str,c);
rteurn text_length(str);
}
it would then be best to expose such a routine in the api, which would be
needed anyway, and would fetch the width in the best way.
text_length should rely on char_length, not the other way round.
all IMHO of course, since i have not worked on the text stuff as much as
you did.
--
Lyrian