10.1.3.2.2. SvgFormat¶
This modules implements the SVG file format.
References:
-
class
Patro.FileFormat.Svg.SvgFormat.
AltGlyph
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.DeltaMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Provides control over the glyphs used to render particular character data
-
__attributes__
= [FloatAttribute x, FloatAttribute y, FloatAttribute dx, FloatAttribute dy, FloatAttribute x, FloatAttribute y]¶
-
__tag__
= 'altGlyph'¶
-
dx
¶
-
dy
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
AltGlyphDef
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.IdMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a substitution set for glyphs
-
__attributes__
= [StringAttribute id, StringAttribute id]¶
-
__tag__
= 'altGlyphDef'¶
-
id
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
AltGlyphItem
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.IdMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a candidate set of glyph substitutions
-
__attributes__
= [StringAttribute id, StringAttribute id]¶
-
__tag__
= 'altGlyphItem'¶
-
id
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Anchor
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Creates a link around SVG elements
-
__attributes__
= []¶
-
__tag__
= 'a'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Animate
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines how an attribute of an element changes over time
-
__attributes__
= []¶
-
__tag__
= 'animate'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
AnimateMotion
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Causes a referenced element to move along a motion path
-
__attributes__
= []¶
-
__tag__
= 'animateMotion'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
AnimateTransform
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Animates a transformation attribute on a target element, thereby allowing animations to control translation, scaling, rotation and/or skewing
-
__attributes__
= []¶
-
__tag__
= 'animateTransform'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
CenterMixin
[source]¶ Bases:
object
-
__attributes__
= (FloatAttribute cx, FloatAttribute cy)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Circle
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.CenterMixin
,Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a circle
-
__attributes__
= [FloatAttribute cx, FloatAttribute cy, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, FloatAttribute r]¶
-
__tag__
= 'circle'¶
-
cx
¶
-
cy
¶
-
fill
¶
-
id
¶
-
r
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
ClipPath
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Clipping is about hiding what normally would be drawn. The stencil which defines what is and what isn’t drawn is called a clipping path
-
__attributes__
= []¶
-
__tag__
= 'clipPath'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
ColorMixin
[source]¶ Bases:
object
-
__attributes__
= (StringAttribute fill, StringAttribute stroke)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
ColorProfile
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Specifies a color profile description (when the document is styled using CSS)
-
__attributes__
= []¶
-
__tag__
= 'color-profile'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Cursor
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a platform-independent custom cursor
-
__attributes__
= [FloatAttribute x, FloatAttribute y, FloatAttribute x, FloatAttribute y]¶
-
__tag__
= 'cursor'¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Defs
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
A container for referenced elements
-
__attributes__
= []¶
-
__tag__
= 'defs'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
DeltaMixin
[source]¶ Bases:
object
-
__attributes__
= (FloatAttribute dx, FloatAttribute dy)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Desc
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
A text-only description for container elements or graphic elements in SVG (user agents may display the text as a tooltip)
-
__attributes__
= []¶
-
__tag__
= 'desc'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Ellipse
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.CenterMixin
,Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.StyleMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines an ellipse
-
__attributes__
= [FloatAttribute cx, FloatAttribute cy, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute style, FloatAttribute rx, FloatAttribute ry]¶
-
__tag__
= 'ellipse'¶
-
cx
¶
-
cy
¶
-
fill
¶
-
rx
¶
-
ry
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
FeBlend
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Composes two objects together according to a certain blending mode
-
__attributes__
= []¶
-
__tag__
= 'feBlend'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
FontMixin
[source]¶ Bases:
object
-
__attributes__
= (StringAttribute font_size, StringAttribute font_family)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Group
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.FontMixin
,Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Used to group together elements
-
__attributes__
= [StringAttribute font_size, StringAttribute font_family, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute clip_path, StringAttribute data_name]¶
-
__tag__
= 'g'¶
-
clip_path
¶
-
data_name
¶
-
fill
¶
-
font_family
¶
-
font_size
¶
-
id
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
IdMixin
[source]¶ Bases:
object
Core attribute
-
__attributes__
= (StringAttribute id,)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Image
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.SizeMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines an image
-
__attributes__
= [FloatAttribute x, FloatAttribute y, StringAttribute height, StringAttribute width, FloatAttribute x, FloatAttribute y]¶
-
__tag__
= 'image'¶
-
height
¶
-
width
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
InheritAttribute
(py_attribute, xml_attribute=None, default=None)[source]¶
-
class
Patro.FileFormat.Svg.SvgFormat.
Line
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a line
-
__attributes__
= [StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, FloatAttribute x1, FloatAttribute y1, FloatAttribute x2, FloatAttribute y2]¶
-
__tag__
= 'line'¶
-
fill
¶
-
id
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
x1
¶
-
x2
¶
-
y1
¶
-
y2
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
LinearGradient
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.IdMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a linear gradient. Linear gradients fill the object by using a vector, and can be defined as horizontal, vertical or angular gradients.
-
__attributes__
= [StringAttribute id, StringAttribute id]¶
-
__tag__
= 'linearGradient'¶
-
id
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Marker
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Markers can be placed on the vertices of lines, polylines, polygons and paths. These elements can use the marker attributes “marker-start”, “marker-mid” and “marker-end”’ which inherit by default or can be set to ‘none’ or the URI of a defined marker. You must first define the marker before you can reference it via its URI. Any kind of shape can be put inside marker. They are drawn on top of the element they are attached to markerUnits=“‘strokeWidth’ or ‘userSpaceOnUse’. If ‘strokeWidth’ is used then one unit equals one stroke width. Otherwise, the marker does not scale and uses the the same view units as the referencing element (default ‘strokeWidth’)
-
__attributes__
= []¶
-
__tag__
= 'marker'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Mask
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.SizeMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Masking is a combination of opacity values and clipping. Like clipping you can use shapes, text or paths to define sections of the mask. The default state of a mask is fully transparent which is the opposite of clipping plane. The graphics in a mask sets how opaque portions of the mask are
-
__attributes__
= [FloatAttribute x, FloatAttribute y, StringAttribute height, StringAttribute width, FloatAttribute x, FloatAttribute y]¶
-
__tag__
= 'mask'¶
-
height
¶
-
width
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
NumberAttribute
(py_attribute, xml_attribute=None, default=None)[source]¶
-
class
Patro.FileFormat.Svg.SvgFormat.
Path
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a path
-
__attributes__
= [StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, PathDataAttribute path_data, FloatAttribute path_length]¶
-
__tag__
= 'path'¶
-
fill
¶
-
id
¶
-
path_data
¶
-
path_length
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
PathDataAttribute
(py_attribute, xml_attribute=None, default=None)[source]¶ Bases:
Patro.Common.Xml.Objectivity.StringAttribute
Define a path data attribute.
Path data can contain newline characters and thus can be broken up into multiple lines to improve readability. Because of line length limitations with certain related tools, it is recommended that SVG generators split long path data strings across multiple lines, with each line not exceeding 255 characters. Also note that newline characters are only allowed at certain places within path data.
The syntax of path data is concise in order to allow for minimal file size and efficient downloads, since many SVG files will be dominated by their path data. Some of the ways that SVG attempts to minimize the size of path data are as follows:
- All instructions are expressed as one character (e.g., a moveto is expressed as an M).
- 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”).
- The command letter can be eliminated on subsequent commands if the same command is used multiple times in a row (e.g., you can drop the second “L” in “M 100 200 L 200 100 L -100 -200” and use “M 100 200 L 200 100 -100 -200” instead).
- Relative versions of all commands are available (uppercase means absolute coordinates, lowercase means relative coordinates).
- Alternate forms of lineto are available to optimize the special cases of horizontal and vertical lines (absolute and relative).
- Alternate forms of curve are available to optimize the special cases where some of the control points on the current segment can be determined automatically from the control points on the previous segment.
The following commands are available for path data:
- Move to M x y m dx dy
- Line to L x y l dx dy
- Horizontal Line to H x h dx
- Vertical Line to V y v dy
- Cubic Bézier Curve C x1 y1, x2 y2, x y c dx1 dy1, dx2 dy2, dx dy
- Smooth Cubic Bézier Curve S x2 y2, x y s dx2 dy2, dx dy”
- Quadratic Bézier Curve Q x1 y1, x y q dx1 dy1, dx dy
- Smooth Quadratic Bézier Curve T x y t dx dy
- Elliptical Arc A rx ry x-axis-rotation large-arc-flag sweep-flag x y a rx ry x-axis-rotation large-arc-flag sweep-flag dx dy
- Close Path Z
-
COMMANDS
= 'mlhvcsqtaz'¶
-
NUMBER_OF_ARGS
= {'a': 7, 'c': 6, 'h': 1, 'l': 2, 'm': 2, 'q': 4, 's': 4, 't': 3, 'v': 1, 'z': 0}¶
-
_logger
= <Logger Patro.FileFormat.Svg.SvgFormat.PathDataAttribute (WARNING)>¶
-
class
Patro.FileFormat.Svg.SvgFormat.
PathMixin
[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.ColorMixin
,Patro.FileFormat.Svg.SvgFormat.StrokeMixin
-
class
Patro.FileFormat.Svg.SvgFormat.
Pattern
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.IdMixin
,Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.SizeMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines the coordinates you want the view to show and the size of the view. Then you add shapes into your pattern. The pattern repeats when an edge of the view box (viewing area) is hit
-
__attributes__
= [StringAttribute id, FloatAttribute x, FloatAttribute y, StringAttribute height, StringAttribute width, StringAttribute id]¶
-
__tag__
= 'pattern'¶
-
height
¶
-
id
¶
-
width
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
PercentLengthAttribute
(py_attribute, xml_attribute=None, default=None)[source]¶
-
class
Patro.FileFormat.Svg.SvgFormat.
PointsMixin
[source]¶ Bases:
object
-
__attributes__
= (StringAttribute points,)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Polygon
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.Polyline
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines any shape that consists of only straight lines
-
__attributes__
= [StringAttribute points, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute points, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute points, StringAttribute points, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute points]¶
-
__tag__
= 'polyline'¶
-
fill
¶
-
id
¶
-
points
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Polyline
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PointsMixin
,Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a graphic that contains at least three sides
-
__attributes__
= [StringAttribute points, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute points]¶
-
__tag__
= 'polyline'¶
-
fill
¶
-
id
¶
-
points
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
PositionMixin
[source]¶ Bases:
object
-
__attributes__
= (FloatAttribute x, FloatAttribute y)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
PresentationAttributes
[source]¶ Bases:
object
-
alignment_baseline
= None¶
-
baseline_shift
= None¶
-
clip
= None¶
-
clip_path
= None¶
-
clip_rule
= None¶
-
color
= None¶
-
color_interpolation
= None¶
-
color_interpolation_filters
= None¶
-
color_profile
= None¶
-
color_rendering
= None¶
-
cursor
= None¶
-
direction
= None¶
-
display
= None¶
-
dominant_baseline
= None¶
-
enable_background
= None¶
-
fill
= None¶
-
fill_opacity
= 1¶
-
fill_rule
= 'nonzero'¶
-
flood_color
= None¶
-
flood_opacity
= None¶
-
font_family
= None¶
-
font_size
= None¶
-
font_size_adjust
= None¶
-
font_stretch
= None¶
-
font_style
= None¶
-
font_variant
= None¶
-
font_weight
= None¶
-
glyph_orientation_horizontal
= None¶
-
glyph_orientation_vertical
= None¶
-
image_rendering
= None¶
-
kerning
= None¶
-
letter_spacing
= None¶
-
lighting_color
= None¶
-
marker_end
= None¶
-
marker_mid
= None¶
-
marker_start
= None¶
-
mask
= None¶
-
opacity
= 1¶
-
overflow
= None¶
-
paint_order
= None¶
-
pointer_events
= None¶
-
shape_rendering
= None¶
-
stop_color
= None¶
-
stop_opacity
= None¶
-
stroke
= None¶
-
stroke_dasharray
= None¶
-
stroke_dashoffset
= None¶
-
stroke_linecap
= 'butt'¶
-
stroke_linejoin
= 'miter'¶
-
stroke_miterlimit
= 4¶
-
stroke_opacity
= 1¶
-
stroke_width
= 1¶
-
style
= None¶
-
text_anchor
= None¶
-
text_decoration
= None¶
-
text_rendering
= None¶
-
transform
= AffineTransformation2D[[1. 0. 0.] [0. 1. 0.] [0. 0. 1.]]¶
-
unicode_bidi
= None¶
-
vector_effect
= None¶
-
visibility
= None¶
-
word_spacing
= None¶
-
writing_mode
= None¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
RadialGradient
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a radial gradient. Radial gradients are created by taking a circle and smoothly changing values between gradient stops from the focus point to the outside radius.
-
__attributes__
= []¶
-
__tag__
= 'radialGradient'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
RadiusMixin
[source]¶ Bases:
object
-
__attributes__
= (FloatAttribute rx, FloatAttribute ry)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Rect
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.RadiusMixin
,Patro.FileFormat.Svg.SvgFormat.SizeMixin
,Patro.FileFormat.Svg.SvgFormat.PathMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Defines a rectangle
-
__attributes__
= [FloatAttribute x, FloatAttribute y, FloatAttribute rx, FloatAttribute ry, StringAttribute height, StringAttribute width, StringAttribute fill, StringAttribute stroke, StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, FloatAttribute x, FloatAttribute y]¶
-
__tag__
= 'rect'¶
-
fill
¶
-
geometry
¶
-
height
¶
-
id
¶
-
rx
¶
-
ry
¶
-
stroke
¶
-
stroke_dasharray
¶
-
stroke_line_cap
¶
-
stroke_line_join
¶
-
stroke_miter_limit
¶
-
stroke_width
¶
-
style
¶
-
transform
¶
-
width
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
SizeMixin
[source]¶ Bases:
object
-
__attributes__
= (StringAttribute height, StringAttribute width)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Stop
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
The stops for a gradient
-
__attributes__
= []¶
-
__tag__
= 'stop'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
StrokeMixin
[source]¶ Bases:
object
-
LINE_CAP_STYLE
= ('butt', 'round', 'square', 'inherit')¶
-
LINE_JOIN_STYLE
= ('miter', 'round', 'bevel', 'inherit')¶
-
__attributes__
= (StringAttribute stroke_line_cap, StringAttribute stroke_line_join, NumberAttribute stroke_miter_limit, PercentLengthAttribute stroke_width, FloatListAttribute stroke_dasharray)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Style
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.TextXmlObjectAdaptator
Defines style
-
__attributes__
= []¶
-
__tag__
= 'style'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
StyleMixin
[source]¶ Bases:
object
-
__attributes__
= (StringAttribute style,)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Svg
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.SizeMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Creates an SVG document fragment
-
__attributes__
= [FloatAttribute x, FloatAttribute y, StringAttribute height, StringAttribute width, StringAttribute version, FloatListAttribute view_box, StringAttribute preserve_aspect_ratio, StringAttribute zoom_and_pan]¶
-
__tag__
= 'svg'¶
-
height
¶
-
preserve_aspect_ratio
¶
-
version
¶
-
view_box
¶
-
width
¶
-
x
¶
-
y
¶
-
zoom_and_pan
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
SvgElementMixin
[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.IdMixin
,Patro.FileFormat.Svg.SvgFormat.StyleMixin
,Patro.FileFormat.Svg.SvgFormat.TransformMixin
-
class
Patro.FileFormat.Svg.SvgFormat.
Text
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.DeltaMixin
,Patro.FileFormat.Svg.SvgFormat.FontMixin
,Patro.FileFormat.Svg.SvgFormat.ColorMixin
,Patro.FileFormat.Svg.SvgFormat.SvgElementMixin
,Patro.Common.Xml.Objectivity.TextXmlObjectAdaptator
Defines a text
-
__attributes__
= [FloatAttribute x, FloatAttribute y, FloatAttribute dx, FloatAttribute dy, StringAttribute font_size, StringAttribute font_family, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute _class, StringAttribute style]¶
-
__tag__
= 'text'¶
-
_class
¶
-
dx
¶
-
dy
¶
-
fill
¶
-
font_family
¶
-
font_size
¶
-
id
¶
-
stroke
¶
-
style
¶
-
transform
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
TextRef
(*args, **kwargs)[source]¶ Bases:
Patro.Common.Xml.Objectivity.XmlObjectAdaptator
References any <text> element in the SVG document and reuse it
-
__attributes__
= []¶
-
__tag__
= 'tref'¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
TextSpan
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.Text
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Identical to the <text> element but can be nested inside text tags and inside itself
-
__attributes__
= [FloatAttribute x, FloatAttribute y, FloatAttribute dx, FloatAttribute dy, StringAttribute font_size, StringAttribute font_family, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute id, StringAttribute style, TransformAttribute transform, FloatAttribute x, FloatAttribute y, FloatAttribute dx, FloatAttribute dy, StringAttribute font_size, StringAttribute font_family, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute _class, StringAttribute style, FloatAttribute x, FloatAttribute y, FloatAttribute dx, FloatAttribute dy, StringAttribute font_size, StringAttribute font_family, StringAttribute fill, StringAttribute stroke, StringAttribute id, StringAttribute style, TransformAttribute transform, StringAttribute id, StringAttribute _class, StringAttribute style]¶
-
__tag__
= 'textspan'¶
-
_class
¶
-
dx
¶
-
dy
¶
-
fill
¶
-
font_family
¶
-
font_size
¶
-
id
¶
-
stroke
¶
-
style
¶
-
transform
¶
-
x
¶
-
y
¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
TransformAttribute
(py_attribute, xml_attribute=None, default=None)[source]¶ Bases:
Patro.Common.Xml.Objectivity.StringAttribute
-
TRANSFORM
= ('matrix', 'rotate', 'scale', 'skewX', 'skewY', 'translate')¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
TransformMixin
[source]¶ Bases:
object
-
__attributes__
= (TransformAttribute transform,)¶
-
-
class
Patro.FileFormat.Svg.SvgFormat.
Use
(*args, **kwargs)[source]¶ Bases:
Patro.FileFormat.Svg.SvgFormat.PositionMixin
,Patro.FileFormat.Svg.SvgFormat.SizeMixin
,Patro.Common.Xml.Objectivity.XmlObjectAdaptator
Uses a URI to reference a <g>, <svg> or other graphical element with a unique id attribute and replicate it. The copy is only a reference to the original so only the original exists in the document. Any change to the original affects all copies.
-
__attributes__
= [FloatAttribute x, FloatAttribute y, StringAttribute height, StringAttribute width, FloatAttribute x, FloatAttribute y]¶
-
__tag__
= 'use'¶
-
height
¶
-
width
¶
-
x
¶
-
y
¶
-