Summary: | svg-print backend | ||
---|---|---|---|
Product: | cairo | Reporter: | Dom Lachowicz <domlachowicz> |
Component: | svg backend | Assignee: | Emmanuel Pacaud <emmanuel.pacaud> |
Status: | RESOLVED FIXED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | enhancement | ||
Priority: | high | Keywords: | patch |
Version: | 1.1.1 | ||
Hardware: | x86 (IA32) | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
patch to implement a svg-print backend
Updated patch Only emits <pageSet> if there is more than one page New patch - should fix compositing An new patch |
Description
Dom Lachowicz
2005-12-11 07:41:43 UTC
Created attachment 4068 [details] [review] patch to implement a svg-print backend FYI - this patch also corrects a small buglet - s/cairo_format_t/cairo_content_t Created attachment 4289 [details] [review] Updated patch Reassign to Emmanuel Hi Dom, I would be happy to add multi-page capability to SVG backend, but unfortunately, it seems inkscape currently doesn't support SVG-Print, and I really want to be able to open SVG files produced by cairo with it. An idea would be to stick to current output, and switch to SVG-Print as soon as document has more than one page. Hi Emmanuel, That sounds reasonable. I'll modify my patch to do this. Created attachment 4501 [details] [review] Only emits <pageSet> if there is more than one page This should hopefully be more to your liking. Hi Dom, Your patch breaks compositing of svg surfaces. + surface->xml_node = xmlNewChild (surface->document->xml_node_main, + NULL, CC2XML ("g"), NULL); When you had before: - surface->xml_node = xmlNewChild (surface->id == 0 ? - document->xml_node_main : - document->xml_node_defs, - NULL, CC2XML ("g"), NULL); And in one page svg, there's a useless <g> </g> around main surface. Otherwise, it's ok to commit. Created attachment 4504 [details] [review] New patch - should fix compositing The extra "g" around the content is a harmless artifact. I needed a node to put the whole page's content into before adding it to the <page> or <svg>, as appropriate. This patch should fix compositing of SVG surfaces. The new ID scheme for surfaces is "surface" + surface->id + "-" + number_of_pages. This way, we keep the surface0 == primary surface distinction, plus generate unique ids for each individual page. If you change naming convention here: + snprintf (buffer, sizeof buffer, "surface%d-%d", surface->id, + _cairo_array_num_elements (&surface->document->pages)); You also need to adapt this code: child = xmlNewChild (node, NULL, CC2XML("use"), NULL); snprintf (buffer, sizeof buffer, "#surface%d", surface->id); xmlSetProp (child, CC2XML ("xlink:href"), C2XML (buffer)); in emit_composite_svg_pattern() Not that creating a similar svg surface with cairo_surface_create_similar during drawing of one page, and painting it on an another page may happen, so you need to store the second id. Created attachment 7761 [details] [review] An new patch Pushed to master. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.