SVG

support for the SVG file format. Part of wslib


** requires XML quark **

 

Reads and writes SVG files. SVG is an XML-based format for vector graphics, which can be read by most popular graphic vector applications. SVG filea can also be viewed by some web browsers, in some cases with a plugin.The Class is based on the SVG1.1 specification as found on the w3c site

 (http://www.w3.org/TR/SVG11/) and checked with Adobe's SVG web-browser plugin and Adobe Illustrator®.

 The aim is to be able to display svg files and extract their contents for use in sc, and vice versa (encode and export). The export can be useful for scoring sc events and generating visual feedback from objects. 

 

 The SVG standard is only partially implemented in this class; there are a lot more types of possible elements. Since many functions of SVG 1.1 can not be visualized by the SC graphic system anyway. For example: gradients, style sheets, markers, filter effects, animation, dotted lines, clipping paths, embedded fonts and hyperlinks are currently not supported. This might cause errors or plotting differences when reading some SVG files. Some objects are still read and even saved as SVGUnknown objects.

 

The Pen class methods in sc look a lot like the instructions found in SVG files, so almost all vector elements can be drawn in SCWindows using the dedicated plot methods. SVGFiles and SVGObjects can even be converted to GUI.pen style code using asGUICode. This also works the other way around; by using asSVGFile on a GUI.pen style coded drawHook function.


SVGFile     SVGLine

SVGObject     SVGRect

SVGGroup SVGCircle

SVGText SVGEllipse 

SVGTSpan SVGPolyLine 

SVGPath SVGPolygon

SVGPathSegment SVGTransform