thanks for the quick reply,<br>here&#39;s the code:<br><br>#include &lt;cairo.h&gt;<br>#include &lt;math.h&gt;<br>#include &lt;stdio.h&gt;<br><br>int<br>main (int argc, char *argv[])<br>{<br>&nbsp;&nbsp;&nbsp; cairo_surface_t *surface;<br>
&nbsp;&nbsp;&nbsp; cairo_t *cr;<br>&nbsp;&nbsp;&nbsp; cairo_text_extents_t te;<br><br>&nbsp;&nbsp;&nbsp; /* Prepare drawing area */<br>&nbsp;&nbsp;&nbsp; //surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 240);<br>&nbsp;&nbsp;&nbsp; //cr = cairo_create (surface);<br>&nbsp;&nbsp;&nbsp; surface = cairo_image_surface_create_from_png(&quot;someimage.png&quot;);<br>
&nbsp;&nbsp;&nbsp; cr = cairo_create (surface);<br>&nbsp;&nbsp;&nbsp; /* Examples are in 1.0 x 1.0 coordinate space */<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cairo_set_line_width(cr, 5);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /* Drawing code goes here */<br>&nbsp;&nbsp;&nbsp; cairo_set_source_rgb (cr, 0.6, 0.9, 1.0);<br>
&nbsp;&nbsp;&nbsp; cairo_rectangle(cr, 25, 25, 100, 100);<br>&nbsp;&nbsp;&nbsp; cairo_fill(cr);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cairo_set_source_rgb (cr, 0.0, 0.0, 0.0 );<br>&nbsp;&nbsp;&nbsp; cairo_arc(cr, 75, 75, 50, 0, 2*M_PI);<br>&nbsp;&nbsp;&nbsp; cairo_stroke(cr);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cairo_move_to(cr, 50, 75);<br>
&nbsp;&nbsp;&nbsp; cairo_line_to(cr, 100, 75);<br>&nbsp;&nbsp;&nbsp; cairo_stroke(cr);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);<br>&nbsp;&nbsp;&nbsp; cairo_move_to(cr, 70, 75);<br>&nbsp;&nbsp;&nbsp; cairo_line_to(cr, 80, 75);<br>&nbsp;&nbsp;&nbsp; cairo_stroke(cr);<br><br>------------------<br>
&nbsp;&nbsp;&nbsp; up till here everything works fine<br>&nbsp;------------------<br><br>&nbsp;&nbsp;&nbsp; cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);<br>&nbsp;&nbsp;&nbsp; cairo_select_font_face (cr, &quot;sansserif&quot;,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);<br>
&nbsp;&nbsp;&nbsp; cairo_set_font_size (cr, 22);<br>&nbsp;&nbsp;&nbsp; cairo_text_extents (cr, &quot;ABC&quot;, &amp;te);<br>&nbsp;&nbsp;&nbsp; cairo_show_text (cr, &quot;ABC&quot;);<br>&nbsp;&nbsp; <br>--------------------<br>the part above isnt shown in the resulting png file<br>
--------------------<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  <br>&nbsp;&nbsp;&nbsp; /* Write output and clean up */<br>&nbsp;&nbsp;&nbsp; cairo_surface_write_to_png (surface, &quot;showtext.png&quot;);<br>&nbsp;&nbsp;&nbsp; cairo_destroy (cr);<br>&nbsp;&nbsp;&nbsp; cairo_surface_destroy (surface);<br><br>&nbsp;&nbsp;&nbsp; return 0;<br>
}<br><br><br><br>