From batikjanetmason@example.net Wed Sep 01 09:35:29 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 33120 invoked from network); 1 Sep 2004 09:35:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 1 Sep 2004 09:35:29 -0000 Received: (qmail 54154 invoked by uid 500); 1 Sep 2004 09:35:29 -0000 Delivered-To: janetmason@example.net Received: (qmail 54031 invoked by uid 500); 1 Sep 2004 09:35:27 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net> List-Help: <mailto:janetmason@example.net> List-Unsubscribe: <mailto:janetmason@example.net> List-Subscribe: <mailto:janetmason@example.net> Reply-To: janetmason@example.net Delivered-To: mailing list janetmason@example.net Received: (qmail 54018 invoked by uid 500); 1 Sep 2004 09:35:27 -0000 Delivered-To: janetmason@example.net X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 1 Sep 2004 09:35:24 -0000 Message-ID: <janetmason@example.net> From: janetmason@example.net To: janetmason@example.net Subject: cvs commit: xml-batik/test-resources/org/apache/batik/dom/svg bug30580.svg unitTesting.xml X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N deweese 2004/09/01 02:35:24 Modified: resources/org/apache/batik/svggen/font/resources Messages.properties sources/org/apache/batik/apps/svgbrowser JAuthenticator.java sources/org/apache/batik/bridge SVGKernElementBridge.java sources/org/apache/batik/dom/svg SVGOMImageElement.java SVGOMMarkerElement.java SVGOMPatternElement.java SVGOMSVGElement.java SVGOMSymbolElement.java SVGOMViewElement.java sources/org/apache/batik/gvt/font Kern.java KerningTable.java SVGGVTGlyphVector.java UnicodeRange.java sources/org/apache/batik/gvt/text ArabicTextHandler.java sources/org/apache/batik/svggen/font SVGFont.java sources/org/apache/batik/svggen/font/table CmapFormat.java CmapFormat0.java CmapFormat2.java CmapFormat4.java CmapFormat6.java sources/org/apache/batik/util RunnableQueue.java SVGConstants.java test-resources/org/apache/batik/dom/svg unitTesting.xml Added: sources/org/apache/batik/dom/svg AbstractSVGPreserveAspectRatio.java SVGOMAnimatedPreserveAspectRatio.java SVGPreserveAspectRatioSupport.java test-resources/org/apache/batik/dom/svg bug30580.svg Log: 1) Included Tonny's support for preserveAspectRatio DOM methods. 2) Some improvements for Kerning in SVG Font (faster) 3) ttf2svg now supports 'auto ranging' so it looks at the font to decide what to output. 4) All Object.wait calls are now in while loops to prevent spurious wakeups. PR: 28432, 30580, 30739 Revision Changes Path 1.3 +1 -1 xml-batik/resources/org/apache/batik/svggen/font/resources/Messages.properties Index: Messages.properties =================================================================== RCS file: /home/cvs/xml-batik/resources/org/apache/batik/svggen/font/resources/Messages.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Messages.properties 8 Aug 2003 11:39:28 -0000 1.2 +++ Messages.properties 1 Sep 2004 09:35:22 -0000 1.3 @@ -46,7 +46,7 @@ ############################################################################### SVGFont.config.usage = \ -usage: java org.apache.batik.svggen.font.SVGFont <ttf-path> [-l <range-begin>] [-h <range-end>] [-ascii] [-id <id>] [-o <output-path>] [-testcard] +usage: java org.apache.batik.svggen.font.SVGFont <ttf-path> [-l <range-begin>] [-h <range-end>] [-autorange] [-ascii] [-id <id>] [-o <output-path>] [-testcard] SVGFont.config.svg.begin = \ <?xml version="1.0" standalone="no"?> \ 1.6 +9 -4 xml-batik/sources/org/apache/batik/apps/svgbrowser/JAuthenticator.java Index: JAuthenticator.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/JAuthenticator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JAuthenticator.java 18 Aug 2004 07:12:27 -0000 1.5 +++ JAuthenticator.java 1 Sep 2004 09:35:22 -0000 1.6 @@ -77,6 +77,7 @@ Object lock = new Object(); private boolean result; + private boolean wasNotified; private String userID; private char [] password; @@ -192,9 +193,12 @@ window.setVisible(true); } }); - try { - lock.wait(); - } catch(InterruptedException ie) { } + wasNotified = false; + while (!wasNotified) { + try { + lock.wait(); + } catch(InterruptedException ie) { } + } if (!result) return null; @@ -211,6 +215,7 @@ password = JPassword.getPassword(); JPassword.setText(""); result = true; + wasNotified = true; lock.notifyAll(); } } @@ -226,7 +231,7 @@ password = null; JPassword.setText(""); result = false; - + wasNotified = true; lock.notifyAll(); } } 1.6 +89 -37 xml-batik/sources/org/apache/batik/bridge/SVGKernElementBridge.java Index: SVGKernElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGKernElementBridge.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SVGKernElementBridge.java 18 Aug 2004 07:12:35 -0000 1.5 +++ SVGKernElementBridge.java 1 Sep 2004 09:35:22 -0000 1.6 @@ -18,7 +18,8 @@ package org.apache.batik.bridge; import java.util.StringTokenizer; -import java.util.Vector; +import java.util.List; +import java.util.ArrayList; import org.apache.batik.gvt.font.Kern; import org.apache.batik.gvt.font.UnicodeRange; @@ -55,16 +56,17 @@ if (k.length() == 0) { k = SVG_KERN_K_DEFAULT_VALUE; } - + // get the kern float value float kernValue = Float.parseFloat(k); - + // set up the first and second glyph sets and unicode ranges - Vector firstGlyphSet = new Vector(); - Vector secondGlyphSet = new Vector(); - Vector firstUnicodeRanges = new Vector(); - Vector secondUnicodeRanges = new Vector(); - + int firstGlyphLen = 0, secondGlyphLen = 0; + int [] firstGlyphSet = null; + int [] secondGlyphSet = null; + List firstUnicodeRanges = new ArrayList(); + List secondUnicodeRanges = new ArrayList(); + // process the u1 attribute StringTokenizer st = new StringTokenizer(u1, ","); while (st.hasMoreTokens()) { @@ -73,12 +75,22 @@ firstUnicodeRanges.add(new UnicodeRange(token)); } else { int[] glyphCodes = font.getGlyphCodesForUnicode(token); - for (int i = 0; i < glyphCodes.length; i++) { - firstGlyphSet.add(new Integer(glyphCodes[i])); + if (firstGlyphSet == null) + firstGlyphSet = glyphCodes; + else if ((firstGlyphLen + glyphCodes.length) > + firstGlyphSet.length) { + int sz = firstGlyphSet.length*2; + if (sz <firstGlyphLen + glyphCodes.length) + sz = firstGlyphLen + glyphCodes.length; + int [] tmp = new int[sz]; + for (int i = 0; i < glyphCodes.length; i++) + tmp[i] = firstGlyphSet[i]; } + for (int i = 0; i < glyphCodes.length; i++) + firstGlyphSet[firstGlyphLen++] = glyphCodes[i]; } } - + // process the u2 attrbute st = new StringTokenizer(u2, ","); while (st.hasMoreTokens()) { @@ -87,51 +99,91 @@ secondUnicodeRanges.add(new UnicodeRange(token)); } else { int[] glyphCodes = font.getGlyphCodesForUnicode(token); - for (int i = 0; i < glyphCodes.length; i++) { - secondGlyphSet.add(new Integer(glyphCodes[i])); + if (secondGlyphSet == null) + secondGlyphSet = glyphCodes; + else if ((secondGlyphLen + glyphCodes.length) > + secondGlyphSet.length) { + int sz = secondGlyphSet.length*2; + if (sz <secondGlyphLen + glyphCodes.length) + sz = secondGlyphLen + glyphCodes.length; + int [] tmp = new int[sz]; + for (int i = 0; i < glyphCodes.length; i++) + tmp[i] = secondGlyphSet[i]; } + for (int i = 0; i < glyphCodes.length; i++) + secondGlyphSet[secondGlyphLen++] = glyphCodes[i]; } } - + // process the g1 attribute st = new StringTokenizer(g1, ","); while (st.hasMoreTokens()) { String token = st.nextToken(); int[] glyphCodes = font.getGlyphCodesForName(token); - for (int i = 0; i < glyphCodes.length; i++) { - firstGlyphSet.add(new Integer(glyphCodes[i])); + if (firstGlyphSet == null) + firstGlyphSet = glyphCodes; + else if ((firstGlyphLen + glyphCodes.length) > + firstGlyphSet.length) { + int sz = firstGlyphSet.length*2; + if (sz <firstGlyphLen + glyphCodes.length) + sz = firstGlyphLen + glyphCodes.length; + int [] tmp = new int[sz]; + for (int i = 0; i < glyphCodes.length; i++) + tmp[i] = firstGlyphSet[i]; } + for (int i = 0; i < glyphCodes.length; i++) + firstGlyphSet[firstGlyphLen++] = glyphCodes[i]; } - + // process the g2 attribute st = new StringTokenizer(g2, ","); while (st.hasMoreTokens()) { String token = st.nextToken(); int[] glyphCodes = font.getGlyphCodesForName(token); - for (int i = 0; i < glyphCodes.length; i++) { - secondGlyphSet.add(new Integer(glyphCodes[i])); + if (secondGlyphSet == null) + secondGlyphSet = glyphCodes; + else if ((secondGlyphLen + glyphCodes.length) > + secondGlyphSet.length) { + int sz = secondGlyphSet.length*2; + if (sz <secondGlyphLen + glyphCodes.length) + sz = secondGlyphLen + glyphCodes.length; + int [] tmp = new int[sz]; + for (int i = 0; i < glyphCodes.length; i++) + tmp[i] = secondGlyphSet[i]; } + for (int i = 0; i < glyphCodes.length; i++) + secondGlyphSet[secondGlyphLen++] = glyphCodes[i]; } // construct the arrays - int[] firstGlyphs = new int[firstGlyphSet.size()]; - int[] secondGlyphs = new int[secondGlyphSet.size()]; - UnicodeRange[] firstRanges = new UnicodeRange[firstUnicodeRanges.size()]; - UnicodeRange[] secondRanges = new UnicodeRange[secondUnicodeRanges.size()]; - for (int i = 0; i < firstGlyphSet.size(); i++) { - firstGlyphs[i] = ((Integer)firstGlyphSet.elementAt(i)).intValue(); - } - for (int i = 0; i < secondGlyphSet.size(); i++) { - secondGlyphs[i] = ((Integer)secondGlyphSet.elementAt(i)).intValue(); - } - for (int i = 0; i < firstUnicodeRanges.size(); i++) { - firstRanges[i] = (UnicodeRange)firstUnicodeRanges.elementAt(i); - } - for (int i = 0; i < secondUnicodeRanges.size(); i++) { - secondRanges[i] = (UnicodeRange)secondUnicodeRanges.elementAt(i); - } + int[] firstGlyphs; + if ((firstGlyphLen == 0) || + (firstGlyphLen == firstGlyphSet.length)) { + firstGlyphs = firstGlyphSet; + } else { + firstGlyphs = new int[firstGlyphLen]; + System.arraycopy(firstGlyphSet, 0, firstGlyphs, 0, firstGlyphLen); + } + int[] secondGlyphs; + if ((secondGlyphLen == 0) || + (secondGlyphLen == secondGlyphSet.length)) { + secondGlyphs = secondGlyphSet; + } else { + secondGlyphs = new int[secondGlyphLen]; + System.arraycopy(secondGlyphSet, 0, secondGlyphs, 0, + secondGlyphLen); + } + + UnicodeRange[] firstRanges; + firstRanges = new UnicodeRange[firstUnicodeRanges.size()]; + firstUnicodeRanges.toArray(firstRanges); + + UnicodeRange[] secondRanges; + secondRanges = new UnicodeRange[secondUnicodeRanges.size()]; + secondUnicodeRanges.toArray(secondRanges); // return the new Kern object - return new Kern(firstGlyphs, secondGlyphs, firstRanges, secondRanges, kernValue); + return new Kern(firstGlyphs, secondGlyphs, + firstRanges, secondRanges, kernValue); } } 1.12 +2 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGOMImageElement.java Index: SVGOMImageElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMImageElement.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- SVGOMImageElement.java 18 Aug 2004 07:13:17 -0000 1.11 +++ SVGOMImageElement.java 1 Sep 2004 09:35:22 -0000 1.12 @@ -117,7 +117,7 @@ * <b>DOM</b>: Implements {@link SVGImageElement#getPreserveAspectRatio()}. */ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { - throw new RuntimeException(" !!! TODO: getPreserveAspectRatio()"); + return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); } /** 1.9 +2 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java Index: SVGOMMarkerElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- SVGOMMarkerElement.java 18 Aug 2004 07:13:17 -0000 1.8 +++ SVGOMMarkerElement.java 1 Sep 2004 09:35:22 -0000 1.9 @@ -173,7 +173,7 @@ * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}. */ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { - throw new RuntimeException(" !!! TODO: getPreserveAspectRatio()"); + return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); } // SVGExternalResourcesRequired support ///////////////////////////// 1.15 +2 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java Index: SVGOMPatternElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- SVGOMPatternElement.java 18 Aug 2004 07:13:17 -0000 1.14 +++ SVGOMPatternElement.java 1 Sep 2004 09:35:22 -0000 1.15 @@ -181,7 +181,7 @@ * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}. */ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { - throw new RuntimeException(" !!! TODO: getPreserveAspectRatio()"); + return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); } // SVGExternalResourcesRequired support ///////////////////////////// 1.27 +2 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java Index: SVGOMSVGElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- SVGOMSVGElement.java 18 Aug 2004 07:13:18 -0000 1.26 +++ SVGOMSVGElement.java 1 Sep 2004 09:35:22 -0000 1.27 @@ -553,7 +553,7 @@ * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}. */ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { - throw new RuntimeException(" !!! TODO: getPreserveAspectRatio()"); + return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); } // SVGExternalResourcesRequired support ///////////////////////////// 1.13 +2 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java Index: SVGOMSymbolElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- SVGOMSymbolElement.java 18 Aug 2004 07:13:18 -0000 1.12 +++ SVGOMSymbolElement.java 1 Sep 2004 09:35:23 -0000 1.13 @@ -136,7 +136,7 @@ * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}. */ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { - throw new RuntimeException(" !!! TODO: getPreserveAspectRatio()"); + return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); } // SVGExternalResourcesRequired support ///////////////////////////// 1.7 +2 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGOMViewElement.java Index: SVGOMViewElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMViewElement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- SVGOMViewElement.java 18 Aug 2004 07:13:18 -0000 1.6 +++ SVGOMViewElement.java 1 Sep 2004 09:35:23 -0000 1.7 @@ -113,7 +113,7 @@ * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}. */ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { - throw new RuntimeException(" !!! TODO: getPreserveAspectRatio()"); + return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); } // SVGExternalResourcesRequired support ///////////////////////////// 1.1 xml-batik/sources/org/apache/batik/dom/svg/AbstractSVGPreserveAspectRatio.java Index: AbstractSVGPreserveAspectRatio.java =================================================================== /* Copyright 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. */ package org.apache.batik.dom.svg; import java.util.StringTokenizer; import org.apache.batik.util.SVGConstants; import org.apache.batik.parser.ParseException; import org.apache.batik.parser.DefaultPreserveAspectRatioHandler; import org.apache.batik.parser.PreserveAspectRatioHandler; import org.apache.batik.parser.PreserveAspectRatioParser; import org.w3c.dom.DOMException; import org.w3c.dom.svg.SVGPreserveAspectRatio; /** * Abstract implementation for SVGPreservAspectRatio * * This is the base implementation for SVGPreservAspectRatio * * @author Tonny Kohar */ public abstract class AbstractSVGPreserveAspectRatio implements SVGPreserveAspectRatio { /** * align property by default the value is * SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID */ protected short align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID; /** * meetOrSlice property * by default the value is SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET; */ protected short meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET; /** Creates a new instance of AbstractSVGPreserveAspectRatio */ public AbstractSVGPreserveAspectRatio() { } public short getAlign() { return this.align; } public short getMeetOrSlice() { return this.meetOrSlice; } public void setAlign(short align) { this.align = align; setAttributeValue(getValueAsString()); } public void setMeetOrSlice(short meetOrSlice) { this.meetOrSlice = meetOrSlice; setAttributeValue(getValueAsString()); } public void reset() { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID; meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET; //setAttributeValue(getValueAsString()); } protected abstract void setAttributeValue(String value) throws DOMException; protected abstract DOMException createDOMException(short type, String key, Object[] args); protected void setValueAsString(String value) throws DOMException { PreserveAspectRatioParserHandler ph; ph = new PreserveAspectRatioParserHandler(); try { PreserveAspectRatioParser p = new PreserveAspectRatioParser(); p.setPreserveAspectRatioHandler(ph); p.parse(value); align = ph.getAlign(); meetOrSlice = ph.getMeetOrSlice(); } catch (ParseException ex) { throw createDOMException(SVG_PRESERVEASPECTRATIO_UNKNOWN, "invalid value for preserveAspectRatio", null); } } /** Return the value of String to be used on setAttributeNS, in * other word the mapping of align meetOrSlice to representation * string use by SVG */ protected String getValueAsString() { String value = null; switch (align) { case SVG_PRESERVEASPECTRATIO_NONE: value = SVGConstants.SVG_NONE_VALUE; return value; // if none ignore the rest case SVG_PRESERVEASPECTRATIO_XMINYMIN: value = SVGConstants.SVG_XMINYMIN_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMIDYMIN: value = SVGConstants.SVG_XMIDYMIN_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMAXYMIN: value = SVGConstants.SVG_XMAXYMIN_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMINYMID: value = SVGConstants.SVG_XMINYMID_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMIDYMID: value = SVGConstants.SVG_XMIDYMID_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMAXYMID: value = SVGConstants.SVG_XMAXYMID_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMINYMAX: value = SVGConstants.SVG_XMINYMAX_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMIDYMAX: value = SVGConstants.SVG_XMIDYMAX_VALUE; break; case SVG_PRESERVEASPECTRATIO_XMAXYMAX: value = SVGConstants.SVG_XMAXYMAX_VALUE; break; default: throw createDOMException (SVG_PRESERVEASPECTRATIO_UNKNOWN, "invalid value for preserveAspectRatio",null); //break; } switch (meetOrSlice) { case SVG_MEETORSLICE_MEET: value = value + " " + SVGConstants.SVG_MEET_VALUE; break; case SVG_MEETORSLICE_SLICE: value = value + " " + SVGConstants.SVG_SLICE_VALUE; break; default: throw createDOMException(SVG_MEETORSLICE_UNKNOWN, "invalid value for preserveAspectRatio", null); //break; } return value; } protected class PreserveAspectRatioParserHandler extends DefaultPreserveAspectRatioHandler { public short align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID; public short meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET; public short getAlign() { return align; } public short getMeetOrSlice() { return meetOrSlice; } /** * Invoked when 'none' been parsed. * @exception ParseException if an error occured while processing * the transform */ public void none() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE; } /** * Invoked when 'xMaxYMax' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMaxYMax() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMAX; } /** * Invoked when 'xMaxYMid' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMaxYMid() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMID; } /** * Invoked when 'xMaxYMin' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMaxYMin() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMIN; } /** * Invoked when 'xMidYMax' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMidYMax() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMAX; } /** * Invoked when 'xMidYMid' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMidYMid() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID; } /** * Invoked when 'xMidYMin' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMidYMin() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMIN; } /** * Invoked when 'xMinYMax' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMinYMax() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMAX; } /** * Invoked when 'xMinYMid' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMinYMid() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMID; } /** * Invoked when 'xMinYMin' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void xMinYMin() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMIN; } /** * Invoked when 'meet' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void meet() throws ParseException { meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET; } /** * Invoked when 'slice' has been parsed. * @exception ParseException if an error occured while processing * the transform */ public void slice() throws ParseException { meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE; } } } 1.1 xml-batik/sources/org/apache/batik/dom/svg/SVGOMAnimatedPreserveAspectRatio.java Index: SVGOMAnimatedPreserveAspectRatio.java =================================================================== /* Copyright 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. */ package org.apache.batik.dom.svg; import org.apache.batik.util.SVGConstants; import org.w3c.dom.Attr; import org.w3c.dom.DOMException; import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio; import org.w3c.dom.svg.SVGPreserveAspectRatio; import org.w3c.dom.svg.SVGException; /** * This class implements the {@link SVGAnimatePreserveAspectRatio} interface. * * @author Tonny Kohar */ public class SVGOMAnimatedPreserveAspectRatio implements SVGAnimatedPreserveAspectRatio, LiveAttributeValue { /** * The associated element. */ protected AbstractElement element; /** * Whether the value is changing. */ protected boolean changing = false; /** * SVGPreserveAspectRatio mapping the static 'preserveAspectRatio' * attribute. */ protected AbstractSVGPreserveAspectRatio preserveAspectRatio; /** Creates a new instance of SVGOMAnimatePreserveAspectRatio */ public SVGOMAnimatedPreserveAspectRatio(AbstractElement elt) { element = elt; preserveAspectRatio = new SVGOMPreserveAspectRatio(); String attrValue = elt.getAttributeNS (null,SVGConstants.SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE); if (attrValue != null) { preserveAspectRatio.setValueAsString(attrValue); } } public void attrAdded(Attr node, String newv) { if (!changing) { preserveAspectRatio.setValueAsString(newv); System.out.println("attr added: " + newv); } } public void attrModified(Attr node, String oldv, String newv) { if (!changing) { preserveAspectRatio.setValueAsString(newv); } } public void attrRemoved(Attr node, String oldv) { if (!changing) { preserveAspectRatio.reset(); } } public SVGPreserveAspectRatio getAnimVal() { throw new RuntimeException("!!! TODO: getAnimVal()"); } public SVGPreserveAspectRatio getBaseVal() { return preserveAspectRatio; } /** The implementation of SVGPreserveAspectRatio */ public class SVGOMPreserveAspectRatio extends AbstractSVGPreserveAspectRatio { /** * Create a DOMException. */ protected DOMException createDOMException(short type, String key, Object[] args){ return element.createDOMException(type,key,args); } protected void setAttributeValue(String value) throws DOMException { try { changing = true; element.setAttributeNS (null,SVGConstants.SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, value); } finally { changing = false; } } } } 1.1 xml-batik/sources/org/apache/batik/dom/svg/SVGPreserveAspectRatioSupport.java Index: SVGPreserveAspectRatioSupport.java =================================================================== /* Copyright 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. */ package org.apache.batik.dom.svg; import org.apache.batik.util.SVGConstants; import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio; /** * * @author Tonny Kohar */ public class SVGPreserveAspectRatioSupport { /** * To implement getPreserveAspectRatio. * Returns the value of the 'preserveAspectRatio' attribute of the * given element. */ public static SVGAnimatedPreserveAspectRatio getPreserveAspectRatio(AbstractElement elt) { SVGOMAnimatedPreserveAspectRatio ret; ret = (SVGOMAnimatedPreserveAspectRatio)elt.getLiveAttributeValue (null, SVGConstants.SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE); if (ret == null) { ret = new SVGOMAnimatedPreserveAspectRatio(elt); elt.putLiveAttributeValue (null, SVGConstants.SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, ret); } return ret; } } 1.6 +63 -13 xml-batik/sources/org/apache/batik/gvt/font/Kern.java Index: Kern.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/font/Kern.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Kern.java 18 Aug 2004 07:14:35 -0000 1.5 +++ Kern.java 1 Sep 2004 09:35:23 -0000 1.6 @@ -17,6 +17,8 @@ */ package org.apache.batik.gvt.font; +import java.util.Arrays; + /** * The Kern class describes an entry in the "kerning table". It provides * a kerning value to be used when laying out characters side @@ -60,6 +62,11 @@ this.firstUnicodeRanges = firstUnicodeRanges; this.secondUnicodeRanges = secondUnicodeRanges; this.kerningAdjust = adjustValue; + + if (firstGlyphCodes != null) + Arrays.sort(this.firstGlyphCodes); + if (secondGlyphCodes != null) + Arrays.sort(this.secondGlyphCodes); } /** @@ -68,19 +75,40 @@ * * @param glyphCode The id of the glyph to test. * @param glyphUnicode The unicode value of the glyph to test. - * @return True if this glyph is in the list of first glyphs for the kerning - * entry + * @return True if this glyph is in the list of first glyphs for + * the kerning entry */ public boolean matchesFirstGlyph(int glyphCode, String glyphUnicode) { - for (int i = 0; i < firstGlyphCodes.length; i++) { - if (firstGlyphCodes[i] == glyphCode) { + if (firstGlyphCodes != null) { + int pt = Arrays.binarySearch(firstGlyphCodes, glyphCode); + if (pt >= 0) return true; + } + if (glyphUnicode.length() < 1) return false; + char glyphChar = glyphUnicode.charAt(0); + for (int i = 0; i < firstUnicodeRanges.length; i++) { + if (firstUnicodeRanges[i].contains(glyphChar)) return true; - } + } + return false; + } + + /** + * Returns true if the specified glyph is one of the glyphs considered + * as first by this kerning entry. Returns false otherwise. + * + * @param glyphCode The id of the glyph to test. + * @param glyphUnicode The unicode value of the glyph to test. + * @return True if this glyph is in the list of first glyphs for + * the kerning entry + */ + public boolean matchesFirstGlyph(int glyphCode, char glyphUnicode) { + if (firstGlyphCodes != null) { + int pt = Arrays.binarySearch(firstGlyphCodes, glyphCode); + if (pt >= 0) return true; } for (int i = 0; i < firstUnicodeRanges.length; i++) { - if (firstUnicodeRanges[i].contains(glyphUnicode)) { + if (firstUnicodeRanges[i].contains(glyphUnicode)) return true; - } } return false; } @@ -96,15 +124,37 @@ * kerning entry */ public boolean matchesSecondGlyph(int glyphCode, String glyphUnicode) { - for (int i = 0; i < secondGlyphCodes.length; i++) { - if (secondGlyphCodes[i] == glyphCode) { + if (secondGlyphCodes != null) { + int pt = Arrays.binarySearch(secondGlyphCodes, glyphCode); + if (pt >= 0) return true; + } + if (glyphUnicode.length() < 1) return false; + char glyphChar = glyphUnicode.charAt(0); + for (int i = 0; i < secondUnicodeRanges.length; i++) { + if (secondUnicodeRanges[i].contains(glyphChar)) return true; - } + } + return false; + } + + /** + * Returns true if the specified glyph is one of the glyphs considered + * as second by this kerning entry. Returns false otherwise. + * + * @param glyphCode The id of the glyph to test. + * @param glyphUnicode The unicode value of the glyph to test. + + * @return True if this glyph is in the list of second glyphs for the + * kerning entry + */ + public boolean matchesSecondGlyph(int glyphCode, char glyphUnicode) { + if (secondGlyphCodes != null) { + int pt = Arrays.binarySearch(secondGlyphCodes, glyphCode); + if (pt >= 0) return true; } for (int i = 0; i < secondUnicodeRanges.length; i++) { - if (secondUnicodeRanges[i].contains(glyphUnicode)) { + if (secondUnicodeRanges[i].contains(glyphUnicode)) return true; - } } return false; } 1.6 +5 -5 xml-batik/sources/org/apache/batik/gvt/font/KerningTable.java Index: KerningTable.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/font/KerningTable.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- KerningTable.java 18 Aug 2004 07:14:35 -0000 1.5 +++ KerningTable.java 1 Sep 2004 09:35:23 -0000 1.6 @@ -46,10 +46,10 @@ * * @param glyphCode1 The id of the first glyph in the kerning pair * @param glyphCode2 The id of the second glyph in the kerning pair - * @param glyphUnicode1 The unicode value of the first glyph in the kerning - * pair - * @param glyphUnicode2 The unicode vlaue of the second glyph in the kerning - * pair + * @param glyphUnicode1 The unicode value of the first glyph in + * the kerning pair + * @param glyphUnicode2 The unicode vlaue of the second glyph in + * the kerning pair * @return The amount of kerning to be added when laying out the glyphs */ public float getKerningValue(int glyphCode1, 1.19 +5 -4 xml-batik/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java Index: SVGGVTGlyphVector.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- SVGGVTGlyphVector.java 18 Aug 2004 07:14:35 -0000 1.18 +++ SVGGVTGlyphVector.java 1 Sep 2004 09:35:23 -0000 1.19 @@ -663,6 +663,10 @@ * layout is horizontal. */ public void performDefaultLayout() { + logicalBounds = null; + outline = null; + bounds2D = null; + float currentX = 0; float currentY = 0; for (int i = 0; i < glyphs.length; i++) { @@ -670,9 +674,6 @@ glyphs[i].setTransform(null); glyphLogicalBounds[i] = null; currentX += glyphs[i].getHorizAdvX(); - logicalBounds = null; - outline = null; - bounds2D = null; } endPos = new Point2D.Float(currentX, currentY); } 1.5 +11 -6 xml-batik/sources/org/apache/batik/gvt/font/UnicodeRange.java Index: UnicodeRange.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/font/UnicodeRange.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- UnicodeRange.java 18 Aug 2004 07:14:36 -0000 1.4 +++ UnicodeRange.java 1 Sep 2004 09:35:23 -0000 1.5 @@ -19,7 +19,9 @@ /** - * A class that represents a CSS unicode range. + * A class that represents a CSS unicode range. This only handles + * a single range of contigous chars, to handle multiple ranges + * (comma seperated) use a list of these. * * @author <a href="mailto:janetmason@example.net">Bella Robinson</a> * @version $Id$ @@ -73,11 +75,14 @@ public boolean contains(String unicode) { if (unicode.length() == 1) { int unicodeVal = unicode.charAt(0); - if (unicodeVal >= firstUnicodeValue - && unicodeVal <= lastUnicodeValue) { - return true; - } + return contains(unicodeVal); } return false; } + + public boolean contains(int unicodeVal) { + return ((unicodeVal >= firstUnicodeValue) && + (unicodeVal <= lastUnicodeValue)); + } + } 1.7 +10 -8 xml-batik/sources/org/apache/batik/gvt/text/ArabicTextHandler.java Index: ArabicTextHandler.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/text/ArabicTextHandler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ArabicTextHandler.java 18 Aug 2004 07:14:40 -0000 1.6 +++ ArabicTextHandler.java 1 Sep 2004 09:35:23 -0000 1.7 @@ -374,15 +374,16 @@ } /** - * Where possible substitues plain arabic glyphs with their shaped forms. - * This is needed when the arabic text is rendered using an AWT font. - * Simple arabic ligatures will also be recognised and replaced by a single - * character so the length of the resulting string may be shorter than the number - * of characters in the aci. + * Where possible substitues plain arabic glyphs with their shaped + * forms. This is needed when the arabic text is rendered using + * an AWT font. Simple arabic ligatures will also be recognised + * and replaced by a single character so the length of the + * resulting string may be shorter than the number of characters + * in the aci. * * @param aci Contains the text to process. Arabic form attributes * should already be assigned to each arabic character. - * @return A String containing the shaped versions of the arabic characters. + * @return A String containing the shaped versions of the arabic characters */ public static String createSubstituteString(AttributedCharacterIterator aci) { @@ -451,7 +452,8 @@ } /** - * Returns true if a ligature exists that starts with the specified character. + * Returns true if a ligature exists that starts with the + * specified character. * * @param c The character to test. * @return True if there is a ligature that starts with c, false otherwise. 1.7 +22 -6 xml-batik/sources/org/apache/batik/svggen/font/SVGFont.java Index: SVGFont.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/font/SVGFont.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- SVGFont.java 9 Aug 2003 16:58:42 -0000 1.6 +++ SVGFont.java 1 Sep 2004 09:35:23 -0000 1.7 @@ -81,6 +81,9 @@ static final String PROPERTY_LINE_SEPARATOR = "line.separator"; static final String PROPERTY_LINE_SEPARATOR_DEFAULT = "\n"; + static final int DEFAULT_FIRST = 32; + static final int DEFAULT_LAST = 128; + static { String temp; try { @@ -296,7 +299,7 @@ * @param last The last character in the output range * @param forceAscii Force the use of the ASCII character map */ - protected static void writeFontAsSVGFragment(PrintStream ps, Font font, String id, int first, int last, boolean forceAscii) + protected static void writeFontAsSVGFragment(PrintStream ps, Font font, String id, int first, int last, boolean autoRange, boolean forceAscii) throws Exception { // StringBuffer sb = new StringBuffer(); // int horiz_advance_x = font.getHmtxTable().getAdvanceWidth( @@ -350,8 +353,9 @@ throw new Exception("Cannot find a suitable cmap table"); } - // If this font includes arabic script, we want to specify substitutions - // for initial, medial, terminal & isolated cases. + // If this font includes arabic script, we want to specify + // substitutions for initial, medial, terminal & isolated + // cases. GsubTable gsub = (GsubTable) font.getTable(Table.GSUB); SingleSubst initialSubst = null; SingleSubst medialSubst = null; @@ -380,6 +384,15 @@ initialSubst, medialSubst, terminalSubst, "")); try { + if (first == -1) { + if (!autoRange) first = DEFAULT_FIRST; + else first = cmapFmt.getFirst(); + } + if (last == -1) { + if (!autoRange) last = DEFAULT_LAST; + else last = cmapFmt.getLast(); + } + // Include our requested range for (int i = first; i <= last; i++) { int glyphIndex = cmapFmt.mapCharCode(i); @@ -679,6 +692,7 @@ public static final String ARG_KEY_ID = "-id"; public static final String ARG_KEY_ASCII = "-ascii"; public static final String ARG_KEY_TESTCARD = "-testcard"; + public static final String ARG_KEY_AUTO_RANGE = "-autorange"; public static final String ARG_KEY_OUTPUT_PATH = "-o"; /** @@ -694,6 +708,7 @@ String ascii = parseArgs(args, ARG_KEY_ASCII); String testCard = parseArgs(args, ARG_KEY_TESTCARD); String outPath = parseArgs(args, ARG_KEY_OUTPUT_PATH); + String autoRange = parseArgs(args, ARG_KEY_AUTO_RANGE); PrintStream ps = null; FileOutputStream fos = null; @@ -718,8 +733,9 @@ ps, font, id, - (low != null ? Integer.parseInt(low) : 32), - (high != null ? Integer.parseInt(high) : 127), + (low != null ? Integer.parseInt(low) : -1), + (high != null ? Integer.parseInt(high) : -1), + (autoRange != null), (ascii != null)); writeSvgDefsEnd(ps); if (testCard != null) { 1.4 +4 -1 xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat.java Index: CmapFormat.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CmapFormat.java 18 Aug 2004 07:15:19 -0000 1.3 +++ CmapFormat.java 1 Sep 2004 09:35:23 -0000 1.4 @@ -64,6 +64,9 @@ public abstract int mapCharCode(int charCode); + public abstract int getFirst(); + public abstract int getLast(); + public String toString() { return new StringBuffer() .append("format: ") 1.4 +10 -1 xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat0.java Index: CmapFormat0.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat0.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CmapFormat0.java 18 Aug 2004 07:15:19 -0000 1.3 +++ CmapFormat0.java 1 Sep 2004 09:35:23 -0000 1.4 @@ -29,14 +29,23 @@ public class CmapFormat0 extends CmapFormat { private int[] glyphIdArray = new int[256]; + private int first, last; protected CmapFormat0(RandomAccessFile raf) throws IOException { super(raf); format = 0; + first = -1; for (int i = 0; i < 256; i++) { glyphIdArray[i] = raf.readUnsignedByte(); + if (glyphIdArray[i] > 0) { + if (first == -1) first = i; + last = i; + } } } + + public int getFirst() { return first; } + public int getLast() { return last; } public int mapCharCode(int charCode) { if (0 <= charCode && charCode < 256) { 1.4 +4 -1 xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat2.java Index: CmapFormat2.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CmapFormat2.java 18 Aug 2004 07:15:20 -0000 1.3 +++ CmapFormat2.java 1 Sep 2004 09:35:23 -0000 1.4 @@ -36,6 +36,9 @@ format = 2; } + public int getFirst() { return 0; } + public int getLast() { return 0; } + public int mapCharCode(int charCode) { return 0; } 1.6 +8 -1 xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat4.java Index: CmapFormat4.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat4.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- CmapFormat4.java 27 Aug 2004 00:42:07 -0000 1.5 +++ CmapFormat4.java 1 Sep 2004 09:35:23 -0000 1.6 @@ -37,6 +37,7 @@ private int[] idRangeOffset; private int[] glyphIdArray; private int segCount; + private int first, last; protected CmapFormat4(RandomAccessFile raf) throws IOException { super(raf); @@ -50,12 +51,15 @@ searchRange = raf.readUnsignedShort(); entrySelector = raf.readUnsignedShort(); rangeShift = raf.readUnsignedShort(); + last = -1; for (int i = 0; i < segCount; i++) { endCode[i] = raf.readUnsignedShort(); + if (endCode[i] > last) last = endCode[i]; } raf.readUnsignedShort(); // reservePad for (int i = 0; i < segCount; i++) { startCode[i] = raf.readUnsignedShort(); + if ((i==0 ) || (startCode[i] < first)) first = startCode[i]; } for (int i = 0; i < segCount; i++) { idDelta[i] = raf.readUnsignedShort(); @@ -71,6 +75,9 @@ glyphIdArray[i] = raf.readUnsignedShort(); } } + + public int getFirst() { return first; } + public int getLast() { return last; } public int mapCharCode(int charCode) { try { 1.4 +4 -1 xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat6.java Index: CmapFormat6.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/font/table/CmapFormat6.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CmapFormat6.java 18 Aug 2004 07:15:20 -0000 1.3 +++ CmapFormat6.java 1 Sep 2004 09:35:23 -0000 1.4 @@ -38,6 +38,9 @@ format = 6; } + public int getFirst() { return 0; } + public int getLast() { return 0; } + public int mapCharCode(int charCode) { return 0; } 1.17 +8 -5 xml-batik/sources/org/apache/batik/util/RunnableQueue.java Index: RunnableQueue.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/RunnableQueue.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- RunnableQueue.java 18 Aug 2004 07:15:49 -0000 1.16 +++ RunnableQueue.java 1 Sep 2004 09:35:23 -0000 1.17 @@ -329,10 +329,13 @@ } } - if (waitTillSuspended) - try { - stateLock.wait(); - } catch(InterruptedException ie) { } + if (waitTillSuspended) { + while (state == SUSPENDING) { + try { + stateLock.wait(); + } catch(InterruptedException ie) { } + } + } } } 1.73 +14 -2 xml-batik/sources/org/apache/batik/util/SVGConstants.java Index: SVGConstants.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/SVGConstants.java,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- SVGConstants.java 18 Aug 2004 07:15:50 -0000 1.72 +++ SVGConstants.java 1 Sep 2004 09:35:23 -0000 1.73 @@ -1,6 +1,6 @@ /* - Copyright 2000-2003 The Apache Software Foundation + Copyright 2000-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. @@ -453,6 +453,7 @@ String SVG_LANG_ATTRIBUTE = "lang"; String SVG_LENGTH_ADJUST_ATTRIBUTE = "lengthAdjust"; String SVG_LIGHT_COLOR_ATTRIBUTE = "lightColor"; + String SVG_LIGHTING_COLOR_ATTRIBUTE = "lighting-color"; String SVG_LIMITING_CONE_ANGLE_ATTRIBUTE = "limitingConeAngle"; String SVG_LOCAL_ATTRIBUTE = "local"; String SVG_MARKER_HEIGHT_ATTRIBUTE = "markerHeight"; @@ -637,6 +638,7 @@ String SVG_MAGNIFY_VALUE = "magnify"; String SVG_MATRIX_VALUE = "matrix"; String SVG_MEDIAL_VALUE = "medial"; + String SVG_MEET_VALUE = "meet"; String SVG_MIDDLE_VALUE = "middle"; String SVG_MITER_VALUE = "miter"; String SVG_MOVE_VALUE = "move"; @@ -673,6 +675,7 @@ String SVG_SATURATION_VALUE = "saturation"; String SVG_SCREEN_VALUE = "screen"; String SVG_SE_RESIZE_VALUE = "se-resize"; + String SVG_SLICE_VALUE = "slice"; String SVG_SOURCE_ALPHA_VALUE = "SourceAlpha"; String SVG_SOURCE_GRAPHIC_VALUE = "SourceGraphic"; String SVG_SPACING_AND_GLYPHS_VALUE = "spacingAndGlyphs"; @@ -697,6 +700,15 @@ String SVG_WAIT_VALUE = "wait"; String SVG_WRAP_VALUE = "wrap"; String SVG_W_RESIZE_VALUE = "w-resize"; + String SVG_XMAXYMAX_VALUE = "xMaxYMax"; + String SVG_XMAXYMID_VALUE = "xMaxYMid"; + String SVG_XMAXYMIN_VALUE = "xMaxYMin"; + String SVG_XMIDYMAX_VALUE = "xMidYMax"; + String SVG_XMIDYMID_VALUE = "xMidYMid"; + String SVG_XMIDYMIN_VALUE = "xMidYMin"; + String SVG_XMINYMAX_VALUE = "xMinYMax"; + String SVG_XMINYMID_VALUE = "xMinYMid"; + String SVG_XMINYMIN_VALUE = "xMinYMin"; String SVG_XOR_VALUE = "xor"; String SVG_ZERO_PERCENT_VALUE = "0%"; String SVG_ZERO_VALUE = "0"; 1.7 +2 -1 xml-batik/test-resources/org/apache/batik/dom/svg/unitTesting.xml Index: unitTesting.xml =================================================================== RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/dom/svg/unitTesting.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- unitTesting.xml 8 Aug 2003 11:39:45 -0000 1.6 +++ unitTesting.xml 1 Sep 2004 09:35:24 -0000 1.7 @@ -80,6 +80,7 @@ <!-- ================================================================ --> <testGroup id="dom.svg.basic" name="Basic SVG DOM Testing" class="org.apache.batik.dom.svg.EcmaScriptSVGDOMTest"> + <test id="bug30580"/> <test id="lengthTest"/> <test id="locatableTest"/> <test id="presentationAttrRemovalTest"/> 1.1 xml-batik/test-resources/org/apache/batik/dom/svg/bug30580.svg Index: bug30580.svg =================================================================== <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:test="http://xml.apache.org/batik/test" width="450" height="500" viewBox="0 0 450 500" onload="runTest(evt)"> <test:testResult id="testResult" /> <script type="text/ecmascript"><![CDATA[ var testNS = "http://xml.apache.org/batik/test"; function runTest() { var result = document.getElementById("testResult"); result.setAttributeNS(null, "result", "failed"); var img1 = document.getElementById("testImage"); if (img1 == null){ result.setAttributeNS(null, "errorCode", "cannot.find.test.element"); var entry = document.createElementNS(testNS, "errorDescriptionEntry"); entry.setAttributeNS(null, "id", "missing.element.id"); entry.setAttributeNS(null, "value", "img1"); result.appendChild(entry); return; } var attr1 = img1.getAttributeNodeNS(null,"preserveAspectRatio"); if (attr1.value != "xMidYMid meet") { result.setAttributeNS(null, "errorCode", "wrong.attribute"); var entry = document.createElementNS(testNS, "errorDescriptionEntry"); entry.setAttributeNS(null, "value", "invalid.value"); entry.setAttributeNS(null, "value", attr1.value); result.appendChild(entry); return; } /////////////////////////////////////////////// // test using standard dom setValue interface attr1.value = "xMaxYMax slice"; if (img1.preserveAspectRatio.baseVal.align != 10 && img1.preserveAspectRatio.baseVal.meetOrSlice != 2) { result.setAttributeNS(null, "errorCode", "wrong.attribute"); var entry = document.createElementNS(testNS, "errorDescriptionEntry"); entry.setAttributeNS(null, "value", "invalid.value"); entry.setAttributeNS(null, "value", attr1.value); result.appendChild(entry); return; } ///////////////////////////////////////////////// // test using new preserveAspectRatio interface img1.preserveAspectRatio.baseVal.align = 2; img1.preserveAspectRatio.baseVal.meetOrSlice = 1; if (img1.preserveAspectRatio.baseVal.align != 2 && img1.preserveAspectRatio.baseVal.meetOrSlice != 1) { result.setAttributeNS(null, "errorCode", "wrong.attribute"); var entry = document.createElementNS(testNS, "errorDescriptionEntry"); entry.setAttributeNS(null, "value", "invalid.value"); entry.setAttributeNS(null, "value", img1.preserveAspectRatio.baseVal.align + " " + img1.preserveAspectRatio.baseVal.meetOrSlice); result.appendChild(entry); return; } if (attr1.value != "xMinYMin meet") { result.setAttributeNS(null, "errorCode", "wrong.attribute"); var entry = document.createElementNS(testNS, "errorDescriptionEntry"); entry.setAttributeNS(null, "value", "invalid.value"); entry.setAttributeNS(null, "value", attr1.value); result.appendChild(entry); return; } result.setAttributeNS(null, "result", "passed"); } ]]></script> <image id="testImage" x="10" y="10" width="256" height="256" xlink:href="bug30580_image.png" preserveAspectRatio="xMidYMid meet" /> </svg> --------------------------------------------------------------------- To unsubscribe, e-mail: janetmason@example.net For additional commands, e-mail: janetmason@example.net From batikjanetmason@example.net Thu Sep 02 23:08:01 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 16868 invoked from network); 2 Sep 2004 23:08:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Sep 2004 23:08:01 -0000 Received: (qmail 97536 invoked by uid 500); 2 Sep 2004 23:07:59 -0000 Delivered-To: janetmason@example.net Received: (qmail 97522 invoked by uid 500); 2 Sep 2004 23:07:58 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net> List-Help: <mailto:janetmason@example.net> List-Unsubscribe: <mailto:janetmason@example.net> List-Subscribe: <mailto:janetmason@example.net> Reply-To: janetmason@example.net Delivered-To: mailing list janetmason@example.net Received: (qmail 97508 invoked by uid 99); 2 Sep 2004 23:07:58 -0000 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=DNS_FROM_RFC_POST,HTML_40_50,HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of janetmason@example.net designates 83.161.120.155 as permitted sender) Message-ID: <001001c49142$488ebe80$130c223e@hppav> Reply-To: =?iso-8859-1?Q?Herv=E9_Girod?= <janetmason@example.net> From: =?iso-8859-1?Q?Herv=E9_Girod?= <janetmason@example.net> To: <janetmason@example.net> Subject: SVG, sXBL and Batik Date: Fri, 3 Sep 2004 01:12:14 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C49153.0BDD92C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_000D_01C49153.0BDD92C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I just happens to browse the next SVG Open conference agenda, and one of = the events deals with a new XML specification (jst a working draft now) = : SVG's XML Binding language (sXBL). I could just look at the W3C = working draft, and it already sounds very interesting to me, so I have = some questions about this : - does anybody know some sites with more informations about this = language than just the specification draft ? - do you think it could be useful (and / or possible) to implement it = with Batik for example, when the spec become stable (just a guess) ? =20 Sorry if you feel it's not the right place for this question !! P.S. : One of the reasons why I am potentially interested in this norm = is that, in my company, we use a proprietary ASCII 2D graphic = specification format (not related to XML at all). This specification = allows to define 2D Shapes / Images, with some very simple embedded = dynamic contents (for example, a line can have a variable length). I am = now able (using Batik / Java), to parse the original images and convert = them to SVG without loosing anything, and we use it daily now. But I could not find any "normative" way to keep the original dynamic = contents in the SVG file. Could sXBL be such a solution for the future ? = ------=_NextPart_000_000D_01C49153.0BDD92C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>I just happens to browse the next SVG = Open=20 conference agenda, and one of the events deals with a new XML = specification (jst=20 a working draft now) :&nbsp;SVG's XML Binding language (sXBL). I could = just look=20 at the W3C working draft, and it already sounds very interesting to me, = so I=20 have some questions about this :</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>- does anybody know some sites with = more=20 informations about this language than just the specification draft=20 ?</FONT></DIV> <DIV><FONT face=3DArial size=3D2>- do you think it could be&nbsp;useful = (and / or=20 possible) to implement it with Batik for example, when&nbsp;the spec = become=20 stable&nbsp;(just a guess) ?&nbsp;&nbsp;</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Sorry if you feel it's not the right = place&nbsp;for=20 this question&nbsp;!!</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>P.S. : One of the reasons why I am = potentially=20 interested in this norm is that, in my company, we use a proprietary = ASCII 2D=20 graphic&nbsp;specification format (not related to XML at all). This=20 specification allows to define 2D Shapes / Images, with some very simple = embedded dynamic contents (for example, a line can have a variable=20 length).&nbsp;I am now able (using Batik / Java), to parse the original = images=20 and convert them to SVG without loosing anything, and we use it daily=20 now.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>But I could not find any "normative" = way to keep=20 the original dynamic contents in the SVG file. Could sXBL be&nbsp;such a = solution for the future ?&nbsp;</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML> ------=_NextPart_000_000D_01C49153.0BDD92C0-- From batikjanetmason@example.net Fri Sep 03 01:00:00 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 46696 invoked from network); 3 Sep 2004 00:59:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Sep 2004 00:59:59 -0000 Received: (qmail 23938 invoked by uid 500); 3 Sep 2004 00:59:59 -0000 Delivered-To: janetmason@example.net Received: (qmail 23915 invoked by uid 500); 3 Sep 2004 00:59:58 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net> List-Help: <mailto:janetmason@example.net> List-Unsubscribe: <mailto:janetmason@example.net> List-Subscribe: <mailto:janetmason@example.net> Reply-To: janetmason@example.net Delivered-To: mailing list janetmason@example.net Received: (qmail 23897 invoked by uid 99); 3 Sep 2004 00:59:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Date: Fri, 3 Sep 2004 10:59:53 +1000 From: Cameron McCormack <janetmason@example.net> To: janetmason@example.net Subject: Re: SVG, sXBL and Batik Message-ID: <janetmason@example.net> Mail-Followup-To: janetmason@example.net References: <001001c49142$488ebe80$130c223e@hppav> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001001c49142$488ebe80$130c223e@hppav> User-Agent: Mutt/1.5.4i X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Herv. Herv Girod: > I just happens to browse the next SVG Open conference agenda, and one > of the events deals with a new XML specification (jst a working draft > now) : SVG's XML Binding language (sXBL). I could just look at the W3C > working draft, and it already sounds very interesting to me, so I have > some questions about this : > > - does anybody know some sites with more informations about this > language than just the specification draft ? The draft having just been released, I don't think there is much other information about sXBL out there yet. You could look at some RCC examples on the web. RCC was the mechanism proposed in some SVG 1.2 working drafts to handle custom elements, but was subsequently dropped in favour of sXBL. RCC was partially implemented in ASV6pr1. Also of course you could come along to SVG Open! There are apparently still places left for the workshops on Tuesday. > - do you think it could be useful (and / or possible) to implement it > with Batik for example, when the spec become stable (just a guess) ? Sure. I was wondering myself yesterday whether it would be a useful exercise to implement it as it stands (though the specification isn't quite complete). > Sorry if you feel it's not the right place for this question !! No, this is an appropriate place! > P.S. : One of the reasons why I am potentially interested in this > norm is that, in my company, we use a proprietary ASCII 2D graphic > specification format (not related to XML at all). This specification > allows to define 2D Shapes / Images, with some very simple embedded > dynamic contents (for example, a line can have a variable length). I > am now able (using Batik / Java), to parse the original images and > convert them to SVG without loosing anything, and we use it daily now. > > But I could not find any "normative" way to keep the original dynamic > contents in the SVG file. Could sXBL be such a solution for the future? Yes, if you keep your original contents as XML, sXBL would be one possibility for having your format rendered as SVG behind the scenes. Cameron -- Cameron McCormack | Web: http://mcc.id.au/ | ICQ: 26955922 --------------------------------------------------------------------- To unsubscribe, e-mail: janetmason@example.net For additional commands, e-mail: janetmason@example.net From batikjanetmason@example.net Sat Sep 04 11:44:27 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 2635 invoked from network); 4 Sep 2004 11:44:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 4 Sep 2004 11:44:27 -0000 Received: (qmail 71571 invoked by uid 500); 4 Sep 2004 11:44:25 -0000 Delivered-To: janetmason@example.net Received: (qmail 71551 invoked by uid 500); 4 Sep 2004 11:44:24 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net> List-Help: <mailto:janetmason@example.net> List-Unsubscribe: <mailto:janetmason@example.net> List-Subscribe: <mailto:janetmason@example.net> Reply-To: janetmason@example.net Delivered-To: mailing list janetmason@example.net Received: (qmail 71538 invoked by uid 99); 4 Sep 2004 11:44:24 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Date: Sat, 04 Sep 2004 13:44:19 +0200 From: Jeremias Maerki <janetmason@example.net> To: janetmason@example.net Subject: [PATCH] Avoid tiling bitmaps for PDF and PS transcoders Message-Id: <janetmason@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.07.04 [en] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I'd like to propose a patch which changes the behaviour of GraphicsUtil.drawImage. By default, bigger images coming from filter effects, for example, are tiled and then rendered to the destination. I experienced ugly overlaps of these tiles within Acrobat Reader even though I can't make out any rounding errors in the code and the generated PDF code. So I changed GraphicsUtils so I can supply a RenderingHint from the PDF and PS Graphics2D implementations so these images get rendered in one step. A nice side-effect is that the resulting PDFs get a lot smaller. I've fixed up a ZIP with the patch and an SVG and resulting PDF that shows the problem in Acrobat Reader 5 and 6. http://cvs.apache.org/~jeremias/batik-tiling-patch.zip WDYT? Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: janetmason@example.net For additional commands, e-mail: janetmason@example.net From batikjanetmason@example.net Sat Sep 04 16:38:56 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 76248 invoked from network); 4 Sep 2004 16:38:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 4 Sep 2004 16:38:56 -0000 Received: (qmail 45733 invoked by uid 500); 4 Sep 2004 16:38:55 -0000 Delivered-To: janetmason@example.net Received: (qmail 45704 invoked by uid 500); 4 Sep 2004 16:38:54 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net> List-Help: <mailto:janetmason@example.net> List-Unsubscribe: <mailto:janetmason@example.net> List-Subscribe: <mailto:janetmason@example.net> Reply-To: janetmason@example.net Delivered-To: mailing list janetmason@example.net Received: (qmail 45687 invoked by uid 99); 4 Sep 2004 16:38:54 -0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=DNS_FROM_RFC_POST,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of janetmason@example.net designates 83.161.120.155 as permitted sender) Message-ID: <002001c4929e$447dce00$3f9a2cd5@hppav> Reply-To: =?iso-8859-1?Q?Herv=E9_Girod?= <janetmason@example.net> From: =?iso-8859-1?Q?Herv=E9_Girod?= <janetmason@example.net> To: <janetmason@example.net> References: <001001c49142$488ebe80$130c223e@hppav> <janetmason@example.net> Subject: Re: SVG, sXBL and Batik Date: Sat, 4 Sep 2004 18:43:12 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Cameron McCormack wrote : > The draft having just been released, I don't think there is much other > information about sXBL out there yet. You could look at some RCC > examples on the web. RCC was the mechanism proposed in some SVG 1.2 > working drafts to handle custom elements, but was subsequently dropped > in favour of sXBL. RCC was partially implemented in ASV6pr1. > > Also of course you could come along to SVG Open! There are apparently > still places left for the workshops on Tuesday. > Unfortunately, it is now too late for me to go there (my fault, I should have a look at the proceedings long ago...), but I will check later for abstracts / papers when they will be available. > > Yes, if you keep your original contents as XML, sXBL would be one > possibility for having your format rendered as SVG behind the scenes. > This seems very interesting. I will look further on the specification and do some exercices with sXBL and RCC to better understand it. And thank you for your answer ! Herve --------------------------------------------------------------------- To unsubscribe, e-mail: janetmason@example.net For additional commands, e-mail: janetmason@example.net From batikjanetmason@example.net Sun Sep 05 10:56:24 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 28752 invoked from network); 5 Sep 2004 10:56:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 5 Sep 2004 10:56:24 -0000 Received: (qmail 52635 invoked by uid 500); 5 Sep 2004 10:56:23 -0000 Delivered-To: janetmason@example.net Received: (qmail 52522 invoked by uid 500); 5 Sep 2004 10:56:22 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net> List-Help: <mailto:janetmason@example.net> List-Unsubscribe: <mailto:janetmason@example.net> List-Subscribe: <mailto:janetmason@example.net> Reply-To: janetmason@example.net Delivered-To: mailing list janetmason@example.net Received: (qmail 52506 invoked by uid 99); 5 Sep 2004 10:56:22 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Message-ID: <janetmason@example.net> Date: Sun, 05 Sep 2004 06:56:19 -0400 From: Thomas DeWeese <janetmason@example.net> Organization: Eastman Kodak Company User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: janetmason@example.net Subject: Re: [PATCH] Avoid tiling bitmaps for PDF and PS transcoders References: <janetmason@example.net> In-Reply-To: <janetmason@example.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Jeremias, Jeremias Maerki wrote: > I'd like to propose a patch which changes the behaviour of > GraphicsUtil.drawImage. By default, bigger images coming from filter > effects, for example, are tiled and then rendered to the destination. > I experienced ugly overlaps of these tiles within Acrobat Reader even > though I can't make out any rounding errors in the code and the > generated PDF code. It looks like they aways push the images out to the nearest pixel boundary. This ensures that the images touch in all cases so you don't get 'drop outs'. For opaque images this works great but for transparent images (like your example) it generally causes double opacity for 1 pixel on the edge at all zoom levels. > So I changed GraphicsUtils so I can supply a > RenderingHint from the PDF and PS Graphics2D implementations so these > images get rendered in one step. A nice side-effect is that the > resulting PDFs get a lot smaller. I must say that I am very surprised at this result, any idea why it would be 1/2 as large? How do you normally store images in the PDF file? > WDYT? There are a few trivial tweaks that I might make (the value should be _ON, _OFF, _DEFAULT like the other Java2D rendering hints) but generally it looks fine. --------------------------------------------------------------------- To unsubscribe, e-mail: janetmason@example.net For additional commands, e-mail: janetmason@example.net From batikjanetmason@example.net Sun Sep 05 20:59:59 2004 Return-Path: <batikjanetmason@example.net> Delivered-To: janetmason@example.net Received: (qmail 13565 invoked from network); 5 Sep 2004 20:59:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 5 Sep 2004 20:59:59 -0000 Received: (qmail 21830 invoked by uid 500); 5 Sep 2004 20:59:58 -0000 Delivered-To: janetmason@example.net Received: (qmail 21815 invoked by uid 500); 5 Sep 2004 20:59:57 -0000 Mailing-List: contact janetmason@example.net; run by ezmlm Precedence: bulk List-Post: <mailto:janetmason@example.net>
{'source': 'Apache Software Foundation Public Mail Archives'}