From: "George Ogata" <g_ogata / optushome.com.au>
> Ilmari Heikkinen <kig / misfiring.net> writes:
> 
> > Is there some simple and nice Ruby lib for rendering text into an OpenGL
> > texture? Something that takes a string and puts out a BGRA/ARGB pixels.
> >
> > Or if that's a bad idea, what's the usual way of rendering nice-looking
> > text in GL? By nice-looking I mean variable width anti-aliased truetype
> > fonts with different font sizes, hinting, line heights and all the usual
> > font rendering lib niceties. Those niceties being the main reason I
> > don't really want to cook up my own font renderer :)
[...]
> Otherwise, FTGL is nice, but I don't see any ruby bindings for it.  It
> has lazy-loaded, texture-based fonts for fast rendering, and extruded
> geometry fonts for when you want render text as a solid object from
> different angles.  Hopefully it wouldn't be too hard to wrap some ruby
> bindings around it.

Nice !!!
http://homepages.paradise.net.nz/henryj/code/index.html#FTGL

I didn't know about FTGL... I'm currently using GLUT's simple
built-in fonts.  I see FTGL already builds on Windows/Mac/*nix,
which is awesome.

Ilmari, I don't know what your time frame for this is but I'll
likely delve into creating some minimal ruby bindings for FTGL
in the next month or two.  Looking at FTGL's test cases, it
seems nice and straightforward to call.
From test/FTGLBitmapFont-Test.cpp:
    
    const char* const GOOD_ASCII_TEST_STRING = "test string";
    
    void testDisplayList()
    {
        buildGLContext();
    
        FTGLBitmapFont* bitmapFont = new FTGLBitmapFont(FONT_FILE);            
        bitmapFont->FaceSize(18);
        
        int glList = glGenLists(1);
        glNewList( glList, GL_COMPILE);

            bitmapFont->Render(GOOD_ASCII_TEST_STRING);

        glEndList();

        CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
    }

So far I've always written ruby <-> C++ binding code by hand,
but I want to learn SWIG.  Maybe this will be the time.

Ilmari, if FTGL looks appropriate for your project, let's keep
in touch so we don't end up duplicating effort in the ruby
bindings?  Maybe we could create a rubyforge project.... ?  Or ?


Regards,

Bill