diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-11-11 15:01:44 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-11-11 15:01:44 +0000 |
commit | 077ff96c5b5e8013f8c37eca140b351070cacd81 (patch) | |
tree | ad8183204518795402961998c0ced58cdb511d79 /src/java/org/apache/fop/render/pcl | |
parent | dc35bae9c40d7cb30040eb0f11a4580ac2d58d89 (diff) | |
download | xmlgraphics-fop-077ff96c5b5e8013f8c37eca140b351070cacd81.tar.gz xmlgraphics-fop-077ff96c5b5e8013f8c37eca140b351070cacd81.zip |
Step 2/2:
Removing MIF, PCL and SVG after moving/copying them to the sandbox.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332576 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pcl')
-rw-r--r-- | src/java/org/apache/fop/render/pcl/PCLRenderer.java | 187 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/pcl/PCLRendererMaker.java | 51 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/pcl/PCLStream.java | 57 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/pcl/package.html | 22 |
4 files changed, 0 insertions, 317 deletions
diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderer.java b/src/java/org/apache/fop/render/pcl/PCLRenderer.java deleted file mode 100644 index f322d2679..000000000 --- a/src/java/org/apache/fop/render/pcl/PCLRenderer.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 1999-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.pcl; - -// FOP -import org.apache.fop.apps.MimeConstants; -import org.apache.fop.render.PrintRenderer; - -// Java -import java.io.IOException; -import java.io.OutputStream; - -/** - * Renderer that renders areas to PCL - * Created by Arthur E Welch III while at M&I EastPoint Technology - * Donated by EastPoint to the Apache FOP project March 2, 2001. - */ -public class PCLRenderer extends PrintRenderer { - - /** The MIME type for PCL */ - public static final String MIME_TYPE = MimeConstants.MIME_PCL_ALT; - - /** - * the current stream to add PCL commands to - */ - protected PCLStream currentStream; - - private int pageHeight = 7920; - - // These variables control the virtual paggination functionality. - private int curdiv = 0; - private int divisions = -1; - private int paperheight = -1; // Paper height in decipoints? - private int orientation = -1; // -1=default/unknown, 0=portrait, 1=landscape. - private int topmargin = -1; // Top margin in decipoints? - private int leftmargin = -1; // Left margin in decipoints? - private int fullmargin = 0; - private final boolean debug = false; - - private int xoffset = -180; // X Offset to allow for PCL implicit 1/4" left margin. - - private java.util.Hashtable options; - - /** - * Create the PCL renderer - */ - public PCLRenderer() { - } - - public void setFont(String name, float size) { - int fontcode = 0; - if (name.length() > 1 && name.charAt(0) == 'F') { - try { - fontcode = Integer.parseInt(name.substring(1)); - } catch (Exception e) { - e.printStackTrace(); - } - } - switch (fontcode) { - case 1: // F1 = Helvetica - // currentStream.add("\033(8U\033(s1p" + (size / 1000) + "v0s0b24580T"); - // Arial is more common among PCL5 printers than Helvetica - so use Arial - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v0s0b16602T"); - break; - case 2: // F2 = Helvetica Oblique - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v1s0b16602T"); - break; - case 3: // F3 = Helvetica Bold - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v0s3b16602T"); - break; - case 4: // F4 = Helvetica Bold Oblique - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v1s3b16602T"); - break; - case 5: // F5 = Times Roman - // currentStream.add("\033(8U\033(s1p" + (size / 1000) + "v0s0b25093T"); - // Times New is more common among PCL5 printers than Times - so use Times New - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v0s0b16901T"); - break; - case 6: // F6 = Times Italic - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v1s0b16901T"); - break; - case 7: // F7 = Times Bold - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v0s3b16901T"); - break; - case 8: // F8 = Times Bold Italic - - currentStream.add("\033(0N\033(s1p" + (size / 1000) - + "v1s3b16901T"); - break; - case 9: // F9 = Courier - - currentStream.add("\033(0N\033(s0p" - + (120.01f / (size / 1000.00f)) + "h0s0b4099T"); - break; - case 10: // F10 = Courier Oblique - - currentStream.add("\033(0N\033(s0p" - + (120.01f / (size / 1000.00f)) + "h1s0b4099T"); - break; - case 11: // F11 = Courier Bold - - currentStream.add("\033(0N\033(s0p" - + (120.01f / (size / 1000.00f)) + "h0s3b4099T"); - break; - case 12: // F12 = Courier Bold Oblique - - currentStream.add("\033(0N\033(s0p" - + (120.01f / (size / 1000.00f)) + "h1s3b4099T"); - break; - case 13: // F13 = Symbol - - currentStream.add("\033(19M\033(s1p" + (size / 1000) - + "v0s0b16686T"); - // ECMA Latin 1 Symbol Set in Times Roman??? - // currentStream.add("\033(9U\033(s1p" + (size / 1000) + "v0s0b25093T"); - break; - case 14: // F14 = Zapf Dingbats - - currentStream.add("\033(14L\033(s1p" + (size / 1000) - + "v0s0b45101T"); - break; - default: - currentStream.add("\033(0N\033(s" + (size / 1000) + "V"); - break; - } - } - - public void startRenderer(OutputStream outputStream) throws IOException { - log.info("rendering areas to PCL"); - log.fatal("The PCL Renderer is non-functional at this time. Please help resurrect it!"); - currentStream = new PCLStream(outputStream); - - // Set orientation. - if (orientation > -1) { - currentStream.add("\033&l" + orientation + "O"); - } else { - currentStream.add("\033&l0O"); - } - if (orientation == 1 || orientation == 3) { - xoffset = -144; - } else { - xoffset = -180; - } - - // Reset the margins. - currentStream.add("\033" + "9\033&l0E"); - } - - public void stopRenderer() throws IOException { - } - - /** @see org.apache.fop.render.AbstractRenderer */ - public String getMimeType() { - return MIME_TYPE; - } - -} diff --git a/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java b/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java deleted file mode 100644 index 2e39d355a..000000000 --- a/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java +++ /dev/null @@ -1,51 +0,0 @@ -/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.pcl;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.AbstractRendererMaker;
-import org.apache.fop.render.Renderer;
-
-/**
- * RendererMaker for the PCL Renderer.
- */
-public class PCLRendererMaker extends AbstractRendererMaker {
-
- private static final String[] MIMES = new String[] {
- MimeConstants.MIME_PCL,
- MimeConstants.MIME_PCL_ALT};
-
-
- /**@see org.apache.fop.render.AbstractRendererMaker */
- public Renderer makeRenderer(FOUserAgent ua) {
- return new PCLRenderer();
- }
-
- /** @see org.apache.fop.render.AbstractRendererMaker#needsOutputStream() */
- public boolean needsOutputStream() {
- return true;
- }
-
- /** @see org.apache.fop.render.AbstractRendererMaker#getSupportedMimeTypes() */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-
-}
diff --git a/src/java/org/apache/fop/render/pcl/PCLStream.java b/src/java/org/apache/fop/render/pcl/PCLStream.java deleted file mode 100644 index 0ad8096cc..000000000 --- a/src/java/org/apache/fop/render/pcl/PCLStream.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.pcl; - -import java.io.IOException; -import java.io.OutputStream; - -public class PCLStream { - - private OutputStream out = null; - private boolean doOutput = true; - - public PCLStream(OutputStream os) { - out = os; - } - - public void add(String str) { - if (!doOutput) { - return; - } - - byte buff[] = new byte[str.length()]; - int countr; - int len = str.length(); - for (countr = 0; countr < len; countr++) { - buff[countr] = (byte)str.charAt(countr); - } - try { - out.write(buff); - } catch (IOException e) { - // e.printStackTrace(); - // e.printStackTrace(System.out); - throw new RuntimeException(e.toString()); - } - } - - public void setDoOutput(boolean doout) { - doOutput = doout; - } - -} diff --git a/src/java/org/apache/fop/render/pcl/package.html b/src/java/org/apache/fop/render/pcl/package.html deleted file mode 100644 index feec0572e..000000000 --- a/src/java/org/apache/fop/render/pcl/package.html +++ /dev/null @@ -1,22 +0,0 @@ -<!-- - Copyright 2005 The Apache Software Foundation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<!-- $Id$ --> -<HTML> -<TITLE>org.apache.fop.render.pcl Package</TITLE> -<BODY> -<P>PCL Renderer</P> -</BODY> -</HTML>
\ No newline at end of file |