glft
----

glft is the text part of our project. Its purpose is to display
texts in an OpenGL window. The current version (v0.1) uses only
vectorized fonts. It is able to display outline and plain glyphs.
glft will eventually display text with bitmap, pixmap (anti-aliased)
and texture (anti-aliased, or not).

report bugs and comments to conversy@lri.fr

How to build it ?
-----------------

glft is composed of only two plain-c files: glft.c and glft.h.
It uses freetype 1.2 as its font renderer (www.freetype.org),
so you have to install it, and provide a right path to the compiler
when compiling glft.


How to use it ?
---------------


* -- creating a glyph */

struct glft_font* thefont;
struct glft_glyph* theglyph;

glft_init();

thefont = glft_new_font("arial.ttf");
if(!thefont)
	exit(1);
theglyph = glft_new_glyph(thefont, '@', 100);
if(!theglyph)
	exit(1);


/* -- displaying a glyph */

glft_glyph_render_plain(theglyph);
/* or */
glft_glyph_render_ouline(theglyph);


/* releasing resources */

glft_delete_glyph(theglyph);
glft_delete_font(thefont);
glft_done();

How to display a string ?
-------------------------

just display each character of the string and advance the x position
with a translation:

while(*thechar) {
    theglyph = glft_new_glyph(thefont, *thechar++, thesize);
    if(!theglyph)
      continue;
    glft_glyph_render_plain(theglyph);
    glTranslated(theglyph->advance, 0, 0);
    glft_delete_glyph(theglyph);
}



And what about this gl display lists business ?
-----------------------------------------------

Of course, it makes sense to embed glyph rendering in a gl display
list. Since it's the first verion, and we still want to be able
to measure performances, glft does not create its own caching
mechanism by the mean of display lists. Furthermore, since future
versions will use textures, and since embedding textures in
display lists can be very costly, I prefer to think about the
api a little bit more.


TODO list
---------
1. debug
2. debug

/* i expect reports...*/

3. gain speed and space. The rendering part is fast (I guess), but the
creation part is not efficient neither in space nor in time.

4. use textures
5. improve the api (rendering quality for example)
6. create an interactive OpenGL text widget
7. maybe sleep, I still don't know.


Versions
--------

Version number scheme: vX.Y
X: improvements (?), the api or the behaviour are not the same.
Y: improvements(?), the api and the behaviour are the same.


if(X==0)
	the api and behavior will certainly change.



v0.3 20/04/1999
---

added xmax,ymax,xmin,ymin fields to gltglyph
changed glyph.advance to glyph.xadvance

bezier tesselation should be faster now.
more clean-up + less warnings + static function

v0.2 19/04/1999
---
clean-up some code

v0.1 19/04/1999
---
now it is.

v0.05 19/04/99
---
seems to work, but the verion number scheme is not Y2K compliant.








