[cairo] Unable to view Pango Cairo Layout

Rabia Sirhindi rabia.sirhindi at nu.edu.pk
Fri Jun 26 04:48:59 PDT 2009


I am working on pango and using cairo as a rendering backend. I wrote a
small program using some pango-cairo layout functions. The problem is that
even when I am able to compile the program successfully on an FC5 machine,
it does not show anything on screen. below is the code.

     #include <pango/pango.h>
        #include <pango/pangocairo.h>
        //#include <cairo/cairo.h>
        #define FONT "Sans Bold 20"

        int main (int argc, char *argv[]){
        PangoFontMap *fontmap;
        PangoContext *context;
        PangoLayout *layout;
        PangoFontDescription *font_desc;
        const char * text = "Display text in Arabic

        cairo_surface_t  *surface =
        cairo_t *cr = cairo_create (surface);
        cairo_set_source_rgb (cr,0.0,0.0,0.0);

        font_desc = pango_font_description_from_string(FONT);

        //fontmap = pango_cairo_font_map_get_default();
        //context = pango_cairo_font_map_create_context((PangoCairoFontMap

        layout = pango_cairo_create_layout(cr);
        pango_layout_set_text (layout, text, -1);
        pango_layout_set_font_description (layout, font_desc);



        g_print("Last line!");
        return 0;

Can anyone point out what am I missing? Thanks in advance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20090626/57457b3b/attachment.htm 

More information about the cairo mailing list