diff 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
line wrap: on
line diff
--- a/tools/svg2code.py	Tue Mar 17 08:31:04 2009 +0800
+++ b/tools/svg2code.py	Fri Mar 27 13:07:50 2009 +0800
@@ -190,13 +190,17 @@
 
     if prop_map.has_key('stroke-width'):
         if prop_map['stroke-width'].endswith('px'):
-            stroke_width = float(prop_map['stroke-width'][:-2])
+            stroke_width = float(prop_map['stroke-width'][:-2]) / 2
         else:
-            stroke_width = float(prop_map['stroke-width'])
+            stroke_width = float(prop_map['stroke-width']) / 2
             pass
         print >> codefo, 'STROKE_WIDTH([%s], %f)dnl' % (
             node_id, stroke_width)
         pass
+    elif prop_map.has_key('stroke'):
+        print >> codefo, 'STROKE_WIDTH([%s], %f)dnl' % (
+            node_id, 0.5)
+        pass
 
     if prop_map.has_key('display'):
         display = prop_map['display'].strip().lower()