Hi,
we decided that the best way to unify serialization is via a C++ stream. I just checked in src/svg/stringstream.h which is a beginning of such a class that can be used already. If we use this class throughout, later it will be easy to change precision or number formatting globally for all SVG output, as well as to add custom serializers for our own classes.
An example of using this class is in function sp_svg_write_path() in svg-path.cpp. You declare a variable (os) of this class and then feed it with the data you need to serialize using <<. To access the result, you call os.gcharp() which returns const gchar * of the accummulated string, and you'll probably want to also do a g_strdup on it (depending on whether it's going to be used immediately in the same function, or returned or sent elsewhere).
So, if you're interested in helping out, you can start searching for printf functions that are used for serializing into SVG (in splivarot and in other places) and replace them with the stream stuff. Of course the first to replace are printfs that serialize floating point numbers. Please do one function at a time and test it thoroughly after the replacement. Do a test patch for one file, and if it works we can give you developer access to CVS to speed things up.
_________________________________________________________________ MSN Premium includes powerful parental controls and get 2 months FREE* http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI...