Re: Rendering text with pango without GTK/cairo/...



On Fri, 2008-04-18 at 14:48 +0200, Troeger, Thomas (ext) wrote:
> Hi,

Hi,

> I'm trying to extend an existing graphics engine with font rendering. My
> initial attempt includes FreeType and it's gotten me to simple layout
> working quite ok. I now have to extend the whole thing with
> bidirectional text, different text style and colors and that's the point
> where I'm looking into existing libraries. Since pango is widely used
> and seems to render text nicely my question is:
> 
> - can this be done with pango?

Sure, that's what Pango is.

> - do I have to use cairo? After all I already have a graphics engine ...

You don't *have* to, but it's recommended that you do.  pangocairo is
the preferred way to use Pango these days.  But you can always write
your own backend, or use the pangoft2 backend.  A bunch of projects
(including GIMP and Clutter for example) do that successfully.

> - if it can be done, is there an example program that illustratesp ure
> pango usage?

Humm, no simple one to recommend here.  There's pango-view that can use
all pango backends, there's paps, there are GIMP and Inkscape that are
more sophisticated.  There's Clutter that implements its own
FreeType-based OpenGL-based pango backend.  Really depends on what you
want to do.  But the pangoft2.h header should show you the way if you
generally know how to use Pango.

> - how fast is pango compared to a simple freetype2 solution with a very
> simple renderer?

Depends on what you want to do with it.  Best answer I can give you is
"try it and see".  It's going to be slower.  But if you use it properly,
it shouldn't become a bottleneck.

> I'd appreciate helpful comments :)
> 
> Cheers,
> Thomas.

Cheers,
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759



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