Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commas in SVG path descriptions

Tags:

svg

People also ask

How does SVG define path?

A path is defined in SVG using the 'path' element. The basic shapes are all described in terms of what their equivalent path is, which is what their shape is as a path. (The equivalent path of a 'path' element is simply the path itself.)

What tag is used to define a path using SVG?

SVG Path - <path> The <path> element is used to define a path.


Commas are mostly optional and whitespace is also mostly optional. You need one or the other in some cases to say when something ends and the next thing begins i.e. so that 1,1 or 1 1 is not parsed as 11.

You can put a single comma between any two numbers so A, 30 50 0 0 1 162.55 162.45 is invalid as is A 30,, 50 0 0 1 162.55 162.45


The W3C SVG Recommendation states that:

Superfluous white space and separators such as commas can be eliminated (e.g., "M 100 100 L 200 200" contains unnecessary spaces and could be expressed more compactly as "M100 100L200 200").