]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
move font constants from control.Document to fonts.Font
authorWilliam Victor Mote <vmote@apache.org>
Thu, 14 Aug 2003 19:16:41 +0000 (19:16 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Thu, 14 Aug 2003 19:16:41 +0000 (19:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196802 13f79535-47bb-0310-9956-ffa450edef68

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
src/java/org/apache/fop/svg/PDFTextPainter.java
src/java/org/apache/fop/tools/AreaTreeBuilder.java

index 396ab1cc92f9b2b5ab9fa6d541f45376d995583d..364ba559dde0915feed18d38c2d1e8b558be2474 100644 (file)
@@ -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
  *    apache@apache.org.
- * 
+ *
  * 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
  * (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 <jtauber@jtauber.com>. 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 @@ import org.apache.fop.fonts.FontMetrics;
  * 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 @@ public class Document {
     }
 
     /**
-     * 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 @@ public class Document {
 
             // then use default
             if (f == null) {
-                f = (String)triplets.get(DEFAULT_FONT);
+                f = (String)triplets.get(Font.DEFAULT_FONT);
             }
 
         }
index a304be5603bde07e4ff17e3337a4c42fbabd36ed..b23b58f720888aca0065e6f3f87e0e708985ce14 100644 (file)
@@ -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
  *    apache@apache.org.
- * 
+ *
  * 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
  * (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 <jtauber@jtauber.com>. For more information on the Apache
  * Software Foundation, please see <http://www.apache.org/>.
- */ 
+ */
 package org.apache.fop.fonts;
 
 import java.util.Map;
@@ -56,11 +56,18 @@ import java.util.Map;
 
 
 /**
- * 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;
     //private String fontFamily;
index 5e4ec99aa0a6d687887f570ac933895a34fd9855..0bc24424d81fb85d08e8707b63a90f1cbd425825 100644 (file)
@@ -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
  *    apache@apache.org.
- * 
+ *
  * 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
  * (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 <jtauber@jtauber.com>. 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 @@ public class FontSetup {
         // 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 @@ public class FontSetup {
         // 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);
     }
 
 }
index 3d30f6c8cb0902cb11b8653689cb7f057ba8da60..7d2239e3faabe2093a54fc2fd30a434760b31284 100644 (file)
@@ -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
  *    apache@apache.org.
- * 
+ *
  * 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
  * (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 <jtauber@jtauber.com>. 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 @@ public class FontSetup {
         // 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("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", 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", "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", 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("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 @@ public class FontSetup {
         // 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 @@ public class FontSetup {
                 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");
index bb52fef6eabd9bc55c32e1aecd4e960c1dd2bed9..76b1696dec97e32130f656d07289fa5b24eb8476 100644 (file)
@@ -187,8 +187,8 @@ public class PSTextPainter implements TextPainter {
         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 @@ public class PSTextPainter implements TextPainter {
         }
         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 @@ public class PSTextPainter implements TextPainter {
             }
         }
         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 {
index e4e4a2f37577c4cb8c6dd8122addd63d2c551929..c992d51aaf18b1ff3153bf6b275f10b809980b5a 100644 (file)
@@ -1208,7 +1208,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
             }
             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);
index 247b98bb9434e72cabcbde8972aad1b8945f1ebe..cfbdc60ef89651cd47ff76fccf2b85d4e905cd65 100644 (file)
@@ -186,8 +186,8 @@ public class PDFTextPainter implements TextPainter {
         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 @@ public class PDFTextPainter implements TextPainter {
         }
         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 @@ public class PDFTextPainter implements TextPainter {
             }
         }
         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 {
index 16b720db25614877b5943532cf724a64069641d3..0c64bbd1a3437f296b53d5528c5ed922d6d0c793 100644 (file)
@@ -559,7 +559,7 @@ class TreeLoader extends AbstractLogEnabled {
                 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 @@ class TreeLoader extends AbstractLogEnabled {
                     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);