[cairo] question about a conversion between XML and CairoScript
mpsuzuki at hiroshima-u.ac.jp
Mon Dec 17 15:06:03 UTC 2018
Recently I'm interested in whether the output of XML surface
could be converted to that of Script surface (CairoScript),
because the implementation of the parser for XML output looks
easier than that of CairoScript.
There are xml-to-trace and trace-to-xml in util/ subdirectly.
During a play with them, I found that: trace-to-xml seems
to be preserving all, but xml-to-trace seems to drop many info.
Also, I found sometimes the significant difference (between
XML and Script output) may happen.
In XML surface, _cairo_xml_emit_surface() tries to dump a
rasterized image, by using _cairo_surface_acquire_source_image()
(then _cairo_xml_emit_image() is called).
On the other hand, in Script surface, _emit_surface() does not
Considering such difference, I'm afraid that a round-trip
conversion between the outputs of XML and Script surfaces are
Am I misunderstanding?
If I understand correctly, for easy-to-parse format of replayable
data (I think, CairoScript is already proven to be replayable, but
XML is not), working with current XML surface is not the way to go?
Should I try to make an XML expression of CairoScript?
More information about the cairo