downgrading itext while trying to figure out speed issues

This commit is contained in:
benfry
2010-02-17 00:32:14 +00:00
parent 933d0c9b59
commit 680b58487d
2 changed files with 11 additions and 4 deletions

View File

@@ -1,8 +1,9 @@
The majority of the work in this library is done by iText.
http://www.lowagie.com/iText/
The version bundled in this release is 2.1.4.
The files in the library must be named itext.jar because they're specifically
included on the classpath as part of the build/platform/make.sh scripts.
The version bundled with previous releases was 2.1.4. After Processing 1.0.9,
the library was downgraded to iText 1.5.4., because later versions seem to
load slower, and don't seem to offer additional benefits. If the PDF library
gets worse, please post a bug and we'll go back to the 2.x release we were
using, or upgrade to the more recent 5.x series.

View File

@@ -25,6 +25,8 @@ import java.util.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
//import com.itextpdf.text.*;
//import com.itextpdf.text.pdf.*;
import processing.core.*;
@@ -67,6 +69,7 @@ public class PGraphicsPDF extends PGraphicsJava2D {
public void beginDraw() {
// long t = System.currentTimeMillis();
if (document == null) {
document = new Document(new Rectangle(width, height));
try {
@@ -106,6 +109,7 @@ public class PGraphicsPDF extends PGraphicsJava2D {
//System.out.println("done registering directories");
if (PApplet.platform == PApplet.MACOSX) {
// long t = System.currentTimeMillis();
try {
String homeLibraryFonts =
System.getProperty("user.home") + "/Library/Fonts";
@@ -117,6 +121,7 @@ public class PGraphicsPDF extends PGraphicsJava2D {
// add the system font paths
mapper.insertDirectory("/System/Library/Fonts");
mapper.insertDirectory("/Library/Fonts");
// System.out.println("mapping " + (System.currentTimeMillis() - t));
} else if (PApplet.platform == PApplet.WINDOWS) {
// how to get the windows fonts directory?
@@ -154,6 +159,7 @@ public class PGraphicsPDF extends PGraphicsJava2D {
g2 = content.createGraphics(width, height, mapper);
// g2 = template.createGraphics(width, height, mapper);
}
// System.out.println("beginDraw " + (System.currentTimeMillis() - t));
super.beginDraw();
}