[cairo] Slightly Off-Topic Font Question

Jeremy Moles jeremy at emperorlinux.com
Mon Jun 2 13:44:38 PDT 2008

On Mon, 2008-06-02 at 15:20 -0400, Behdad Esfahbod wrote:
> Hi Jeremy,
> You can find answers to your questions by following the links on this
> bug:
>   http://bugzilla.gnome.org/show_bug.cgi?id=522691
> In short, you should ask Pango to lay text out, then in your custom
> renderer it's up to you to get either glyph paths or glyph bitmaps from
> cairo and cache them in GL textures and finally render the text.
> behdad

Thanks for the quick response!

I've checked out the Clutter SVN to have a place to begin with, but
allow me to ask another quick question if you will, as I'm not able to
make out exactly what I should be doing from the information on that
thread and your summary.

Are you saying that I will need to derive my own custom PangoRenderer
"object", or that I will be able to use Pango straightaway? I ask
because you say "custom renderer", but that could very well be simply my
application, and not a custom object.

> On Mon, 2008-06-02 at 14:45 -0400, Jeremy Moles wrote:
> > Hello all! This seems like a great place to ask this question, though it
> > does feel somewhat off-topic since it probably has more to do with Pango
> > than it does Cairo. I'm hoping Bedhad or someone else can chime in and
> > just give me a few, quick pointers.
> > 
> > I'm writing a small GUI toolkit using OpenGL & Cairo for use in the
> > creation of widgets, windows, and other assorted (but simple) graphical
> > control elements. Naturally, font support is a big part of any such
> > beast. The toolkit in question (OpenSceneGraph) has a native module for
> > supporting Freetype, but the quality I'm getting is, unfortunately,
> > nothing short of abysmal. There are probably a number of reasons for
> > this (such as the need to provide an arbitrary API for the both 2D and
> > 3D placement), but the code is far too complicated for me to modify, so
> > I've begun to search for an alternative.
> > 
> > My main inspiration comes from things like the Source engine (Half-Life,
> > etc.) which have extremely pristine, sharp fonts in their interfaces. I
> > know it's possible to do, but I don't think I know enough about font
> > rendering in general to understand what components need to be in place
> > to begin tackling this problem.
> > 
> > Basically, what I'm looking for is a way to achieve the highest font
> > quality possible in an OpenGL game engine, preferably using Cairo--but
> > Pango directly, if necessary.
> > 
> > - Can I use Cairo for this, or should I being learning the Pango API
> > instead? 
> > 
> > - In either case, would it be possible (or straightforward) to
> > pre-render--or render on demand--a glyph (is this the right word?) into
> > it's own rectangular textured quad for use later?
> > 
> > - Most importantly though, what things must be in place to achieve the
> > highest amount of font clarity? I assume this means I want full hinting,
> > but that may require rendering the fonts on top of the existing OpenGL
> > back buffer, which isn't really an option.
> > 
> > Thanks before hand for any advice anyone might have. :)
> > 
> > _______________________________________________
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list