Template:Canvas Vector Image Guidelines

From FlightGear wiki
Jump to navigation Jump to search
Note  Here's some guidelines for people wanting to help with SVG images specifically for Canvas to avoid unnecessary work:
  • please use transparent backgrounds
  • no need to provide different labels/translations (can be done by Nasal/Canvas)
  • no need to provide different scales of symbols (can be done by Nasal/Canvas!)
  • no need to provide differently colored symbols (can be done by patching svg.nas to allow elements to be looked up !)
  • no need to provide different combinations of overlaid symbols (can be done by Nasal/Canvas via z-index!)
  • only use standard text elements, FlowText etc are not supported at the moment.
  • don't use the image tag (i.e. for referencing raster images or other SVG files), it's currently unsupported

Whenever something is "repeated" in an image, it should not be added, a placeholder will do, and we also don't need separate colors - these things can be done with two lines of Nasal code, so are quicker to do that way than having someone spend even just a minute on adding such details. So better to think in "building blocks": if we need to show a certain symbol/image in different places, just provide it once as a SVG element with its own lookup ID (using a good name will surely help).

The same goes for different sizes, colors or fonts obviously - and fonts in general (text) should probably not be added, because we would do that using Canvas, too - to keep it dynamic.

However, if you want something to be configurable, one important thing is having an element ID that we can refer to, in order to look up the key and modify the symbol via Nasal. Preferably, something that makes sense, i.e. is intuitive. Without having an element id (e.g. for labels) we cannot easily modify such SVG images procedurally.