aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/render/pcl
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/apache/fop/render/pcl')
-rwxr-xr-xsrc/org/apache/fop/render/pcl/PCLRenderer.java47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/org/apache/fop/render/pcl/PCLRenderer.java b/src/org/apache/fop/render/pcl/PCLRenderer.java
index 9ccd4f39f..2b1dbbb1a 100755
--- a/src/org/apache/fop/render/pcl/PCLRenderer.java
+++ b/src/org/apache/fop/render/pcl/PCLRenderer.java
@@ -81,7 +81,7 @@ public class PCLRenderer extends PrintRenderer {
* @param producer string indicating application producing PCL
*/
public void setProducer(String producer) {}
-
+
/**
* add a line to the current stream
*
@@ -286,7 +286,7 @@ public class PCLRenderer extends PrintRenderer {
resolution = 75;
if (debug)
System.out.println("PCLRenderer.printBMP() iscolor = " + iscolor);
- // Setup for graphics
+ // Setup for graphics
currentStream.add("\033*t" + resolution + "R\033*r0F\033*r1A");
// Transfer graphics data
@@ -300,7 +300,7 @@ public class PCLRenderer extends PrintRenderer {
indx = iy * iw;
if (iscolor)
indx *= 3;
- // currentStream.add("\033*b" + bytewidth + "W");
+ // currentStream.add("\033*b" + bytewidth + "W");
for (ix = 0; ix < iw; ix++) {
if (iscolor) {
cr = imgmap[indx++] & 0xFF;
@@ -477,6 +477,7 @@ public class PCLRenderer extends PrintRenderer {
// currentStream.add("Q\n");
}
+
public void setFont(String name, float size) {
int fontcode = 0;
if (name.length() > 1 && name.charAt(0) == 'F') {
@@ -490,61 +491,75 @@ public class PCLRenderer extends PrintRenderer {
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");
// currentStream.add("\033(9U\033(s1p" + (size / 1000) + "v0s0b25093T"); // ECMA Latin 1 Symbol Set in Times Roman???
break;
case 14: // F14 = Zapf Dingbats
+
currentStream.add("\033(14L\033(s1p" + (size / 1000)
+ "v0s0b45101T");
break;
@@ -629,8 +644,8 @@ public class PCLRenderer extends PrintRenderer {
System.out.println("PCLRenderer.renderPage() paperheight="
+ paperheight + " divisions=" + divisions);
- // Set top margin.
- // float fullmargin = 0;
+ // Set top margin.
+ // float fullmargin = 0;
if (divisions > 0)
fullmargin = paperheight * curdiv / divisions;
if (topmargin > 0)
@@ -638,9 +653,9 @@ public class PCLRenderer extends PrintRenderer {
if (debug)
System.out.println("PCLRenderer.renderPage() curdiv=" + curdiv
+ " fullmargin=" + fullmargin);
- // if ( fullmargin > 0 )
- // currentStream.add("\033&l" + (fullmargin / 15f) + "c1e8C");
- // this.currentYPosition = fullmargin * 100;
+ // if ( fullmargin > 0 )
+ // currentStream.add("\033&l" + (fullmargin / 15f) + "c1e8C");
+ // this.currentYPosition = fullmargin * 100;
if (paperheight > 0)
pageHeight = (paperheight / divisions) + fullmargin;
@@ -676,7 +691,7 @@ public class PCLRenderer extends PrintRenderer {
if (end != null)
renderAreaContainer(end);
- // End page.
+ // End page.
if (++curdiv == divisions || divisions == -1) {
curdiv = 0;
currentStream.add("\f");
@@ -709,8 +724,8 @@ public class PCLRenderer extends PrintRenderer {
*/
}
public void startRenderer(OutputStream outputStream)
- throws IOException
- { MessageHandler.logln("rendering areas to PCL");
+ throws IOException {
+ MessageHandler.logln("rendering areas to PCL");
currentStream = new PCLStream(outputStream);
// Set orientation.
@@ -726,19 +741,17 @@ public class PCLRenderer extends PrintRenderer {
// Reset the margins.
currentStream.add("\033" + "9\033&l0E");
}
-
+
public void stopRenderer(OutputStream outputStream)
- throws IOException
- {
+ throws IOException {
MessageHandler.logln("writing out PCL");
outputStream.flush();
}
public void render(Page page, OutputStream outputStream)
- throws IOException
- {
+ throws IOException {
idReferences = page.getIDReferences();
- this.renderPage(page);
+ this.renderPage(page);
}
}