You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by cj...@apache.org on 2001/04/03 10:28:52 UTC

cvs commit: xml-batik/sources/org/apache/batik/svggen SVGFont.java

cjolif      01/04/03 01:28:51

  Modified:    sources/org/apache/batik/svggen SVGFont.java
  Log:
  fix some compilation problems +
  remove some useless import statements
  
  Revision  Changes    Path
  1.11      +15 -14    xml-batik/sources/org/apache/batik/svggen/SVGFont.java
  
  Index: SVGFont.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGFont.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SVGFont.java	2001/04/03 08:07:55	1.10
  +++ SVGFont.java	2001/04/03 08:28:50	1.11
  @@ -9,10 +9,9 @@
   package org.apache.batik.svggen;
   
   import java.awt.Font;
  -import java.awt.GraphicsEnvironment;
  -import java.util.*;
  +import java.util.Hashtable;
  +import java.util.Map;
   import java.awt.font.TextAttribute;
  -import org.w3c.dom.*;
   
   import org.apache.batik.ext.awt.g2d.GraphicContext;
   
  @@ -20,8 +19,9 @@
    * Utility class that converts a Font object into a set of SVG
    * font attributes
    *
  + * @author <a href="mailto:cjolif@ilog.fr">Christophe Jolif</a>
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGFont.java,v 1.10 2001/04/03 08:07:55 cjolif Exp $
  + * @version $Id: SVGFont.java,v 1.11 2001/04/03 08:28:50 cjolif Exp $
    */
   public class SVGFont extends AbstractSVGConverter {
       public static final float EXTRA_LIGHT =
  @@ -142,7 +142,7 @@
           String fontSize = "" + font.getSize();
           String fontWeight = weightToSVG(font);
           String fontStyle = styleToSVG(font);
  -        String fontFamilyStr = familtyToSVG(font);
  +        String fontFamilyStr = familyToSVG(font);
           return new SVGFontDescriptor(fontSize, fontWeight,
                                        fontStyle, fontFamilyStr);
       }
  @@ -155,7 +155,7 @@
           String fontFamilyStr = font.getFamily();
           String logicalFontFamily =
               (String)logicalFontMap.get(font.getName().toLowerCase());
  -        if (logicalFontFamily() != null)
  +        if (logicalFontFamily != null)
               fontFamilyStr = logicalFontFamily;
           else {
               StringBuffer fontFamily = new StringBuffer("'");
  @@ -163,6 +163,7 @@
               fontFamily.append("'");
               fontFamilyStr = fontFamily.toString();
           }
  +        return fontFamilyStr;
       }
   
       /**
  @@ -173,8 +174,8 @@
           Map attrMap = font.getAttributes();
           Float styleValue = (Float)attrMap.get(TextAttribute.POSTURE);
   
  -        if(styleValue == null){
  -            if(font.isItalic())
  +        if (styleValue == null) {
  +            if (font.isItalic())
                   styleValue = TextAttribute.POSTURE_OBLIQUE;
               else
                   styleValue = TextAttribute.POSTURE_REGULAR;
  @@ -183,8 +184,8 @@
           float style = styleValue.floatValue();
   
           int i = 0;
  -        for(i=0; i<fontStyles.length; i++){
  -            if(style<=fontStyles[i])
  +        for (i=0; i< fontStyles.length; i++) {
  +            if (style <= fontStyles[i])
                   break;
           }
   
  @@ -199,8 +200,8 @@
       public static String weightToSVG(Font font) {
           Map attrMap = font.getAttributes();
           Float weightValue = (Float)attrMap.get(TextAttribute.WEIGHT);
  -        if(weightValue==null){
  -            if(font.isBold())
  +        if (weightValue==null) {
  +            if (font.isBold())
                   weightValue = TextAttribute.WEIGHT_BOLD;
               else
                   weightValue = TextAttribute.WEIGHT_REGULAR;
  @@ -209,8 +210,8 @@
           float weight = weightValue.floatValue();
   
           int i = 0;
  -        for(i=0; i<fontWeights.length; i++){
  -            if(weight<=fontWeights[i])
  +        for (i=0; i<fontWeights.length; i++) {
  +            if (weight<=fontWeights[i])
                   break;
           }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org