CSS Support

From Inkscape Wiki
Revision as of 01:39, 17 January 2005 by PeterMoulder (talk | contribs) (* first text)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Hack: Convert to style-less SVG

A short-term solution (hack) for style support would be an input filter that converts stylesheet-using documents to non-stylesheet-using documents. cssanno.c (see google) does most of the work for this (for a generic XML document); the remainder of the work is to feed it a stylesheet by parsing the SVG document looking for <style> elements and fetching external stylesheets, and to change the outputted namespace from css: to svg:.

Ideally change add_single_property to ignore properties other than SVG ones. I.e. add an array of names of SVG properties, and check whether name is in this list. A linear search should be fine, I'd guess, and it's not too difficult to change it to a hash table or use a pre-coded binary search routine (whether glib or STL).


Peter Moulder is looking at using libcroco from Inkscape. He expects to need help ensuring that updates happen properly (e.g. refreshing the picture when the stylesheet is edited from the XML editor).