> Please somebody, look at the code in FLTK 2!
> 
> It is drawing text using textures in openGL on X. It uses freetype to 
> draw the textures and thus it matches the XFT output.

Good advice from Bill there...

In the fltk-1.3 gl_draw.cxx there's a #warning (from me) saying that we
need an implementation of glXUseXftFont(...)

Well, turns out, if I had ever looked, that we already have one - it's
in the fltk2 gl_draw.cxx...

Similar, and yet different, to what Manolo's code does under OSX.

So, here's the thing...

The fltk2 code, on selecting the font, renders the first 256 glyphs from
the font into textures, then "replays" those textures to construct the
strings during gl_draw() calls.

Manolo's code in fltk-1.3 renders whole strings into textures, then
"replays" that whole string during a redraw... The assumption, I
suppose, being that most strings don't change on every redraw...

Now; which is best for us? I really have no idea.

The fltk2 way will make for smaller texture caches, and fewer of them,
but at present can only render glyphs from the (handwave) ISO-8859-1
range correctly.

Manolo's way gives bigger textures, and possibly many more of them, but
can probably render any glyph that the current font contains.

Or there may be some third way, where we go with the fltk2 "per-glyph"
approach, but cache the glyphs the app actually uses... Or...?

Anybody?

-- 
Ian





SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to