| 42 | | * The base size of svg should be 16px or larger than 64px. Images with a base size between 16 and 64 px will not be scaled down to 16px. |
| 43 | | * There are some svg libraries which do not work with JOSM (the images get deformed). If you have such a file try the following workaround: create a new svg document with Inkscape, copy the svg data to this new file, resize the page to the data and save. |
| 44 | | * Resize your icon to 16px or an integer multiple size of it (not something like 458.1534) to avoid display inaccuracies due to rounding errors within java. |
| 45 | | * Check the code of the file in a text editor. Search for **viewBox** value in the beginning of the file. If the icon is, for example, in 16x16 pixels, and if you made it in Inkscape (at least this happens in 0.91 version) and have defined in Document Properties 16,00000 by 16,00000 pixels, probably in the file code you have these values **viewBox="0 0 16.000002 16.000001"**. Change it to **viewBox="0 0 16 16"** or you will have problems (see #12201 and the fix [o31865]) |
| 46 | | * svg icons are automatically cleaned up to reduce file size in the JOSM build. So there is no need to do this step manually before uploading svg files to svn. See comment:35:ticket:10479, comment:10:ticket:10877 and ticket:12201#comment:21 Uncleaned svgs are better for further editing. |
| 47 | | * Due to a bug in svgcleaner however, the svg code shouldn't contain arguments starting with special characters in style codes e.g. `-inkscape-font-specification:Sans;`. This can lead to color changes (see #13158). |
| 48 | | * If the icon includes gradients, the offset needs to increase at every stop, i.e. two stops with the same offset are not allowed, see [https://github.com/blackears/svgSalamander/pull/4 svg salamander]. |
| 49 | | * CSS styles (`<style type="text/css">`) are not supported yet by svgSalamander. |
| 50 | | * If possible don't use text elements at all as this can lead to different display results based on e.g. os or installed fonts. To avoid this you can transform text into paths in the svg. |
| | 42 | * The base size of SVG should be 16px or larger than 64px. Images with a base size between 16 and 64px will not be scaled down to 16px. |
| | 43 | * There are some SVG libraries which do not work with JOSM (the images get deformed). If you have such a file try the following workaround: create a new SVG document with Inkscape, copy the SVG data to this new file, resize the page to the data and save. |
| | 44 | * Resize your icon to 16px or an integer multiple size of it (not something like 458.1534) to avoid display inaccuracies due to rounding errors within Java. |
| | 45 | * Check the code of the file in a text editor. Search for **viewBox** value in the beginning of the file. If the icon is, for example, in 16x16 pixels, and if you made it in Inkscape (at least this happens in 0.91 version) and have defined in Document Properties 16,00000 by 16,00000 pixels, probably in the file code you have these values **viewBox="0 0 16.000002 16.000001"**. Change it to **viewBox="0 0 16 16"** or there can be problems. |
| | 46 | * SVG icons are automatically cleaned up to reduce file size in the JOSM build. So there is no need to do this step manually before uploading SVG files to SVN. See comment:35:ticket:10479, comment:10:ticket:10877 and ticket:12201#comment:21 Uncleaned SVGs are better for further editing. |
| | 47 | * Due to a bug in svgcleaner however, the SVG code shouldn't contain arguments starting with special characters in style codes e.g. `-inkscape-font-specification:Sans;`. This can lead to color changes (see #13158). |
| | 48 | * Test this on a case-by-case basis: If the icon includes gradients, i.e. two stops with the same offset may cause errors. |
| | 49 | * Not all features of CSS styles (`<style type="text/css">`) are supported. |
| | 50 | * If possible don't use text elements at all as this can lead to different display results based on e.g. OS or installed fonts. To avoid this you can transform text into paths in the SVG. |
| | 51 | * The library JSVG may throw exceptions when processing broken or invalid SVG files. These images are broken, but may be displayed in other programs nevertheless. Unsupported features may be ignored or may also cause exceptions. |