>
> > I have thus committed a new algorithm for Mac GL text drawing:
> > 1) Allocate a pile of pre-computed textures of default size 100.
> > 2) To draw a text string do
> >    - if the corresponding texture is in the pile, map it to=20
> > the GL scene
> >    - if not, pre-compute the corresponding texture and map it
> >       + if the pile is not full, put the texture in the pile
> >       + if not, remove the most ancient pile element, and put
> >         the new texture in the pile.
>
> Might get smaller bitmaps by using fl_text_extents() rather than
> fl_measure().
>
> In general, fl_measure() returns a larger bounding box as it takes
> account of the typical height of the font, whereas fl_text_extents()
> computes the smallest bounding box that will enclose the actual
> "printed" part of the text...
>
> Might be worth a shot - though perhaps fl_measure() is what you want in
> this case?
>

Interesting idea. However, this would increase the size of the pile
because we would have to memorize dx and dy in addition to w and h
for each pre-computed texture. So I think we can stick with
fl_measure.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to