Canvas SVG parser: Difference between revisions

Switched to {{gitorious source}} and {{fgdata source}} to fix the broken Gitorious links.
No edit summary
(Switched to {{gitorious source}} and {{fgdata source}} to fix the broken Gitorious links.)
Line 115: Line 115:
== Supported SVG features ==
== Supported SVG features ==


The SVG file used for this demo has been created using [http://inkscape.org Inkscape]. Using paths (also with linestipple/dasharray), text, groups and cloning is supported, but don't try to use more advanced features like gradients, as the SVG parser doesn't interpret every part of the SVG standard. (You can always have a look at the [https://gitorious.org/fg/fgdata/blobs/master/Nasal/canvas/svg.nas implementation] and also improve it if you want ;-) )
The SVG file used for this demo has been created using [http://inkscape.org Inkscape]. Using paths (also with linestipple/dasharray), text, groups and cloning is supported, but don't try to use more advanced features like gradients, as the SVG parser doesn't interpret every part of the SVG standard. (You can always have a look at the {{fgdata source|path=Nasal/canvas/svg.nas|text=implementation}} and also improve it if you want ;-) )




Line 135: Line 135:


{{FGCquote
{{FGCquote
   |Referring to the [https://gitorious.org/fg/canvas-hackers-fgdata/commit/7d249ce9556d52fb7ae066775023087fbd4daa2f#c106578 gitorious discussion about having a styleable SVGSymbol class] - that is something that will be hard to support/integrate with pre-defined styling unless we patch svg.nas to accept a list of optional SVG attributes that are mapped to a transformation/rewrite-callback so that SVG attributes can be dynamically "rewritten" by the parser based on looking up a certain id (e.g. "background-color") and changing CSS stuff there.  
   |Referring to the {{gitorious source|proj=fg|repo=canvas-hackers-fgdata|commit=7d249ce9556d52fb7ae066775023087fbd4daa2f|view=commit|text=gitorious discussion about having a styleable SVGSymbol class}} - that is something that will be hard to support/integrate with pre-defined styling unless we patch svg.nas to accept a list of optional SVG attributes that are mapped to a transformation/rewrite-callback so that SVG attributes can be dynamically "rewritten" by the parser based on looking up a certain id (e.g. "background-color") and changing CSS stuff there.  
   |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=209061#p209061
   |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=209061#p209061
     |title=<nowiki>MapStructure styling</nowiki>
     |title=<nowiki>MapStructure styling</nowiki>