Howto:Extend the Canvas SVG module: Difference between revisions

Jump to navigation Jump to search
Line 90: Line 90:


</syntaxhighlight>
</syntaxhighlight>
Whenever the parser now sees an image tag, it will tell us so saying: '''parsesvg: image tag encountered (not yet implemented)'''
The next step is actually mapping the SVG markup to the corresponding Nasal/Canvas code. For that, we need to take into account that, as per the SVG spec, an image tag may not only refer to raster images, but also other vector graphics (SVG files), which means that we need to look at the file extension - i.e. only add a raster image primitive (Canvas.Image) if the extension is not .svg:

Navigation menu