Layers

Likely the most common annoyance when exporting Illustrator artwork into SVG is the misshapen id values generated by the names in the Layers palette. As most designers think in plain English and not in possible XML-compatible id attribute values, the names used for each layer in the palette (which convert into an object or group's id value) often result in bizarre output.

When using Illustrator 9, any layer name with spaces will export with the text “_x_200_” replacing the space. As such, “Bldg 1 Window” will export as “Bldg_x_200_1_x_200_Window.” Such an oddity results in not only an addition of 7 bytes for each space in all of your layer names, but also nearly illegible id values. Figure 21.1 shows the bizarre results of leaving spaces ...

Get Sams Teach Yourself SVG in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.