Index: trunk/src/com/kitfox/svg/Tspan.java
===================================================================
--- trunk/src/com/kitfox/svg/Tspan.java	(revision 7676)
+++ trunk/src/com/kitfox/svg/Tspan.java	(revision 8083)
@@ -36,4 +36,5 @@
 package com.kitfox.svg;
 
+import com.kitfox.svg.util.FontSystem;
 import com.kitfox.svg.xml.StyleAttribute;
 import java.awt.Graphics2D;
@@ -168,20 +169,4 @@
     public void appendToShape(GeneralPath addShape, Point2D cursor) throws SVGException
     {
-//        if (x != null)
-//        {
-//            cursorX = x[0];
-//        } else if (dx != null)
-//        {
-//            cursorX += dx[0];
-//        }
-//
-//        if (y != null)
-//        {
-//            cursorY = y[0];
-//        } else if (dy != null)
-//        {
-//            cursorY += dy[0];
-//        }
-
         StyleAttribute sty = new StyleAttribute();
 
@@ -203,4 +188,39 @@
         {
             letterSpacing = sty.getFloatValueWithUnits();
+        }
+
+        int fontStyle = 0;
+        if (getStyle(sty.setName("font-style")))
+        {
+            String s = sty.getStringValue();
+            if ("normal".equals(s))
+            {
+                fontStyle = Text.TXST_NORMAL;
+            } else if ("italic".equals(s))
+            {
+                fontStyle = Text.TXST_ITALIC;
+            } else if ("oblique".equals(s))
+            {
+                fontStyle = Text.TXST_OBLIQUE;
+            }
+        } else
+        {
+            fontStyle = Text.TXST_NORMAL;
+        }
+
+        int fontWeight = 0;
+        if (getStyle(sty.setName("font-weight")))
+        {
+            String s = sty.getStringValue();
+            if ("normal".equals(s))
+            {
+                fontWeight = Text.TXWE_NORMAL;
+            } else if ("bold".equals(s))
+            {
+                fontWeight = Text.TXWE_BOLD;
+            }
+        } else
+        {
+            fontWeight = Text.TXWE_NORMAL;
         }
 
@@ -210,6 +230,7 @@
         if (font == null)
         {
-            addShapeSysFont(addShape, font, fontFamily, fontSize, letterSpacing, cursor);
-            return;
+            font = new FontSystem(fontFamily, fontStyle, fontWeight, (int)fontSize);
+//            addShapeSysFont(addShape, font, fontFamily, fontSize, letterSpacing, cursor);
+//            return;
         }
 
@@ -275,59 +296,59 @@
     }
 
-    private void addShapeSysFont(GeneralPath addShape, Font font,
-        String fontFamily, float fontSize, float letterSpacing, Point2D cursor)
-    {
-
-        java.awt.Font sysFont = new java.awt.Font(fontFamily, java.awt.Font.PLAIN, (int) fontSize);
-
-        FontRenderContext frc = new FontRenderContext(null, true, true);
-        String renderText = this.text.trim();
-
-        AffineTransform xform = new AffineTransform();
-
-        float cursorX = (float)cursor.getX();
-        float cursorY = (float)cursor.getY();
-//        int i = 0;
-        for (int i = 0; i < renderText.length(); i++)
-        {
-            if (x != null && i < x.length)
-            {
-                cursorX = x[i];
-            } else if (dx != null && i < dx.length)
-            {
-                cursorX += dx[i];
-            }
-
-            if (y != null && i < y.length)
-            {
-                cursorY = y[i];
-            } else if (dy != null && i < dy.length)
-            {
-                cursorY += dy[i];
-            }
-//            i++;
-            
-            xform.setToIdentity();
-            xform.setToTranslation(cursorX, cursorY);
-            if (rotate != null)
-            {
-                xform.rotate(rotate[Math.min(i, rotate.length - 1)]);
-            }
-
-//            String unicode = renderText.substring(i, i + 1);
-            GlyphVector textVector = sysFont.createGlyphVector(frc, renderText.substring(i, i + 1));
-            Shape glyphOutline = textVector.getGlyphOutline(0);
-            GlyphMetrics glyphMetrics = textVector.getGlyphMetrics(0);
-
-            glyphOutline = xform.createTransformedShape(glyphOutline);
-            addShape.append(glyphOutline, false);
-
-
-//            cursorX += fontScale * glyph.getHorizAdvX() + letterSpacing;
-            cursorX += glyphMetrics.getAdvance() + letterSpacing;
-        }
-        
-        cursor.setLocation(cursorX, cursorY);
-    }
+//    private void addShapeSysFont(GeneralPath addShape, Font font,
+//        String fontFamily, float fontSize, float letterSpacing, Point2D cursor)
+//    {
+//
+//        java.awt.Font sysFont = new java.awt.Font(fontFamily, java.awt.Font.PLAIN, (int) fontSize);
+//
+//        FontRenderContext frc = new FontRenderContext(null, true, true);
+//        String renderText = this.text.trim();
+//
+//        AffineTransform xform = new AffineTransform();
+//
+//        float cursorX = (float)cursor.getX();
+//        float cursorY = (float)cursor.getY();
+////        int i = 0;
+//        for (int i = 0; i < renderText.length(); i++)
+//        {
+//            if (x != null && i < x.length)
+//            {
+//                cursorX = x[i];
+//            } else if (dx != null && i < dx.length)
+//            {
+//                cursorX += dx[i];
+//            }
+//
+//            if (y != null && i < y.length)
+//            {
+//                cursorY = y[i];
+//            } else if (dy != null && i < dy.length)
+//            {
+//                cursorY += dy[i];
+//            }
+////            i++;
+//            
+//            xform.setToIdentity();
+//            xform.setToTranslation(cursorX, cursorY);
+//            if (rotate != null)
+//            {
+//                xform.rotate(rotate[Math.min(i, rotate.length - 1)]);
+//            }
+//
+////            String unicode = renderText.substring(i, i + 1);
+//            GlyphVector textVector = sysFont.createGlyphVector(frc, renderText.substring(i, i + 1));
+//            Shape glyphOutline = textVector.getGlyphOutline(0);
+//            GlyphMetrics glyphMetrics = textVector.getGlyphMetrics(0);
+//
+//            glyphOutline = xform.createTransformedShape(glyphOutline);
+//            addShape.append(glyphOutline, false);
+//
+//
+////            cursorX += fontScale * glyph.getHorizAdvX() + letterSpacing;
+//            cursorX += glyphMetrics.getAdvance() + letterSpacing;
+//        }
+//        
+//        cursor.setLocation(cursorX, cursorY);
+//    }
 
     public void render(Graphics2D g) throws SVGException
