Canvas SVG parser: Difference between revisions

Jump to navigation Jump to search
 
Line 176: Line 176:


Shapes are also currently not exposed to Nasal, you'll typically want to use Inkscape's "simplify" option. Basic shapes like Line, Polygon, Rect, RoundedRect, Ellipse and Arc are available through the VGU Utility Library and could be implemented in Nasal directly by extending svg.nas to map SVG/XML primitives to the corresponding OpenVG primitives supported by Shiva/ShaderVG.
Shapes are also currently not exposed to Nasal, you'll typically want to use Inkscape's "simplify" option. Basic shapes like Line, Polygon, Rect, RoundedRect, Ellipse and Arc are available through the VGU Utility Library and could be implemented in Nasal directly by extending svg.nas to map SVG/XML primitives to the corresponding OpenVG primitives supported by Shiva/ShaderVG.
In the meantime, we should at the very least, look for unsupported primitives like these and show a corresponding error/hint, telling people to simplify their SVG files.
{{FGCquote
{{FGCquote
   |Learnt the hard way that SVG parsing (for ''svg_path'' in ''AA.symbol'') in FG doesn't recognize ''<circle>'', ''<ellipse>'', etc., so I opened my hand-coded SVG in Inkscape and used ''Path->Simplify'' (which ostensibly converts shapes to paths) to convert it to a code compatible with FG.
   |Learnt the hard way that SVG parsing (for ''svg_path'' in ''AA.symbol'') in FG doesn't recognize ''<circle>'', ''<ellipse>'', etc., so I opened my hand-coded SVG in Inkscape and used ''Path->Simplify'' (which ostensibly converts shapes to paths) to convert it to a code compatible with FG.

Navigation menu