Re: font renderers in gdk



lupus@lettere.unipd.it (Paolo Molaro) writes:
> 
> On Tue, Jan 27, 1998 at 05:17:19AM -0800, Christoph Toshok wrote:
> > 
> > Actually, I'll just add the angle parameter to RenderString.  This
> > vtable should be hidden from programmers, so they can call either
> > gdk_draw_text or gdk_draw_text_rot, and they'll both call the same
> > vtable entry (the first one will of course pass 0 for angle.)
> 
> But you need to know if a renderer supports rotating text:
> with a NULL in the vtable it's simple.
> 

There are several things you'd like to know about a renderer.  How
about having the Init method return zero if it fails to initialize the
renderer, and a nonzero value built up from the following if it
succeeds:

#define GDK_FONT_RENDERER_SUPPORTS_TEXT_ROTATION	0x01
#define GDK_FONT_RENDERER_SUPPORTS_KERNING		0x02
#define GDK_FONT_RENDERER_SUPPORTS_LIGATURES		0x04

etc, etc.

That way gdk can tell what's supported, and cause certain operations
to fail if they aren't supported in the renderer.

I'd like to keep the vtable as small as possible.  Having a separate
entry for rotated text will just result in half the renderers having
it be NULL, and the rest making both the rotate entry and the normal
entry call the same function, with a 0.0 angle if the text isn't to be
rotated (which is what the gdk code currently does for it.)

The font renderer can always just ignore the rotation parameter if it
didn't handle it...

Chris



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]