Oscar,

On Wed, 2010-04-07 at 16:56 +0200, Oscar Lazzarino wrote:
> On Wed, Apr 7, 2010 at 4:43 PM, Neil Roberts <n...@linux.intel.com> wrote:
> >
> > You can't call the cogl_pango_* functions using a layout created with a
> > regular pango context - instead it has to be a context created with the
> > special Cogl font map. The cogl_pango functions in cogl-pango.h are
> > meant to be public so it is safe to use them. The lack of documentation
> > is an oversight not an attempt to hide them.
> >
> > The usual way to paint custom text in an actor is to call
> > clutter_actor_create_pango_layout() and then render it with
> > cogl_pango_render_layout(). This will take advantage of the CoglPango
> > glyph cache and render the text from textures so it should be relatively
> > efficient.
> >
> > Hope that helps
> >
> > - Neil
> >
> 
> I did as you said, and it works :)
> 
> Actually, just out of curiosity, I also tried to create the Pango
> context like this
> 
>     PangoFontMap *lPangoFontMap = cogl_pango_font_map_new();
>     PangoContext *lPangoCtx = pango_font_map_create_context(lPangoFontMap);
> 
> and it also works.

Yes, it works. Your case is about interacting with Pango. Cogl is a
wrapper of GL and GLES calls, if you try with GL or GLES specific call,
you need a call to clutter_init to initialize the display.

> 
> Thanks to everyone who answered :)
> 
> O.

Regards,
-Hieu

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com

Reply via email to