Stroke¶
Overview¶
Data type
A stroke defines the visual appearance of a line.
Attributes (data)
Name |
Multiplicity |
Type |
|---|---|---|
1 |
||
1 |
||
1 |
Simplified Literals¶
Within this specification, a simplified type of literal is used to refer to a Stroke. This literal is composed of
a decimal representation of the Width, followed by
mm,the simplified literal of the Color of the Stroke (see Color),
The three components are separated by spaces.
For example, a Stroke with
is represented as 2mm #00ff00 Dot.
Mapping to SVG¶
A Stroke is mapped to a set of XML attributes, which are added to the SVG element (e.g., a svg:polygon or a svg:polyline element) that is drawn with the Stroke.
The Color of the Stroke is mapped to the
strokeattribute. For the attribute value, see the SVG mapping for Color.The DashStyle of the Stroke is mapped to the
stroke-dasharrayandstroke-dashoffsetattributes as described in the SVG mapping for DashStyle. Note that these attribute values depend on the Width of the Stroke and on the linecap of the GraphicalPrimitive that uses the Stroke.The Width of the Stroke is mapped to the
stroke-widthattribute. The attribute value is the concatenation of the string representation of the Width and the fixed stringmm. That is, in terms of [CSS Values 4] we use an absolute length with the unit millimeters.
Example
For examples, see the SVG mapping sections of those subclasses of GraphicalPrimitive that have a Stroke attribute:
Color¶
Attribute (data)
The color of the Stroke.
Multiplicity: 1
Type: Color
DashStyle¶
Attribute (data)
The dash style of the Stroke.
Multiplicity: 1
Type: DashStyle
Width¶
Attribute (data)
The width of the Stroke in mm.
Multiplicity: 1
Type: Double