cairo_image_surface_create_from_png and pango_cairo_show_layout problem

View: New views
1 Messages — Rating Filter:   Alert me  

cairo_image_surface_create_from_png and pango_cairo_show_layout problem

by Ricchetti, Andrea :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I’m drawing a table using cairo.

On the cells I can put graphics or text (for text I’m using pangocairo).

 

I put graphics with:

 

pSurface = cairo_image_surface_create_from_png (guiSpec.TIcon.strValue);

w = cairo_image_surface_get_width (pSurface);

h = cairo_image_surface_get_height (pSurface);       

cairo_set_source_surface (m_pCairo, pSurface, x-(w/2), y-(h/2));

            cairo_paint (m_pCairo);

           cairo_surface_destroy (pSurface);           

 

I put text with:

(CPangoCairoWrapper ia a wrapper for pangocairo and it’s work fine).

 

    CPangoCairoWrapper *write;   

    int width, height;

    double cellwidth, cellheight;

  

    write = new CPangoCairoWrapper;      

    write->SetFont("FreeSans");   

    write->SetText(dataType->psz);        

    write->SetSize(dataType->size);

    write->SetColorText(dataType->color);  

    write->SetWeight(dataType->weight);

    write->GetTextExtension(&width, &height);

 

    cairo_move_to (m_pCairo, x-(width/2.), y-(height/2.));

    pango_cairo_show_layout(m_pCairo,  write->CA_PA_GetPangoLayout());  

   delete write;

 

The problem is:

If I put a graphic element on a cell of a row, nothing appear when I’ll try to insert a text on a different cell of the same row.

 

Can someone help me.

 

Thanks in advance,

Andrea

 


_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo