On Tue, Apr 6, 2010 at 6:07 PM, Robert Bragg <[email protected]> wrote:
>
> The long term goal is for Cogl to become a standalone 3D graphics API
> and we are incrementally working towards this goal.
>
> Cogl will also have a window system abstraction (only as far as
> framebuffer management is concerned, I don't mean anything relating
> input events etc) that could make it possible to integrate tightly with
> GTK in one way or another.
>
> Integrating with a GL context not owned by Cogl adds additional
> complexity but theoretically it would be possible to create a Cogl
> winsys that allowed this.
>
> Sorry that doesn't really help you, but you might be interested to know
> it may be possible one day.
>
OK, let's try lowering the bar ;-)
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
CoglColor *lWhite = cogl_color_new();
cogl_color_set_from_4f(lWhite, 1.0, 1.0, 1.0, 1.0);
cogl_set_source_color(lWhite);
PangoContext *lPangoCtx = pango_context_new();
PangoFontDescription *lPangoFontDescr = pango_font_description_new();
pango_font_description_set_family(lPangoFontDescr, "Sans");
pango_font_description_set_size(lPangoFontDescr, 10 * PANGO_SCALE);
PangoLayout *lPangoLayout = pango_layout_new(lPangoCtx);
pango_layout_set_font_description(lPangoLayout, lPangoFontDescr);
pango_layout_set_text(lPangoLayout, "Sopra la panca la capra
campa", strlen("Sopra la panca la capra campa"));
cogl_pango_render_layout(lPangoLayout, mWidth/2, mHeight/2, lWhite, 0);
cogl_path_ellipse(mWidth/2.0, mHeight/2.0, mWidth/4.0, mHeight/4.0);
cogl_path_stroke();
cogl_color_free(lWhite);
shows me the ellipse, but not the text.
I get the message
(testCOGL:13610): CoglPango-CRITICAL **:
cogl_pango_get_renderer_from_context: assertion
`COGL_PANGO_IS_FONT_MAP (font_map)' failed
Any hints?
Thanks
O.
--
To unsubscribe send a mail to [email protected]