Index: trunk/src/com/kitfox/svg/Text.java
===================================================================
--- trunk/src/com/kitfox/svg/Text.java	(revision 8084)
+++ trunk/src/com/kitfox/svg/Text.java	(revision 10787)
@@ -37,9 +37,7 @@
 
 import com.kitfox.svg.util.FontSystem;
-import com.kitfox.svg.util.TextBuilder;
 import com.kitfox.svg.xml.StyleAttribute;
 import java.awt.Graphics2D;
 import java.awt.Shape;
-import java.awt.font.FontRenderContext;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.GeneralPath;
@@ -51,5 +49,4 @@
 import java.util.regex.Pattern;
 
-//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
 /**
  * @author Mark McKay
@@ -265,20 +262,21 @@
     protected void buildText() throws SVGException
     {
-
         //Get font
-        Font font = diagram.getUniverse().getFont(fontFamily);
+        String[] families = fontFamily.split(",");
+        Font font = null;
+        for (int i = 0; i < families.length; ++i)
+        {
+            font = diagram.getUniverse().getFont(fontFamily);
+            if (font != null)
+            {
+                break;
+            }
+        }
+
         if (font == null)
         {
-//            System.err.println("Could not load font");
-
             font = new FontSystem(fontFamily, fontStyle, fontWeight, (int)fontSize);
-//            java.awt.Font sysFont = new java.awt.Font(fontFamily, style | weight, (int)fontSize);
-//            buildSysFont(sysFont);
-//            return;
-        }
-
-//        font = new java.awt.Font(font.getFamily(), style | weight, font.getSize());
-
-//        Area textArea = new Area();
+        }
+
         GeneralPath textPath = new GeneralPath();
         textShape = textPath;
@@ -286,48 +284,4 @@
         float cursorX = x, cursorY = y;
 
-        FontFace fontFace = font.getFontFace();
-        //int unitsPerEm = fontFace.getUnitsPerEm();
-        int ascent = fontFace.getAscent();
-        float fontScale = fontSize / (float) ascent;
-
-//        AffineTransform oldXform = g.getTransform();
-//        TextBuilder builder = new TextBuilder();
-//        
-//        for (Iterator it = content.iterator(); it.hasNext();)
-//        {
-//            Object obj = it.next();
-//
-//            if (obj instanceof String)
-//            {
-//                String text = (String) obj;
-//                if (text != null)
-//                {
-//                    text = text.trim();
-//                }
-//                
-//                for (int i = 0; i < text.length(); i++)
-//                {
-//                    String unicode = text.substring(i, i + 1);
-//                    MissingGlyph glyph = font.getGlyph(unicode);
-//                    
-//                    builder.appendGlyph(glyph);
-//                }
-//            }
-//            else if (obj instanceof Tspan)
-//            {
-//                Tspan tspan = (Tspan)obj;
-//                tspan.buildGlyphs(builder);
-//            }
-//        }
-//
-//        builder.formatGlyphs();
-        
-        
-
-                
-                
-        
-        
-        
         AffineTransform xform = new AffineTransform();
 
@@ -344,12 +298,8 @@
                 }
 
-                strokeWidthScalar = 1f / fontScale;
-
                 for (int i = 0; i < text.length(); i++)
                 {
                     xform.setToIdentity();
                     xform.setToTranslation(cursorX, cursorY);
-                    xform.scale(fontScale, fontScale);
-//                    g.transform(xform);
 
                     String unicode = text.substring(i, i + 1);
@@ -362,9 +312,6 @@
                         textPath.append(path, false);
                     }
-//                    else glyph.render(g);
-
-                    cursorX += fontScale * glyph.getHorizAdvX();
-
-//                    g.setTransform(oldXform);
+
+                    cursorX += glyph.getHorizAdvX();
                 }
 
