vmote       2003/08/14 12:16:41

  Modified:    src/java/org/apache/fop/control Document.java
               src/java/org/apache/fop/fonts Font.java
               src/java/org/apache/fop/render/awt FontSetup.java
               src/java/org/apache/fop/render/pdf FontSetup.java
               src/java/org/apache/fop/render/ps PSTextPainter.java
               src/java/org/apache/fop/svg PDFGraphics2D.java
                        PDFTextPainter.java
               src/java/org/apache/fop/tools AreaTreeBuilder.java
  Log:
  move font constants from control.Document to fonts.Font
  
  Revision  Changes    Path
  1.2       +17 -23    xml-fop/src/java/org/apache/fop/control/Document.java
  
  Index: Document.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/control/Document.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Document.java     14 Aug 2003 07:42:57 -0000      1.1
  +++ Document.java     14 Aug 2003 19:16:41 -0000      1.2
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    The Apache Software License, Version 1.1
    * ============================================================================
  - * 
  + *
    * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without modifica-
    * tion, are permitted provided that the following conditions are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright notice,
    *    this list of conditions and the following disclaimer.
  - * 
  + *
    * 2. Redistributions in binary form must reproduce the above copyright notice,
    *    this list of conditions and the following disclaimer in the documentation
    *    and/or other materials provided with the distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution, if any, must
    *    include the following acknowledgment: "This product includes software
    *    developed by the Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself, if
    *    and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "FOP" and "Apache Software Foundation" must not be used to
    *    endorse or promote products derived from this software without prior
    *    written permission. For written permission, please contact
    *    [EMAIL PROTECTED]
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache", nor may
    *    "Apache" appear in their name, without prior written permission of the
    *    Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  @@ -42,18 +42,19 @@
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * ============================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many individuals
    * on behalf of the Apache Software Foundation and was originally created by
    * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */ 
  + */
   package org.apache.fop.control;
   
   // Java
   import java.util.Map;
   
   // FOP
  +import org.apache.fop.fonts.Font;
   import org.apache.fop.fonts.FontMetrics;
   
   /**
  @@ -66,20 +67,13 @@
    * implemented.
    */
   public class Document {
  -    
  -    /** Default fallback key */
  -    public static final String DEFAULT_FONT = "any,normal,400";
  -    /** Normal font weight */
  -    public static final int NORMAL = 400;
  -    /** Bold font weight */
  -    public static final int BOLD = 700;
   
       /** Map containing fonts that have been used */
       private Map usedFonts;
  -    
  +
       /** look up a font-triplet to find a font-name */
       private Map triplets;
  -    
  +
       /** look up a font-name to get a font (that implements FontMetrics at least) */
       private Map fonts;
   
  @@ -93,12 +87,12 @@
       }
   
       /**
  -     * Checks if the font setup is valid (At least the ultimate fallback font 
  +     * Checks if the font setup is valid (At least the ultimate fallback font
        * must be registered.)
        * @return True if valid
        */
       public boolean isSetupValid() {
  -        return triplets.containsKey(DEFAULT_FONT);
  +        return triplets.containsKey(Font.DEFAULT_FONT);
       }
   
       /**
  @@ -165,7 +159,7 @@
   
               // then use default
               if (f == null) {
  -                f = (String)triplets.get(DEFAULT_FONT);
  +                f = (String)triplets.get(Font.DEFAULT_FONT);
               }
   
           }
  
  
  
  1.4       +18 -11    xml-fop/src/java/org/apache/fop/fonts/Font.java
  
  Index: Font.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fonts/Font.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Font.java 14 Aug 2003 15:31:10 -0000      1.3
  +++ Font.java 14 Aug 2003 19:16:41 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    The Apache Software License, Version 1.1
    * ============================================================================
  - * 
  + *
    * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without modifica-
    * tion, are permitted provided that the following conditions are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright notice,
    *    this list of conditions and the following disclaimer.
  - * 
  + *
    * 2. Redistributions in binary form must reproduce the above copyright notice,
    *    this list of conditions and the following disclaimer in the documentation
    *    and/or other materials provided with the distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution, if any, must
    *    include the following acknowledgment: "This product includes software
    *    developed by the Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself, if
    *    and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "FOP" and "Apache Software Foundation" must not be used to
    *    endorse or promote products derived from this software without prior
    *    written permission. For written permission, please contact
    *    [EMAIL PROTECTED]
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache", nor may
    *    "Apache" appear in their name, without prior written permission of the
    *    Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  @@ -42,12 +42,12 @@
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * ============================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many individuals
    * on behalf of the Apache Software Foundation and was originally created by
    * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */ 
  + */
   package org.apache.fop.fonts;
   
   import java.util.Map;
  @@ -56,10 +56,17 @@
   
   
   /**
  - * This class holds font state information and provides access to the font 
  + * This class holds font state information and provides access to the font
    * metrics.
    */
   public class Font {
  +
  +    /** Default fallback key */
  +    public static final String DEFAULT_FONT = "any,normal,400";
  +    /** Normal font weight */
  +    public static final int NORMAL = 400;
  +    /** Bold font weight */
  +    public static final int BOLD = 700;
   
       private String fontName;
       private int fontSize;
  
  
  
  1.3       +70 -69    xml-fop/src/java/org/apache/fop/render/awt/FontSetup.java
  
  Index: FontSetup.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/awt/FontSetup.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FontSetup.java    14 Aug 2003 07:42:58 -0000      1.2
  +++ FontSetup.java    14 Aug 2003 19:16:41 -0000      1.3
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    The Apache Software License, Version 1.1
    * ============================================================================
  - * 
  + *
    * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without modifica-
    * tion, are permitted provided that the following conditions are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright notice,
    *    this list of conditions and the following disclaimer.
  - * 
  + *
    * 2. Redistributions in binary form must reproduce the above copyright notice,
    *    this list of conditions and the following disclaimer in the documentation
    *    and/or other materials provided with the distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution, if any, must
    *    include the following acknowledgment: "This product includes software
    *    developed by the Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself, if
    *    and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "FOP" and "Apache Software Foundation" must not be used to
    *    endorse or promote products derived from this software without prior
    *    written permission. For written permission, please contact
    *    [EMAIL PROTECTED]
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache", nor may
    *    "Apache" appear in their name, without prior written permission of the
    *    Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  @@ -42,16 +42,17 @@
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * ============================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many individuals
    * on behalf of the Apache Software Foundation and was originally created by
    * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */ 
  + */
   package org.apache.fop.render.awt;
   
   // FOP
   import org.apache.fop.control.Document;
  +import org.apache.fop.fonts.Font;
   
   // Java
   import java.awt.Graphics2D;
  @@ -140,52 +141,52 @@
           // fontInfo.addMetrics("F17", new BauerBodoniBoldItalic());
   
           /* any is treated as serif */
  -        fontInfo.addFontProperties("F5", "any", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "any", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "any", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "any", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "any", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "any", "oblique", Document.BOLD);
  -
  -        fontInfo.addFontProperties("F1", "sans-serif", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "sans-serif", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "sans-serif", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F3", "sans-serif", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "sans-serif", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "sans-serif", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F5", "serif", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "serif", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "serif", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "serif", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "serif", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "serif", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F9", "monospace", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "monospace", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "monospace", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F11", "monospace", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "monospace", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "monospace", "italic", Document.BOLD);
  -
  -        fontInfo.addFontProperties("F1", "Helvetica", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "Helvetica", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "Helvetica", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F3", "Helvetica", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "Helvetica", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "Helvetica", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F5", "Times", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "Times", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F9", "Courier", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "Courier", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "Courier", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F11", "Courier", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "Courier", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "Courier", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F13", "Symbol", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", 
Document.NORMAL);
  +        fontInfo.addFontProperties("F5", "any", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "any", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "any", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "any", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "any", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "any", "oblique", Font.BOLD);
  +
  +        fontInfo.addFontProperties("F1", "sans-serif", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "sans-serif", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "sans-serif", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F3", "sans-serif", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "sans-serif", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "sans-serif", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F5", "serif", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "serif", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "serif", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "serif", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "serif", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "serif", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F9", "monospace", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "monospace", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "monospace", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F11", "monospace", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "monospace", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "monospace", "italic", Font.BOLD);
  +
  +        fontInfo.addFontProperties("F1", "Helvetica", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "Helvetica", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "Helvetica", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F3", "Helvetica", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "Helvetica", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "Helvetica", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F5", "Times", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "Times", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F9", "Courier", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "Courier", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "Courier", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F11", "Courier", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "Courier", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "Courier", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F13", "Symbol", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", Font.NORMAL);
   
           // Custom type 1 fonts step 2/2
           // fontInfo.addFontProperties("F15", "OMEP", "normal", FontInfo.NORMAL);
  @@ -193,20 +194,20 @@
           // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", 
FontInfo.BOLD);
   
           /* for compatibility with PassiveTex */
  -        fontInfo.addFontProperties("F5", "Times-Roman", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times-Roman", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times-Roman", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "Times-Roman", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times-Roman", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times-Roman", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F5", "Times Roman", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times Roman", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times Roman", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "Times Roman", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times Roman", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times Roman", "italic", Document.BOLD);
  +        fontInfo.addFontProperties("F5", "Times-Roman", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times-Roman", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times-Roman", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "Times-Roman", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times-Roman", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times-Roman", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F5", "Times Roman", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times Roman", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times Roman", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "Times Roman", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times Roman", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times Roman", "italic", Font.BOLD);
           fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
  -                                   "normal", Document.NORMAL);
  +                                   "normal", Font.NORMAL);
       }
   
   }
  
  
  
  1.7       +73 -72    xml-fop/src/java/org/apache/fop/render/pdf/FontSetup.java
  
  Index: FontSetup.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/FontSetup.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FontSetup.java    14 Aug 2003 14:59:56 -0000      1.6
  +++ FontSetup.java    14 Aug 2003 19:16:41 -0000      1.7
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    The Apache Software License, Version 1.1
    * ============================================================================
  - * 
  + *
    * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without modifica-
    * tion, are permitted provided that the following conditions are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright notice,
    *    this list of conditions and the following disclaimer.
  - * 
  + *
    * 2. Redistributions in binary form must reproduce the above copyright notice,
    *    this list of conditions and the following disclaimer in the documentation
    *    and/or other materials provided with the distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution, if any, must
    *    include the following acknowledgment: "This product includes software
    *    developed by the Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself, if
    *    and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "FOP" and "Apache Software Foundation" must not be used to
    *    endorse or promote products derived from this software without prior
    *    written permission. For written permission, please contact
    *    [EMAIL PROTECTED]
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache", nor may
    *    "Apache" appear in their name, without prior written permission of the
    *    Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  @@ -42,17 +42,18 @@
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * ============================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many individuals
    * on behalf of the Apache Software Foundation and was originally created by
    * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */ 
  + */
   package org.apache.fop.render.pdf;
   
   // FOP
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.fop.fonts.Font;
   import org.apache.fop.fonts.Typeface;
   import org.apache.fop.fonts.FontDescriptor;
   import org.apache.fop.fonts.FontUtil;
  @@ -121,52 +122,52 @@
           // fontInfo.addMetrics("F17", new BauerBodoniBoldItalic());
   
           /* any is treated as serif */
  -        fontInfo.addFontProperties("F5", "any", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "any", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "any", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "any", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "any", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "any", "oblique", Document.BOLD);
  -
  -        fontInfo.addFontProperties("F1", "sans-serif", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "sans-serif", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "sans-serif", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F3", "sans-serif", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "sans-serif", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "sans-serif", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F5", "serif", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "serif", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "serif", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "serif", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "serif", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "serif", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F9", "monospace", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "monospace", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "monospace", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F11", "monospace", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "monospace", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "monospace", "italic", Document.BOLD);
  -
  -        fontInfo.addFontProperties("F1", "Helvetica", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "Helvetica", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F2", "Helvetica", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F3", "Helvetica", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "Helvetica", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F4", "Helvetica", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F5", "Times", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "Times", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F9", "Courier", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "Courier", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F10", "Courier", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F11", "Courier", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "Courier", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F12", "Courier", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F13", "Symbol", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", 
Document.NORMAL);
  +        fontInfo.addFontProperties("F5", "any", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "any", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "any", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "any", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "any", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "any", "oblique", Font.BOLD);
  +
  +        fontInfo.addFontProperties("F1", "sans-serif", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "sans-serif", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "sans-serif", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F3", "sans-serif", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "sans-serif", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "sans-serif", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F5", "serif", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "serif", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "serif", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "serif", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "serif", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "serif", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F9", "monospace", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "monospace", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "monospace", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F11", "monospace", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "monospace", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "monospace", "italic", Font.BOLD);
  +
  +        fontInfo.addFontProperties("F1", "Helvetica", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "Helvetica", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F2", "Helvetica", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F3", "Helvetica", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "Helvetica", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F4", "Helvetica", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F5", "Times", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "Times", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F9", "Courier", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "Courier", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F10", "Courier", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F11", "Courier", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "Courier", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F12", "Courier", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F13", "Symbol", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", Font.NORMAL);
   
           // Custom type 1 fonts step 2/2
           // fontInfo.addFontProperties("F15", "OMEP", "normal", FontInfo.NORMAL);
  @@ -174,20 +175,20 @@
           // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", 
FontInfo.BOLD);
   
           /* for compatibility with PassiveTex */
  -        fontInfo.addFontProperties("F5", "Times-Roman", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times-Roman", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times-Roman", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "Times-Roman", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times-Roman", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times-Roman", "italic", Document.BOLD);
  -        fontInfo.addFontProperties("F5", "Times Roman", "normal", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times Roman", "oblique", Document.NORMAL);
  -        fontInfo.addFontProperties("F6", "Times Roman", "italic", Document.NORMAL);
  -        fontInfo.addFontProperties("F7", "Times Roman", "normal", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times Roman", "oblique", Document.BOLD);
  -        fontInfo.addFontProperties("F8", "Times Roman", "italic", Document.BOLD);
  +        fontInfo.addFontProperties("F5", "Times-Roman", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times-Roman", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times-Roman", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "Times-Roman", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times-Roman", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times-Roman", "italic", Font.BOLD);
  +        fontInfo.addFontProperties("F5", "Times Roman", "normal", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times Roman", "oblique", Font.NORMAL);
  +        fontInfo.addFontProperties("F6", "Times Roman", "italic", Font.NORMAL);
  +        fontInfo.addFontProperties("F7", "Times Roman", "normal", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times Roman", "oblique", Font.BOLD);
  +        fontInfo.addFontProperties("F8", "Times Roman", "italic", Font.BOLD);
           fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
  -                                   "normal", Document.NORMAL);
  +                                   "normal", Font.NORMAL);
   
           /* Add configured fonts */
           addConfiguredFonts(fontInfo, embedList, 15);
  @@ -262,15 +263,15 @@
                   f, font.getFontName(), font.getEncoding(), font, desc));
           }
       }
  -    
  -    
  +
  +
       /**
        * Builds a list of EmbedFontInfo objects for use with the setup() method.
        * @param cfg Configuration object
        * @return List the newly created list of fonts
        * @throws ConfigurationException if something's wrong with the config data
        */
  -    public static List buildFontListFromConfiguration(Configuration cfg) 
  +    public static List buildFontListFromConfiguration(Configuration cfg)
               throws ConfigurationException {
           List fontList = new java.util.ArrayList();
           Configuration[] font = cfg.getChildren("font");
  
  
  
  1.5       +4 -4      xml-fop/src/java/org/apache/fop/render/ps/PSTextPainter.java
  
  Index: PSTextPainter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSTextPainter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PSTextPainter.java        14 Aug 2003 15:31:10 -0000      1.4
  +++ PSTextPainter.java        14 Aug 2003 19:16:41 -0000      1.5
  @@ -187,8 +187,8 @@
           String style = ((posture != null) && (posture.floatValue() > 0.0))
                          ? "italic" : "normal";
           int weight = ((taWeight != null)
  -                       &&  (taWeight.floatValue() > 1.0)) ? Document.BOLD
  -                       : Document.NORMAL;
  +                       &&  (taWeight.floatValue() > 1.0)) ? Font.BOLD
  +                       : Font.NORMAL;
   
           Font fontState = null;
           Document fi = fontInfo;
  @@ -216,7 +216,7 @@
           }
           if (!found) {
               String fname =
  -              fontInfo.fontLookup("any", style, Document.NORMAL);
  +              fontInfo.fontLookup("any", style, Font.NORMAL);
               FontMetrics metrics = fontInfo.getMetricsFor(fname);
               int fsize = (int)(size.floatValue() * 1000);
               fontState = new Font(fname, metrics, fsize);
  @@ -226,7 +226,7 @@
               }
           }
           int fStyle = java.awt.Font.PLAIN;
  -        if (weight == Document.BOLD) {
  +        if (weight == Font.BOLD) {
               if (style.equals("italic")) {
                   fStyle = java.awt.Font.BOLD | java.awt.Font.ITALIC;
               } else {
  
  
  
  1.8       +1 -1      xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java
  
  Index: PDFGraphics2D.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PDFGraphics2D.java        14 Aug 2003 15:31:10 -0000      1.7
  +++ PDFGraphics2D.java        14 Aug 2003 19:16:41 -0000      1.8
  @@ -1208,7 +1208,7 @@
               }
               int siz = gFont.getSize();
               String style = gFont.isItalic() ? "italic" : "normal";
  -            int weight = gFont.isBold() ? Document.BOLD : Document.NORMAL;
  +            int weight = gFont.isBold() ? Font.BOLD : Font.NORMAL;
               String fname = fontInfo.fontLookup(n, style, weight);
               FontMetrics metrics = fontInfo.getMetricsFor(fname);
               fontState = new Font(fname, metrics, siz * 1000);
  
  
  
  1.5       +4 -4      xml-fop/src/java/org/apache/fop/svg/PDFTextPainter.java
  
  Index: PDFTextPainter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFTextPainter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PDFTextPainter.java       14 Aug 2003 15:31:10 -0000      1.4
  +++ PDFTextPainter.java       14 Aug 2003 19:16:41 -0000      1.5
  @@ -186,8 +186,8 @@
           String style = ((posture != null) && (posture.floatValue() > 0.0))
                          ? "italic" : "normal";
           int weight = ((taWeight != null)
  -                       &&  (taWeight.floatValue() > 1.0)) ? Document.BOLD
  -                       : Document.NORMAL;
  +                       &&  (taWeight.floatValue() > 1.0)) ? Font.BOLD
  +                       : Font.NORMAL;
   
           Font fontState = null;
           Document fi = fontInfo;
  @@ -215,7 +215,7 @@
           }
           if (!found) {
               String fname =
  -              fontInfo.fontLookup("any", style, Document.NORMAL);
  +              fontInfo.fontLookup("any", style, Font.NORMAL);
               FontMetrics metrics = fontInfo.getMetricsFor(fname);
               int fsize = (int)(size.floatValue() * 1000);
               fontState = new Font(fname, metrics, fsize);
  @@ -225,7 +225,7 @@
               }
           }
           int fStyle = java.awt.Font.PLAIN;
  -        if (weight == Document.BOLD) {
  +        if (weight == Font.BOLD) {
               if (style.equals("italic")) {
                   fStyle = java.awt.Font.BOLD | java.awt.Font.ITALIC;
               } else {
  
  
  
  1.4       +2 -2      xml-fop/src/java/org/apache/fop/tools/AreaTreeBuilder.java
  
  Index: AreaTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/tools/AreaTreeBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AreaTreeBuilder.java      14 Aug 2003 15:31:10 -0000      1.3
  +++ AreaTreeBuilder.java      14 Aug 2003 19:16:41 -0000      1.4
  @@ -559,7 +559,7 @@
                   Character ch =
                     new Character(getString((Element) obj).charAt(0));
                   addTraits((Element) obj, ch);
  -                String fname = fontInfo.fontLookup("sans-serif", "normal", 
Document.NORMAL);
  +                String fname = fontInfo.fontLookup("sans-serif", "normal", 
Font.NORMAL);
                   FontMetrics metrics = fontInfo.getMetricsFor(fname);
                   currentFontState =
                       new Font(fname, metrics, 12000);
  @@ -584,7 +584,7 @@
                       list.add(leader);
                   }
               } else if (obj.getNodeName().equals("word")) {
  -                String fname = fontInfo.fontLookup("sans-serif", "normal", 
Document.NORMAL);
  +                String fname = fontInfo.fontLookup("sans-serif", "normal", 
Font.NORMAL);
                   FontMetrics metrics = fontInfo.getMetricsFor(fname);
                   currentFontState =
                       new Font(fname, metrics, 12000);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to