From: Ilmari Heikkinen Date: 2005-05-14T04:01:55+09:00 Subject: Re: Rendering text with OpenGL On 13.5.2005, at 20:20, Bill Kelly wrote: > From: "George Ogata" >> Ilmari Heikkinen 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. > [...] > > 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 ? > I played around a bit with rcairo[1] tonight and got it rendering into a texture-ready String[2]. I'll probably go with that, at least for now. Having access to polygon fonts from FTGL would be pretty awesome though. So, yeah, I'm open to suggestions. [1] http://cairographics.org/rcairo [2] http://dark.fhtr.org/rcairo_tex.png