diff -Nurd fop-0.20.5/fop.sh fop-0.20.5-new/fop.sh --- fop-0.20.5/fop.sh 2003-07-14 22:03:23.000000000 -0400 +++ fop-0.20.5-new/fop.sh 2010-02-03 21:49:04.000000000 -0500 @@ -11,7 +11,11 @@ darwin=false; case "`uname`" in CYGWIN*) cygwin=true ;; - Darwin*) darwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=@JAVA_HOME@ + fi + ;; esac if [ -z "$FOP_HOME" ] ; then @@ -42,6 +46,8 @@ fi +FOP_HOME=@PREFIX@/share/java/fop + # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$FOP_HOME" ] && @@ -76,10 +82,10 @@ fi # add fop.jar, which resides in $FOP_HOME/build -LOCALCLASSPATH=${FOP_HOME}/build/fop.jar:$LOCALCLASSPATH +LOCALCLASSPATH=${FOP_HOME}/fop.jar:$LOCALCLASSPATH # add in the dependency .jar files, which reside in $FOP_HOME/lib -DIRLIBS=${FOP_HOME}/lib/*.jar +DIRLIBS=${FOP_HOME}/*.jar for i in ${DIRLIBS} do # if the directory is empty, then it will return the input string @@ -100,5 +106,5 @@ LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` fi -$JAVACMD -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.apps.Fop "$@" +$JAVACMD -Xms64M -Xmx320M -Djava.awt.headless=true -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.apps.Fop "$@" diff -Nurd fop-0.20.5/fop_pfmreader.sh fop-0.20.5-new/fop_pfmreader.sh --- fop-0.20.5/fop_pfmreader.sh 1969-12-31 19:00:00.000000000 -0500 +++ fop-0.20.5-new/fop_pfmreader.sh 2010-02-03 21:49:04.000000000 -0500 @@ -0,0 +1,110 @@ +#! /bin/sh +# +# Shell script to run FOP, adapted from the Jakarta-Ant project. + +if [ -f $HOME/.foprc ] ; then + . $HOME/.foprc +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=@JAVA_HOME@ + fi + ;; +esac + +if [ -z "$FOP_HOME" ] ; then + # try to find FOP + if [ -d /opt/fop ] ; then + FOP_HOME=/opt/fop + fi + + if [ -d ${HOME}/opt/fop ] ; then + FOP_HOME=${HOME}/opt/fop + fi + + ## resolve links - $0 may be a link to fop's home + PRG=$0 + progname=`basename $0` + + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname $PRG`/$link" + fi + done + + FOP_HOME=`dirname "$PRG"` + +fi + +FOP_HOME=@PREFIX@/share/java/fop + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$FOP_HOME" ] && + FOP_HOME=`cygpath --unix "$FOP_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + else + JAVACMD=java + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit +fi + +if [ -n "$CLASSPATH" ] ; then + LOCALCLASSPATH=$CLASSPATH +fi + +# add fop.jar, which resides in $FOP_HOME/build +LOCALCLASSPATH=${FOP_HOME}/fop.jar:$LOCALCLASSPATH + +# add in the dependency .jar files, which reside in $FOP_HOME/lib +DIRLIBS=${FOP_HOME}/*.jar +for i in ${DIRLIBS} +do + # if the directory is empty, then it will return the input string + # this is stupid, so case for it + if [ "$i" != "${DIRLIBS}" ] ; then + if [ -z "$LOCALCLASSPATH" ] ; then + LOCALCLASSPATH=$i + else + LOCALCLASSPATH="$i":$LOCALCLASSPATH + fi + fi +done + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + FOP_HOME=`cygpath --path --windows "$FOP_HOME"` + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` +fi + +$JAVACMD -Xms64M -Xmx320M -Djava.awt.headless=true -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.fonts.apps.PFMReader "$@" + diff -Nurd fop-0.20.5/fop_ttfreader.sh fop-0.20.5-new/fop_ttfreader.sh --- fop-0.20.5/fop_ttfreader.sh 1969-12-31 19:00:00.000000000 -0500 +++ fop-0.20.5-new/fop_ttfreader.sh 2010-02-03 21:49:04.000000000 -0500 @@ -0,0 +1,110 @@ +#! /bin/sh +# +# Shell script to run FOP, adapted from the Jakarta-Ant project. + +if [ -f $HOME/.foprc ] ; then + . $HOME/.foprc +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=@JAVA_HOME@ + fi + ;; +esac + +if [ -z "$FOP_HOME" ] ; then + # try to find FOP + if [ -d /opt/fop ] ; then + FOP_HOME=/opt/fop + fi + + if [ -d ${HOME}/opt/fop ] ; then + FOP_HOME=${HOME}/opt/fop + fi + + ## resolve links - $0 may be a link to fop's home + PRG=$0 + progname=`basename $0` + + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname $PRG`/$link" + fi + done + + FOP_HOME=`dirname "$PRG"` + +fi + +FOP_HOME=@PREFIX@/share/java/fop + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$FOP_HOME" ] && + FOP_HOME=`cygpath --unix "$FOP_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + else + JAVACMD=java + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit +fi + +if [ -n "$CLASSPATH" ] ; then + LOCALCLASSPATH=$CLASSPATH +fi + +# add fop.jar, which resides in $FOP_HOME/build +LOCALCLASSPATH=${FOP_HOME}/fop.jar:$LOCALCLASSPATH + +# add in the dependency .jar files, which reside in $FOP_HOME/lib +DIRLIBS=${FOP_HOME}/*.jar +for i in ${DIRLIBS} +do + # if the directory is empty, then it will return the input string + # this is stupid, so case for it + if [ "$i" != "${DIRLIBS}" ] ; then + if [ -z "$LOCALCLASSPATH" ] ; then + LOCALCLASSPATH=$i + else + LOCALCLASSPATH="$i":$LOCALCLASSPATH + fi + fi +done + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + FOP_HOME=`cygpath --path --windows "$FOP_HOME"` + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` +fi + +$JAVACMD -Xms64M -Xmx320M -Djava.awt.headless=true -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.fonts.apps.TTFReader "$@" + diff -Nurd fop-0.20.5/src/org/apache/fop/fonts/apps/PFMReader.java fop-0.20.5-new/src/org/apache/fop/fonts/apps/PFMReader.java --- fop-0.20.5/src/org/apache/fop/fonts/apps/PFMReader.java 2003-07-14 22:03:25.000000000 -0400 +++ fop-0.20.5-new/src/org/apache/fop/fonts/apps/PFMReader.java 2010-02-03 21:49:04.000000000 -0500 @@ -370,16 +370,16 @@ // Get kerning - for (Iterator enum = pfm.getKerning().keySet().iterator(); enum.hasNext(); ) { - Integer kpx1 = (Integer)enum.next(); + for (Iterator it = pfm.getKerning().keySet().iterator(); it.hasNext(); ) { + Integer kpx1 = (Integer)it.next(); el = doc.createElement("kerning"); el.setAttribute("kpx1", kpx1.toString()); root.appendChild(el); Element el2 = null; Map h2 = (Map)pfm.getKerning().get(kpx1); - for (Iterator enum2 = h2.keySet().iterator(); enum2.hasNext(); ) { - Integer kpx2 = (Integer)enum2.next(); + for (Iterator it2 = h2.keySet().iterator(); it2.hasNext(); ) { + Integer kpx2 = (Integer)it2.next(); el2 = doc.createElement("pair"); el2.setAttribute("kpx2", kpx2.toString()); Integer val = (Integer)h2.get(kpx2); diff -Nurd fop-0.20.5/src/org/apache/fop/fonts/apps/TTFReader.java fop-0.20.5-new/src/org/apache/fop/fonts/apps/TTFReader.java --- fop-0.20.5/src/org/apache/fop/fonts/apps/TTFReader.java 2003-07-14 22:03:13.000000000 -0400 +++ fop-0.20.5-new/src/org/apache/fop/fonts/apps/TTFReader.java 2010-02-03 21:49:04.000000000 -0500 @@ -423,14 +423,14 @@ } // Get kerning - Iterator enum; + Iterator it; if (isCid) - enum = ttf.getKerning().keySet().iterator(); + it = ttf.getKerning().keySet().iterator(); else - enum = ttf.getAnsiKerning().keySet().iterator(); + it = ttf.getAnsiKerning().keySet().iterator(); - while (enum.hasNext()) { - Integer kpx1 = (Integer)enum.next(); + while (it.hasNext()) { + Integer kpx1 = (Integer)it.next(); el = doc.createElement("kerning"); el.setAttribute("kpx1", kpx1.toString()); @@ -443,8 +443,8 @@ else h2 = (HashMap)ttf.getAnsiKerning().get(kpx1); - for (Iterator enum2 = h2.keySet().iterator(); enum2.hasNext(); ) { - Integer kpx2 = (Integer)enum2.next(); + for (Iterator it2 = h2.keySet().iterator(); it2.hasNext(); ) { + Integer kpx2 = (Integer)it2.next(); if (isCid || kpx2.intValue() < 256) { el2 = doc.createElement("pair"); el2.setAttribute("kpx2", kpx2.toString()); diff -Nurd fop-0.20.5/src/org/apache/fop/messaging/MessageHandler.java fop-0.20.5-new/src/org/apache/fop/messaging/MessageHandler.java --- fop-0.20.5/src/org/apache/fop/messaging/MessageHandler.java 2003-07-14 22:03:14.000000000 -0400 +++ fop-0.20.5-new/src/org/apache/fop/messaging/MessageHandler.java 2010-02-03 21:49:04.000000000 -0500 @@ -156,9 +156,9 @@ break; case EVENT: setMessage(message); - Enumeration enum = listeners.elements(); - while (enum.hasMoreElements()) { - ((MessageListener)enum.nextElement()).processMessage(new MessageEvent(getMessage())); + Enumeration e = listeners.elements(); + while (e.hasMoreElements()) { + ((MessageListener)e.nextElement()).processMessage(new MessageEvent(getMessage())); } break; case NONE: @@ -205,11 +205,11 @@ break; case EVENT: setMessage(message); - Enumeration enum = listeners.elements(); - while (enum.hasMoreElements()) { + Enumeration e = listeners.elements(); + while (e.hasMoreElements()) { MessageEvent messEv = new MessageEvent(getMessage()); messEv.setMessageType(MessageEvent.ERROR); - ((MessageListener)enum.nextElement()).processMessage(messEv); + ((MessageListener)e.nextElement()).processMessage(messEv); } break; case NONE: diff -Nurd fop-0.20.5/src/org/apache/fop/render/ps/PSRenderer.java fop-0.20.5-new/src/org/apache/fop/render/ps/PSRenderer.java --- fop-0.20.5/src/org/apache/fop/render/ps/PSRenderer.java 2003-07-14 22:03:16.000000000 -0400 +++ fop-0.20.5-new/src/org/apache/fop/render/ps/PSRenderer.java 2010-02-03 21:49:04.000000000 -0500 @@ -303,9 +303,9 @@ // write("/gfF1{/Helvetica findfont} bd"); // write("/gfF3{/Helvetica-Bold findfont} bd"); Map fonts = fontInfo.getFonts(); - Iterator enum = fonts.keySet().iterator(); - while (enum.hasNext()) { - String key = (String)enum.next(); + Iterator it = fonts.keySet().iterator(); + while (it.hasNext()) { + String key = (String)it.next(); Font fm = (Font)fonts.get(key); write("/" + key + " /" + fm.fontName() + " def"); } @@ -314,9 +314,9 @@ defineWinAnsiEncoding(); //Rewrite font encodings - enum = fonts.keySet().iterator(); - while (enum.hasNext()) { - String key = (String)enum.next(); + it = fonts.keySet().iterator(); + while (it.hasNext()) { + String key = (String)it.next(); Font fm = (Font)fonts.get(key); if (null == fm.encoding()) { //ignore (ZapfDingbats and Symbol run through here diff -Nurd fop-0.20.5/src/org/apache/fop/svg/PDFGraphics2D.java fop-0.20.5-new/src/org/apache/fop/svg/PDFGraphics2D.java --- fop-0.20.5/src/org/apache/fop/svg/PDFGraphics2D.java 2003-07-14 22:03:16.000000000 -0400 +++ fop-0.20.5-new/src/org/apache/fop/svg/PDFGraphics2D.java 2010-02-03 21:59:27.000000000 -0500 @@ -1322,11 +1322,26 @@ return new PDFGraphicsDevice(this); } - // needed for compiling under jdk1.4 @jdk14codestart@ + public java.awt.image.VolatileImage createCompatibleVolatileImage(int width, int height) { - return null; + try { + return super.createCompatibleVolatileImage(width, height, new ImageCapabilities(false)); + } catch (java.awt.AWTException e) { + e.printStackTrace(); + return null; + } } + + public java.awt.image.VolatileImage createCompatibleVolatileImage(int width, int height, int transparency) { + try { + return super.createCompatibleVolatileImage(width, height, new ImageCapabilities(false), transparency); + } catch (java.awt.AWTException e) { + e.printStackTrace(); + return null; + } + } + @jdk14codeend@ } diff -Nurd fop-0.20.5/xalan.sh fop-0.20.5-new/xalan.sh --- fop-0.20.5/xalan.sh 2003-07-14 22:03:25.000000000 -0400 +++ fop-0.20.5-new/xalan.sh 2010-02-03 21:49:04.000000000 -0500 @@ -11,7 +11,11 @@ darwin=false; case "`uname`" in CYGWIN*) cygwin=true ;; - Darwin*) darwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=@JAVA_HOME@ + fi + ;; esac if [ -z "$FOP_HOME" ] ; then @@ -42,6 +46,8 @@ fi +FOP_HOME=@PREFIX@/share/java/fop + # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$FOP_HOME" ] && @@ -76,10 +82,10 @@ fi # add fop.jar, which resides in $FOP_HOME/build -LOCALCLASSPATH=${FOP_HOME}/build/fop.jar:$LOCALCLASSPATH +LOCALCLASSPATH=${FOP_HOME}/fop.jar:$LOCALCLASSPATH # add in the dependency .jar files, which reside in $FOP_HOME/lib -DIRLIBS=${FOP_HOME}/lib/*.jar +DIRLIBS=${FOP_HOME}/*.jar for i in ${DIRLIBS} do # if the directory is empty, then it will return the input string @@ -100,5 +106,5 @@ LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` fi -$JAVACMD -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.xalan.xslt.Process "$@" +$JAVACMD -Xms64M -Xmx320M -Djava.awt.headless=true -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.xalan.xslt.Process "$@"