1 """
2 module for all attributes related to styling
3 """
4 """
5 Not supported as of yet.
6
7 * Interactivity properties:
8 o 'pointer-events'
9 * Multimedia properties:
10 o 'audio-level'
11 * Other properties for visual media:
12 o 'display'
13 o 'visibility'
14 Also testing is needed for all attributes !
15 working:
16
17 #toto gradient stuff must be seperated i think members for stopcolor etc here are idiotic
18
19 """
21 """ Helper Class to create a style_dict for those not familiar with svg attribute names.
22 """
25
26
27
29 self.style_dict["font-family"]=fontfamily
30
32 self.style_dict["font-size"]=fontsize
33
35 self.style_dict["font-style"]=fontstyle
36
38 self.style_dict["font-weight"]=fontweight
39
40
42 self.style_dict["fill"]=fill
43
45 self.style_dict["fill-opacity"]=fillopacity
46
48 self.style_dict["fill-rule"]=fillrule
49
51 self.style_dict["stroke-width"]=strokewidth
53 self.style_dict["stroke"]=stroke
54
55
57 self.style_dict["stroke-dasharray"]=strokedasharray
59 self.style_dict["stroke-dashoffset"]=strokedashoffset
61 self.style_dict["stroke-linecap"]=strikelinecap
63 self.style_dict["stroke-linejoin"]=strokelinejoin
65 self.style_dict["stroke-miterlimit"]=strokemiterlimit
67 self.style_dict["stroke-opacity"]=strokeopacity
68
69
70
72 self.style_dict["color"]=color
73
74
75
77 self.style_dict["stop-color"]=stopcolor
78
80 self.style_dict["stop-opacity"]=stopopacity
81
82
84 self.style_dict["color-rendering"]=colorrendering
85
87 self.style_dict["image-rendering"]=imagerendering
88
90 self.style_dict["shape-rendering"]=shaperendering
91
92 - def setTextRendering(self, textrendering):
93 self.style_dict["text-rendering"]=textrendering
94
96 self.style_dict["solid-color"]=solidcolor
97
99 self.style_dict["solid-opacity"]=solidopacity
100
101
103 self.style_dict["vector-effect"]=vectoreffect
104
106 self.style_dict["viewport-fill"]=viewportfill
107
108
110 self.style_dict["viewport-fill_opacity"]=viewportfillopacity
111
112
114 self.style_dict["display-align"]=displayalign
115
117 self.style_dict["line-increment"]=lineincrement
118
119 - def setTextAnchor(self, textanchor):
120 self.style_dict["text-anchor"]=textanchor
121
123 return self.style_dict
124