diff options
author | William Victor Mote <vmote@apache.org> | 2003-08-14 07:42:59 +0000 |
---|---|---|
committer | William Victor Mote <vmote@apache.org> | 2003-08-14 07:42:59 +0000 |
commit | 1041ea8c48bebd72fe8544906fbff40f43ca70e0 (patch) | |
tree | efce02ef7a3f813f17c5d0af69cd590cf4474582 /src/java/org/apache/fop/svg | |
parent | dfadcfe581e7da20c26d08325efa5b40ce63e837 (diff) | |
download | xmlgraphics-fop-1041ea8c48bebd72fe8544906fbff40f43ca70e0.tar.gz xmlgraphics-fop-1041ea8c48bebd72fe8544906fbff40f43ca70e0.zip |
1. create control package
2. move layout.FontInfo to control.Document
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196798 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg')
-rw-r--r-- | src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java | 8 | ||||
-rw-r--r-- | src/java/org/apache/fop/svg/PDFGraphics2D.java | 32 | ||||
-rw-r--r-- | src/java/org/apache/fop/svg/PDFTextElementBridge.java | 24 | ||||
-rw-r--r-- | src/java/org/apache/fop/svg/PDFTextPainter.java | 16 | ||||
-rw-r--r-- | src/java/org/apache/fop/svg/PDFTranscoder.java | 24 |
5 files changed, 52 insertions, 52 deletions
diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java index 58d33264d..458c58e03 100644 --- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java @@ -69,7 +69,7 @@ import org.apache.avalon.framework.container.ContainerUtil; import org.apache.avalon.framework.logger.ConsoleLogger; import org.apache.avalon.framework.logger.LogEnabled; import org.apache.avalon.framework.logger.Logger; -import org.apache.fop.layout.FontInfo; +import org.apache.fop.control.Document; import java.awt.Graphics; import java.awt.Font; @@ -119,7 +119,7 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D super(textAsShapes); if (!textAsShapes) { - fontInfo = new FontInfo(); + fontInfo = new Document(); FontSetup.setup(fontInfo, null); //FontState fontState = new FontState("Helvetica", "normal", // FontInfo.NORMAL, 12, 0); @@ -195,7 +195,7 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D */ public void initialize() throws Exception { if (this.fontInfo == null) { - fontInfo = new FontInfo(); + fontInfo = new Document(); FontSetup.setup(fontInfo, this.fontList); //FontState fontState = new FontState("Helvetica", "normal", // FontInfo.NORMAL, 12, 0); @@ -244,7 +244,7 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D * Get the font info for this pdf document. * @return the font information */ - public FontInfo getFontInfo() { + public Document getFontInfo() { return fontInfo; } diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index 915a364bc..94329d619 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -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 @@ -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 <jtauber@jtauber.com>. For more information on the Apache * Software Foundation, please see <http://www.apache.org/>. - */ + */ package org.apache.fop.svg; import org.apache.fop.pdf.PDFResourceContext; @@ -64,7 +64,7 @@ import org.apache.fop.pdf.PDFDocument; import org.apache.fop.pdf.PDFLink; import org.apache.fop.pdf.PDFAnnotList; import org.apache.fop.pdf.BitmapImage; -import org.apache.fop.layout.FontInfo; +import org.apache.fop.control.Document; import org.apache.fop.layout.FontState; import org.apache.fop.render.pdf.FontSetup; import org.apache.fop.fonts.FontMetrics; @@ -153,7 +153,7 @@ public class PDFGraphics2D extends AbstractGraphics2D { /** * The current font information. */ - protected FontInfo fontInfo; + protected Document fontInfo; /** * The override font state used when drawing text and the font cannot be @@ -197,7 +197,7 @@ public class PDFGraphics2D extends AbstractGraphics2D { * @param font the current font name * @param size the current font size */ - public PDFGraphics2D(boolean textAsShapes, FontInfo fi, PDFDocument doc, + public PDFGraphics2D(boolean textAsShapes, Document fi, PDFDocument doc, PDFResourceContext page, String pref, String font, float size) { super(textAsShapes); pdfDoc = doc; @@ -315,7 +315,7 @@ public class PDFGraphics2D extends AbstractGraphics2D { b = trans.createTransformedShape(b); if (b != null) { Rectangle rect = b.getBounds(); - + if (linkType != PDFLink.EXTERNAL) { String pdfdest = "/FitR " + dest; resourceContext.addAnnotation( @@ -982,7 +982,7 @@ public class PDFGraphics2D extends AbstractGraphics2D { private void createPattern(PatternPaint pp, boolean fill) { Rectangle2D rect = pp.getPatternRect(); - FontInfo fi = new FontInfo(); + Document fi = new Document(); FontSetup.setup(fi, null); PDFResources res = pdfDoc.getFactory().makeResources(); @@ -1207,7 +1207,7 @@ public class PDFGraphics2D extends AbstractGraphics2D { } int siz = gFont.getSize(); String style = gFont.isItalic() ? "italic" : "normal"; - int weight = gFont.isBold() ? FontInfo.BOLD : FontInfo.NORMAL; + int weight = gFont.isBold() ? Document.BOLD : Document.NORMAL; String fname = fontInfo.fontLookup(n, style, weight); FontMetrics metrics = fontInfo.getMetricsFor(fname); fontState = new FontState(fname, metrics, siz * 1000); diff --git a/src/java/org/apache/fop/svg/PDFTextElementBridge.java b/src/java/org/apache/fop/svg/PDFTextElementBridge.java index 664324a2b..1f7eaaa5d 100644 --- a/src/java/org/apache/fop/svg/PDFTextElementBridge.java +++ b/src/java/org/apache/fop/svg/PDFTextElementBridge.java @@ -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 @@ -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 <jtauber@jtauber.com>. For more information on the Apache * Software Foundation, please see <http://www.apache.org/>. - */ + */ package org.apache.fop.svg; import org.apache.batik.gvt.TextNode; @@ -56,7 +56,7 @@ import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.TextUtilities; import org.apache.batik.gvt.GraphicsNode; -import org.apache.fop.layout.FontInfo; +import org.apache.fop.control.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -75,7 +75,7 @@ public class PDFTextElementBridge extends SVGTextElementBridge { * Constructs a new bridge for the <text> element. * @param fi the font infomration */ - public PDFTextElementBridge(FontInfo fi) { + public PDFTextElementBridge(Document fi) { pdfTextPainter = new PDFTextPainter(fi); } diff --git a/src/java/org/apache/fop/svg/PDFTextPainter.java b/src/java/org/apache/fop/svg/PDFTextPainter.java index 2c01034b3..a3645d2e3 100644 --- a/src/java/org/apache/fop/svg/PDFTextPainter.java +++ b/src/java/org/apache/fop/svg/PDFTextPainter.java @@ -74,7 +74,7 @@ import org.apache.batik.gvt.renderer.StrokingTextPainter; import org.apache.fop.fonts.FontMetrics; import org.apache.fop.layout.FontState; -import org.apache.fop.layout.FontInfo; +import org.apache.fop.control.Document; /** * Renders the attributed character iterator of a <tt>TextNode</tt>. @@ -91,7 +91,7 @@ import org.apache.fop.layout.FontInfo; * @version $Id: PDFTextPainter.java,v 1.16 2003/03/07 09:51:25 jeremias Exp $ */ public class PDFTextPainter implements TextPainter { - private FontInfo fontInfo; + private Document fontInfo; /** * Use the stroking text painter to get the bounds and shape. @@ -104,7 +104,7 @@ public class PDFTextPainter implements TextPainter { * Create a new PDF text painter with the given font information. * @param fi the fint info */ - public PDFTextPainter(FontInfo fi) { + public PDFTextPainter(Document fi) { fontInfo = fi; } @@ -186,11 +186,11 @@ public class PDFTextPainter implements TextPainter { String style = ((posture != null) && (posture.floatValue() > 0.0)) ? "italic" : "normal"; int weight = ((taWeight != null) - && (taWeight.floatValue() > 1.0)) ? FontInfo.BOLD - : FontInfo.NORMAL; + && (taWeight.floatValue() > 1.0)) ? Document.BOLD + : Document.NORMAL; FontState fontState = null; - FontInfo fi = fontInfo; + Document fi = fontInfo; boolean found = false; String fontFamily = null; if (gvtFonts != null) { @@ -215,7 +215,7 @@ public class PDFTextPainter implements TextPainter { } if (!found) { String fname = - fontInfo.fontLookup("any", style, FontInfo.NORMAL); + fontInfo.fontLookup("any", style, Document.NORMAL); FontMetrics metrics = fontInfo.getMetricsFor(fname); int fsize = (int)(size.floatValue() * 1000); fontState = new FontState(fname, metrics, fsize); @@ -225,7 +225,7 @@ public class PDFTextPainter implements TextPainter { } } int fStyle = Font.PLAIN; - if (weight == FontInfo.BOLD) { + if (weight == Document.BOLD) { if (style.equals("italic")) { fStyle = Font.BOLD | Font.ITALIC; } else { diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java index 8ccc05a45..6b69c659b 100644 --- a/src/java/org/apache/fop/svg/PDFTranscoder.java +++ b/src/java/org/apache/fop/svg/PDFTranscoder.java @@ -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 @@ -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 <jtauber@jtauber.com>. For more information on the Apache * Software Foundation, please see <http://www.apache.org/>. - */ + */ package org.apache.fop.svg; import java.awt.Color; @@ -104,7 +104,7 @@ import org.w3c.dom.svg.SVGSVGElement; * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a> * @version $Id: PDFTranscoder.java,v 1.24 2003/03/07 09:51:26 jeremias Exp $ */ -public class PDFTranscoder extends AbstractFOPTranscoder +public class PDFTranscoder extends AbstractFOPTranscoder implements Configurable { private Configuration cfg; @@ -115,7 +115,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder public PDFTranscoder() { super(); this.handler = new FOPErrorHandler(); - + } /** |