plugins/raphael.export.js
authorAlan Knowles <alan@roojs.com>
Mon, 23 Jul 2012 07:17:02 +0000 (15:17 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 23 Jul 2012 07:17:02 +0000 (15:17 +0800)
plugins/raphael.export.js

index 76aac66..c48e139 100644 (file)
        */
        function styleToString(style) {
                // TODO figure out what is 'normal'
-               return 'font: normal normal normal 10px/normal ' + style.font.family +
-            ( style.font.size === null ? '' : '; font-size: ' + style.font.size + 'px' );
+        
+        var r = [
+                'font-family:' + style.font.family,
+                'font-weight:normal',
+                'font-style:normal',
+                'font-stretch:normal',
+                'font-variant:normal'
+        ];
+        if (style.font.size !== null ) {
+                r.push('font-size: ' + style.font.size + 'px') 
+        }
+        
+        return r.join(';')
+        
        }
 
        /**