Mercurial > MadButterfly
comparison tools/svg2code.py @ 372:2212f515584c
Adjust stroke width to more close to rendering result of Inkscape
- The rendering result of Cairo for stroke is almost two-times wider than
Inkscape.
- Half stroke-wdith in svg2code.py.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 27 Mar 2009 13:07:50 +0800 |
parents | bdf36a26e420 |
children | 07ca7681f43b |
comparison
equal
deleted
inserted
replaced
371:3d21115297ba | 372:2212f515584c |
---|---|
188 % (stroke) | 188 % (stroke) |
189 pass | 189 pass |
190 | 190 |
191 if prop_map.has_key('stroke-width'): | 191 if prop_map.has_key('stroke-width'): |
192 if prop_map['stroke-width'].endswith('px'): | 192 if prop_map['stroke-width'].endswith('px'): |
193 stroke_width = float(prop_map['stroke-width'][:-2]) | 193 stroke_width = float(prop_map['stroke-width'][:-2]) / 2 |
194 else: | 194 else: |
195 stroke_width = float(prop_map['stroke-width']) | 195 stroke_width = float(prop_map['stroke-width']) / 2 |
196 pass | 196 pass |
197 print >> codefo, 'STROKE_WIDTH([%s], %f)dnl' % ( | 197 print >> codefo, 'STROKE_WIDTH([%s], %f)dnl' % ( |
198 node_id, stroke_width) | 198 node_id, stroke_width) |
199 pass | |
200 elif prop_map.has_key('stroke'): | |
201 print >> codefo, 'STROKE_WIDTH([%s], %f)dnl' % ( | |
202 node_id, 0.5) | |
199 pass | 203 pass |
200 | 204 |
201 if prop_map.has_key('display'): | 205 if prop_map.has_key('display'): |
202 display = prop_map['display'].strip().lower() | 206 display = prop_map['display'].strip().lower() |
203 if display == 'none': | 207 if display == 'none': |