[cairo-bugs] [Bug 14945] cairo_write_func_t isn't called when a call to cairo_show_page/cairo_copy_page is done

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 22 02:54:44 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=14945

--- Comment #2 from oliver.terbu at zuehlke.com ---
(In reply to comment #1)
> I guess it should be possible, by having a defs element before each page.

I ran into the same issue. Can you please explain your solution and how to
implement it?

cairo_status_t writeSvg(void *closure, const unsigned char *data, unsigned int
length)
{
  ...
}
...
void main() {
  cairo_surface_t *surface=0;
  cairo_t *cr=0;

  surface = cairo_svg_surface_create_for_stream(writeSvg, &truncated, 390, 60);
  cr = cairo_create(surface);

  cairo_set_source_rgb(cr, 0, 0, 0);
  cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
  cairo_set_font_size(cr, 40.0);

  cairo_move_to(cr, 10.0, 50.0);
  cairo_show_text(cr, "Hello World.");

  cairo_show_page(cr); // writeSvg not invoked here!

  cairo_move_to(cr, 10.0, 50.0);
  cairo_show_text(cr, "Knowledge is Power.");

  cairo_surface_destroy(surface);
  cairo_destroy(cr); // writeSvg invoked here!

  ...
}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20130522/96c03ca6/attachment.html>


More information about the cairo-bugs mailing list