Oscar Lazzarino <[email protected]> wrote: > Would it be possible to use cogl_pango outside of the clutter_text > actor (i.e. in a custom actor)? > > The cogl_pango functions are treated as private functions and not > documented, as far as I can see, and the "simple" approach > > PangoContext *lPangoCtx = pango_context_new(); > PangoLayout *lPangoLayout = pango_layout_new(lPangoCtx); > cogl_pango_render_layout(lPangoLayout, mWidth/2, mHeight/2, lWhite, 0); > > shows me the ellipse, but not the text.
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 -- To unsubscribe send a mail to [email protected]
