<< Click to Display Table of Contents > 

SAMLight Manual > Import-Export > Import > SVG Import Supported Objects

SVG Import Supported Objects
Previous pageReturn to chapter overviewNext page

The SAMLight import filter for SVG files - SVG  -  Scalable Vector Graphics, SCAPS (*.svg) - is based on open source SVG++.

In the following tables, different attributes and elements of SVG files are listed. For the import filter, information is given if these attributes and elements are supported or not. Additional information on specific interpretation is also given in some cases.

note

These lists are not complete due to the complexity of the SVG file format.

 

Recommended SVG properties and import filter options:

Use SVG - SCAPS import filter with "Import with 96 dpi".

Don't use viewBox to avoid scaling.

Use elements with unit mm to get a 1:1 interpretation in SAMLight.

Use UTF-8 coding for the SVG

 

Coordinates and Units

"SVG - SCAPS" Import Filter

Units

supported units: 'em', 'px', 'pt', 'pc', 'cm', 'mm', 'in', '%' and unitless

not supported: 'ex'

Unitless coordiantes are interpreted as 'px'.

If the 'Import with 96 dpi' is checked, 'px' are converted to mm with 96 dpi

If the 'Import with 96 dpi' is not checked, 'px' are converted to mm with 25.4 dpi ('px' equals 'mm').

Coordinates of Elements

Coordiantes of elements are scaled by a factor.

Table 40: Coordinates and Units

 

Attributes of SVG Element

"SVG - SCAPS" Import Filter

Namespace <xmlns>

xmlns='http://www.w3.org/2000/svg' in SVG element is mandatory.

Viewport <width>, <height>

supported as reference for coordinates in '%'.

If the Viewport is not specified, a default Viewport of 100 px is set.

How the 'px' coordinates are converted to mm depends on the state of the 'Import with 96 dpi' checkbox, see table -1.

viewBox <viewBox>

supported for scaling and positioning.

viewBox origin shifts elements.

viewBox is unitless. How the unitless coordinates are converted to 'mm' depends on the state of the 'Import with 96 dpi' checkbox, see table -1.

In order to avoid scaling, the viewBox must not be specified or be of the same size as the Viewport.

Table 41: Attributes of SVG Element

Element Attributes

"SVG - SCAPS" Import Filter

Color of stroke and fill (for pen mapping)

The stroke color is used. 'Read Pen Info' must be checked.

Stroke none is treated as the default color black.

Fill color is usually ignored. Only when "import with default hatch style" is activated, elements with fill will be hatched.

If color of stroke and fill are both "none", the SVG element will not be imported at all. Default fill color is black.

CSS

supported

xml:space

not supported

Vertical alignment <dominant-baseline>

supported

Horizontal alignment <text-anchor>

supported. The text-anchor sets the horizontal alignment.

Default is used for start.

Em-Center is used for middle.

Em-Right is used for end.

<tspan>

supported

 

Font weight <font-weight>

partially supported

Normal is used for "lighter", "normal" and a number < 700.

Bold is used for "bold", "bolder" and a number >= 700.

Path attribute <d>

supported

Entity name of subgroups <id>

supported

"id" is used to name the sub-entities.

Transformation Matrices

supported

Filling

not supported

Stroking

not supported

color see above

Marker

not supported

Linking

not supported

Clipping, Masking, and Compositing

not supported

Table 42:  Attributes

Elements

"SVG - SCAPS" Import Filter

Path

supported

Use

not supported

Image

not supported

Unspecified

not supported

Embedded Font (<glyph>)

 

not supported

Basic shapes (<circle>, <ellipse>, <line>, <polygon>,

<polyline>, <rect>)

supported

 

Group (<g>)

supported

Text

supported

Em size and DirectWrite character generation is forced.

Text path <textPath>

not supported

Filter Effects

not supported

Gradients (<linearGradient>, <radialGradient>, <stop>)

not supported

Patterns

not supported

Interactivity

not supported

Hyperlink <a>

not supported

Animation (<animate>, <animateMotion>, <animateTransform>, <mpath>, <set>)

not supported

Table 43: Elements