Author: malat Date: 2015-08-16 11:56:48 +0000 (Sun, 16 Aug 2015) New Revision: 18812
Removed: trunk/fop/debian/patches/01_from_svn_16_bit_alpha_png.patch trunk/fop/debian/patches/02_fix_segfault_with_anchors.patch trunk/fop/debian/patches/03_fix_tablecol.patch trunk/fop/debian/patches/enco.patch trunk/fop/debian/patches/enco2.patch trunk/fop/debian/patches/fixnpeinlinestacking.patch trunk/fop/debian/patches/illegalargex.patch Modified: trunk/fop/debian/changelog trunk/fop/debian/fop.sh trunk/fop/debian/patches/04_fixqdoxbuildfailure.patch Log: next upload Modified: trunk/fop/debian/changelog =================================================================== --- trunk/fop/debian/changelog 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/changelog 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,3 +1,10 @@ +fop (1:2.0+dfsg-2) experimental; urgency=medium + + * Fix logging (default to info level). + * Refresh patches (DEP-3 header) + + -- Mathieu Malaterre <ma...@debian.org> Sun, 16 Aug 2015 13:55:19 +0200 + fop (1:2.0+dfsg-1) experimental; urgency=medium * New upstream. Closes: #792132 Modified: trunk/fop/debian/fop.sh =================================================================== --- trunk/fop/debian/fop.sh 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/fop.sh 2015-08-16 11:56:48 UTC (rev 18812) @@ -45,7 +45,19 @@ find_jars /usr/share/fop/fop-hyph.jar find_jars fop -# LOG_OPTION=-Dorg.apache.commons.logging.Log=org.apache.fop.util.CommandLineLogger -# LOG_DEBUG_OPTION=-Dlog4j.debug +# the following lines are copied from upstream `fop` wrapper: +# +# The default commons logger for JDK1.4 is JDK1.4Logger. +# To use a different logger, uncomment the one desired below +# LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog +LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog +# LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -run_java $HEADLESS $LOG_OPTION org.apache.fop.cli.Main "$@" +# Logging levels +# Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger. +# To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%/JRE/LIB/logging.properties +# file instead. +# Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal". +LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO + +run_java $HEADLESS $LOGCHOICE $LOGLEVEL org.apache.fop.cli.Main "$@" Deleted: trunk/fop/debian/patches/01_from_svn_16_bit_alpha_png.patch =================================================================== --- trunk/fop/debian/patches/01_from_svn_16_bit_alpha_png.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/01_from_svn_16_bit_alpha_png.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,33 +0,0 @@ -Index: fop-0.95.dfsg/src/java/org/apache/fop/pdf/AlphaRasterImage.java -=================================================================== ---- fop-0.95.dfsg.orig/src/java/org/apache/fop/pdf/AlphaRasterImage.java 2008-07-31 16:02:57.000000000 +0200 -+++ fop-0.95.dfsg/src/java/org/apache/fop/pdf/AlphaRasterImage.java 2010-03-06 21:02:05.527650998 +0100 -@@ -48,6 +48,9 @@ - */ - public AlphaRasterImage(String k, Raster alpha) { - this.key = k; -+ //Enable the commented line below if 16-bit alpha channels are desired. -+ //Otherwise, we compress the alpha channel to 8 bit which should be sufficient. -+ //this.bitsPerComponent = alpha.getSampleModel().getSampleSize(0); - this.bitsPerComponent = 8; - this.colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_GRAY); - if (alpha == null) { -@@ -148,6 +151,18 @@ - alpha.getDataElements(0, y, w, 1, line); - out.write(line); - } -+ } else if (dataType == DataBuffer.TYPE_USHORT) { -+ short[] sline = new short[nbands * w]; -+ byte[] line = new byte[nbands * w]; -+ for (int y = 0; y < h; y++) { -+ alpha.getDataElements(0, y, w, 1, sline); -+ for (int i = 0; i < w; i++) { -+ //this compresses a 16-bit alpha channel to 8 bits! -+ //we probably don't ever need a 16-bit channel -+ line[i] = (byte)(sline[i] >> 8); -+ } -+ out.write(line); -+ } - } else if (dataType == DataBuffer.TYPE_INT) { - //Is there an better way to get a 8bit raster from a TYPE_INT raster? - int shift = 24; Deleted: trunk/fop/debian/patches/02_fix_segfault_with_anchors.patch =================================================================== --- trunk/fop/debian/patches/02_fix_segfault_with_anchors.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/02_fix_segfault_with_anchors.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,29 +0,0 @@ -Description: Fix segfaults on anchors -Author: Mathieu Malaterre <mathieu.malate...@gmail.com> -Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=46386 -Index: fop-0.95.dfsg/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java -=================================================================== ---- fop-0.95.dfsg.orig/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java 2008-07-31 16:02:58.000000000 +0200 -+++ fop-0.95.dfsg/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java 2010-03-06 21:02:05.535650523 +0100 -@@ -331,6 +331,11 @@ - while (oldListIterator.hasNext()) { - oldElement = (KnuthElement) oldListIterator.next(); - currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager(); -+ // This can occur if a fo:inline element is empty but has an id -+ // attribute on it. Punt in that case. -+ if (currLM == null) { -+ continue; -+ } - // initialize prevLM - if (prevLM == null) { - prevLM = currLM; -@@ -400,6 +405,9 @@ - while (oldListIterator.hasNext()) { - oldElement = (KnuthElement) oldListIterator.next(); - currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager(); -+ if (currLM == null) { -+ continue; -+ } - if (prevLM == null) { - prevLM = currLM; - } Deleted: trunk/fop/debian/patches/03_fix_tablecol.patch =================================================================== --- trunk/fop/debian/patches/03_fix_tablecol.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/03_fix_tablecol.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,14 +0,0 @@ -Description: Avoid StackOverflow on TableColumn.toString() during debugging. -Author: Mathieu Malaterre <mathieu.malate...@gmail.com> -Bug: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableColumn.java?r1=670335&r2=670334&pathrev=670335 ---- trunk/src/java/org/apache/fop/fo/flow/table/TableColumn.java 2008/06/22 10:37:24 670334 -+++ trunk/src/java/org/apache/fop/fo/flow/table/TableColumn.java 2008/06/22 10:53:51 670335 -@@ -239,7 +239,7 @@ - sb.append(" number-columns-spanned=") - .append(getNumberColumnsSpanned()); - } -- sb.append(" column-width=").append(getColumnWidth()); -+ sb.append(" column-width=").append(((Property)getColumnWidth()).getString()); - return sb.toString(); - } - Modified: trunk/fop/debian/patches/04_fixqdoxbuildfailure.patch =================================================================== --- trunk/fop/debian/patches/04_fixqdoxbuildfailure.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/04_fixqdoxbuildfailure.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,4 +1,7 @@ -Fix a lintian issue: add class-path +Description: Fix a lintian issue: add class-path +Author: Mathieu Malaterre <ma...@debian.org> +Forwarded: not-needed + Index: fop-2.0/build.xml =================================================================== --- fop-2.0.orig/build.xml Deleted: trunk/fop/debian/patches/enco.patch =================================================================== --- trunk/fop/debian/patches/enco.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/enco.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,70 +0,0 @@ -Description: Removed fallback mechanism in AbstractCodePointMapping. This is superfluous now that SingleByteFont handles all substitutions. This actually fixes a bug: the glyph "minus" was painted using "hyphen" but used the width of "minus" due to this fallback mechanism. -Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=50605 -Last-Update: 2011-09-11 -Origin: http://svn.apache.org/viewvc?view=revision&revision=1142188 - -Index: fop-1.0/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java -=================================================================== ---- fop-1.0.orig/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java 2011-09-11 14:51:37.000000000 +0200 -+++ fop-1.0/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java 2011-09-11 14:52:41.000000000 +0200 -@@ -20,7 +20,6 @@ - package org.apache.fop.fonts; - - import java.util.Arrays; --import java.util.Map; - - import org.apache.xmlgraphics.fonts.Glyphs; - -@@ -37,7 +36,6 @@ - private char[] codepoints; - private char[] unicodeMap; //code point to Unicode char - private String[] charNameMap; //all character names in the encoding -- private Map fallbackMap; //Here we accumulate all mappings we have found through substitution - - /** - * Main constructor. -@@ -140,44 +138,9 @@ - bot = mid + 1; - } - } -- -- //Fallback: using cache -- synchronized (this) { -- if (fallbackMap != null) { -- Character fallback = (Character)fallbackMap.get(new Character(c)); -- if (fallback != null) { -- return fallback.charValue(); -- } -- } -- } -- //Fallback: find alternatives (slow!) -- String glyphName = Glyphs.charToGlyphName(c); -- if (glyphName.length() > 0) { -- String[] alternatives = Glyphs.getCharNameAlternativesFor(glyphName); -- if (alternatives != null) { -- for (int i = 0, ic = alternatives.length; i < ic; i++) { -- int idx = getCodePointForGlyph(alternatives[i]); -- if (idx >= 0) { -- putFallbackCharacter(c, (char)idx); -- return (char)idx; -- } -- } -- } -- } -- -- putFallbackCharacter(c, NOT_FOUND_CODE_POINT); - return NOT_FOUND_CODE_POINT; - } - -- private void putFallbackCharacter(char c, char mapTo) { -- synchronized (this) { -- if (this.fallbackMap == null) { -- this.fallbackMap = new java.util.HashMap(); -- } -- this.fallbackMap.put(new Character(c), new Character(mapTo)); -- } -- } -- - /** - * Returns the main Unicode value that is associated with the given code point in the encoding. - * Note that multiple Unicode values can theoretically be mapped to one code point in the Deleted: trunk/fop/debian/patches/enco2.patch =================================================================== --- trunk/fop/debian/patches/enco2.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/enco2.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,198 +0,0 @@ -Description: AFMFile sometimes indirectly caused wrong assignments of char widths to code points in a single-byte encoding due to mapping multiple characters to the same code points (see overridePrimaryEncoding). Fixed some FindBugs issues. Added some generics. -Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=50605 -Last-Update: 2011-09-11 -Origin: http://svn.apache.org/viewvc?view=revision&revision=1142189 - -http://svn.apache.org/viewvc?view=revision&revision=1142189 -Index: fop-1.0/src/java/org/apache/fop/fonts/type1/AFMFile.java -=================================================================== ---- fop-1.0.orig/src/java/org/apache/fop/fonts/type1/AFMFile.java 2010-07-12 21:34:34.000000000 +0200 -+++ fop-1.0/src/java/org/apache/fop/fonts/type1/AFMFile.java 2011-09-11 14:49:37.000000000 +0200 -@@ -22,10 +22,12 @@ - import java.awt.geom.Dimension2D; - import java.awt.geom.RectangularShape; - import java.util.Collections; --import java.util.Iterator; - import java.util.List; - import java.util.Map; - -+import org.apache.commons.logging.Log; -+import org.apache.commons.logging.LogFactory; -+ - import org.apache.xmlgraphics.java2d.Dimension2DDouble; - - import org.apache.fop.fonts.NamedCharacter; -@@ -36,6 +38,9 @@ - */ - public class AFMFile { - -+ /** logging instance */ -+ private static final Log LOG = LogFactory.getLog(AFMFile.class); -+ - private String fontName; - private String fullName; - private String familyName; -@@ -56,15 +61,13 @@ - private AFMWritingDirectionMetrics[] writingDirectionMetrics - = new AFMWritingDirectionMetrics[3]; - -- private List charMetrics = new java.util.ArrayList(); -- //List<AFMCharMetrics> -- private Map charNameToMetrics = new java.util.HashMap(); -- //Map<String, AFMCharMetrics> -+ private List<AFMCharMetrics> charMetrics = new java.util.ArrayList<AFMCharMetrics>(); -+ private Map<String, AFMCharMetrics> charNameToMetrics -+ = new java.util.HashMap<String, AFMCharMetrics>(); - private int firstChar = -1; - private int lastChar = -1; - -- private Map kerningMap; -- //Map<String, Map<String, Dimension2D>> -+ private Map<String, Map<String, Dimension2D>> kerningMap; - - /** - * Default constructor. -@@ -365,14 +368,14 @@ - * @return the character metrics or null if there's no such character - */ - public AFMCharMetrics getChar(String name) { -- return (AFMCharMetrics)this.charNameToMetrics.get(name); -+ return this.charNameToMetrics.get(name); - } - - /** - * Returns the list of AFMCharMetrics instances representing all the available characters. - * @return a List of AFMCharMetrics instances - */ -- public List getCharMetrics() { -+ public List<AFMCharMetrics> getCharMetrics() { - return Collections.unmodifiableList(this.charMetrics); - } - -@@ -384,11 +387,11 @@ - */ - public void addXKerning(String name1, String name2, double kx) { - if (this.kerningMap == null) { -- this.kerningMap = new java.util.HashMap(); -+ this.kerningMap = new java.util.HashMap<String, Map<String, Dimension2D>>(); - } -- Map entries = (Map)this.kerningMap.get(name1); -+ Map<String, Dimension2D> entries = this.kerningMap.get(name1); - if (entries == null) { -- entries = new java.util.HashMap(); -+ entries = new java.util.HashMap<String, Dimension2D>(); - this.kerningMap.put(name1, entries); - } - entries.put(name2, new Dimension2DDouble(kx, 0)); -@@ -406,40 +409,37 @@ - * Creates and returns a kerning map for writing mode 0 (ltr) with character codes. - * @return the kerning map or null if there is no kerning information. - */ -- public Map createXKerningMapEncoded() { -+ public Map<Integer, Map<Integer, Integer>> createXKerningMapEncoded() { - if (!hasKerning()) { - return null; - } -- Map m = new java.util.HashMap(); -- Iterator iterFrom = this.kerningMap.entrySet().iterator(); -- while (iterFrom.hasNext()) { -- Map.Entry entryFrom = (Map.Entry)iterFrom.next(); -- String name1 = (String)entryFrom.getKey(); -+ Map<Integer, Map<Integer, Integer>> m -+ = new java.util.HashMap<Integer, Map<Integer, Integer>>(); -+ for (Map.Entry<String, Map<String, Dimension2D>> entryFrom : this.kerningMap.entrySet()) { -+ String name1 = entryFrom.getKey(); - AFMCharMetrics chm1 = getChar(name1); - if (chm1 == null || !chm1.hasCharCode()) { - continue; - } -- Map container = null; -- Map entriesTo = (Map)entryFrom.getValue(); -- Iterator iterTo = entriesTo.entrySet().iterator(); -- while (iterTo.hasNext()) { -- Map.Entry entryTo = (Map.Entry)iterTo.next(); -- String name2 = (String)entryTo.getKey(); -+ Map<Integer, Integer> container = null; -+ Map<String, Dimension2D> entriesTo = entryFrom.getValue(); -+ for (Map.Entry<String, Dimension2D> entryTo : entriesTo.entrySet()) { -+ String name2 = entryTo.getKey(); - AFMCharMetrics chm2 = getChar(name2); - if (chm2 == null || !chm2.hasCharCode()) { - continue; - } - if (container == null) { -- Integer k1 = new Integer(chm1.getCharCode()); -- container = (Map)m.get(k1); -+ Integer k1 = Integer.valueOf(chm1.getCharCode()); -+ container = m.get(k1); - if (container == null) { -- container = new java.util.HashMap(); -+ container = new java.util.HashMap<Integer, Integer>(); - m.put(k1, container); - } - } -- Dimension2D dim = (Dimension2D)entryTo.getValue(); -- container.put(new Integer(chm2.getCharCode()), -- new Integer((int)Math.round(dim.getWidth()))); -+ Dimension2D dim = entryTo.getValue(); -+ container.put(Integer.valueOf(chm2.getCharCode()), -+ Integer.valueOf((int)Math.round(dim.getWidth()))); - } - } - return m; -@@ -451,14 +451,41 @@ - * @param encoding the encoding to replace the one given in the AFM - */ - public void overridePrimaryEncoding(SingleByteEncoding encoding) { -- Iterator iter = this.charMetrics.iterator(); -- while (iter.hasNext()) { -- AFMCharMetrics cm = (AFMCharMetrics)iter.next(); -+ if (LOG.isDebugEnabled()) { -+ LOG.debug("Overriding primary encoding of " + getFontName() + " with: " + encoding); -+ } -+ AFMCharMetrics[] mapped = new AFMCharMetrics[256]; -+ for (AFMCharMetrics cm : this.charMetrics) { - NamedCharacter nc = cm.getCharacter(); - if (nc.hasSingleUnicodeValue()) { -- int mapped = encoding.mapChar(nc.getSingleUnicodeValue()); -- if (mapped > 0) { -- cm.setCharCode(mapped); -+ int codePoint = encoding.mapChar(nc.getSingleUnicodeValue()); -+ if (codePoint > 0) { -+ if (mapped[codePoint] != null) { -+ if (LOG.isDebugEnabled()) { -+ AFMCharMetrics other = mapped[codePoint]; -+ String msg = "Not mapping character " + nc + " to code point " -+ + codePoint + " (" + Integer.toHexString(codePoint) + ") in " -+ + encoding + ". " -+ + other + " has already been assigned that code point."; -+ if (other.getUnicodeSequence() -+ .equals(nc.getUnicodeSequence())) { -+ msg += " This is a specialized glyph for the" -+ + " same Unicode character."; -+ //TODO should these be mapped to a private Unicode area to make -+ //them accessible? -+ } else { -+ msg += " This is a similar character."; -+ } -+ if (cm.getWidthX() != other.getWidthX()) { -+ msg += " They have differing widths: " -+ + cm.getWidthX() + " vs. " + other.getWidthX(); -+ } -+ LOG.debug(msg); -+ } -+ } else { -+ cm.setCharCode(codePoint); -+ mapped[codePoint] = cm; -+ } - } else { - cm.setCharCode(-1); - } -@@ -470,6 +497,7 @@ - } - - /** {@inheritDoc} */ -+ @Override - public String toString() { - return "AFM: " + getFullName(); - } Deleted: trunk/fop/debian/patches/fixnpeinlinestacking.patch =================================================================== --- trunk/fop/debian/patches/fixnpeinlinestacking.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/fixnpeinlinestacking.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,20 +0,0 @@ -Description: Avoid an NPE in InlineStackingLM.applyChanges for Knuth elements with a null position -Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=50276 -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649476 -Origin: http://svn.apache.org/viewvc?view=revision&revision=1043871 -Index: fop-1.0.dfsg2/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java -=================================================================== ---- fop-1.0.dfsg2.orig/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java 2010-07-12 21:34:33.000000000 +0200 -+++ fop-1.0.dfsg2/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java 2012-01-03 11:00:23.000000000 +0100 -@@ -274,8 +274,9 @@ - KnuthElement oldElement; - while (oldListIterator.hasNext()) { - oldElement = (KnuthElement) oldListIterator.next(); -- oldElement.setPosition -- (oldElement.getPosition().getPosition()); -+ if (oldElement.getPosition() != null) { -+ oldElement.setPosition(oldElement.getPosition().getPosition()); -+ } - } - // reset the iterator - oldListIterator = oldList.listIterator(); Deleted: trunk/fop/debian/patches/illegalargex.patch =================================================================== --- trunk/fop/debian/patches/illegalargex.patch 2015-08-11 19:46:56 UTC (rev 18811) +++ trunk/fop/debian/patches/illegalargex.patch 2015-08-16 11:56:48 UTC (rev 18812) @@ -1,73 +0,0 @@ -Description: Allow for words consisting of only soft hyphens -Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=49837 -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646141 -Origin: http://svn.apache.org/viewvc?view=revision&revision=1042115 -Index: fop-1.0.dfsg2/src/java/org/apache/fop/fo/FOTreeBuilder.java -=================================================================== ---- fop-1.0.dfsg2.orig/src/java/org/apache/fop/fo/FOTreeBuilder.java 2012-01-03 15:29:44.000000000 +0100 -+++ fop-1.0.dfsg2/src/java/org/apache/fop/fo/FOTreeBuilder.java 2012-01-03 15:29:46.000000000 +0100 -@@ -398,7 +398,9 @@ - FOValidationEventProducer eventProducer - = FOValidationEventProducer.Provider.get( - userAgent.getEventBroadcaster()); -- eventProducer.unknownFormattingObject(this, currentFObj.getName(), -+ String name = (currentFObj != null ? currentFObj.getName() -+ : "{" + namespaceURI + "}" + localName); -+ eventProducer.unknownFormattingObject(this, name, - new QName(namespaceURI, localName), - getEffectiveLocator()); - } -Index: fop-1.0.dfsg2/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java -=================================================================== ---- fop-1.0.dfsg2.orig/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java 2012-01-03 15:29:44.000000000 +0100 -+++ fop-1.0.dfsg2/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java 2012-01-03 15:32:00.000000000 +0100 -@@ -774,10 +774,7 @@ - while (lastIndex > 0 && foText.charAt(lastIndex - 1) == CharUtilities.SOFT_HYPHEN) { - lastIndex--; - } -- final boolean endsWithHyphen = checkEndsWithHyphen -- && foText.charAt(lastIndex) == CharUtilities.SOFT_HYPHEN; - Font font = FontSelector.selectFontForCharactersInText(foText, thisStart, lastIndex, foText, this); -- int wordLength = lastIndex - thisStart; - boolean kerning = font.hasKerning(); - MinOptMax wordIPD = MinOptMax.ZERO; - for (int i = thisStart; i < lastIndex; i++) { -@@ -803,23 +800,31 @@ - } - } - } -+ boolean endsWithHyphen = checkEndsWithHyphen -+ && foText.charAt(lastIndex) == CharUtilities.SOFT_HYPHEN; - if (kerning - && breakOpportunity - && !TextLayoutManager.isSpace(ch) - && lastIndex > 0 - && endsWithHyphen) { -- final int kern = font.getKernValue(foText.charAt(lastIndex - 1), ch); -+ int kern = font.getKernValue(foText.charAt(lastIndex - 1), ch); - if (kern != 0) { - addToLetterAdjust(lastIndex, kern); - //TODO: add kern to wordIPD? - } - } -- int iLetterSpaces = wordLength - 1; -- // if there is a break opportunity and the next one -- // is not a space, it could be used as a line end; -- // add one more letter space, in case other text follows -- if (breakOpportunity && !TextLayoutManager.isSpace(ch)) { -- iLetterSpaces++; -+ // shy+chars at start of word: wordLength == 0 && breakOpportunity -+ // shy only characters in word: wordLength == 0 && !breakOpportunity -+ int wordLength = lastIndex - thisStart; -+ int iLetterSpaces = 0; -+ if (wordLength != 0) { -+ iLetterSpaces = wordLength - 1; -+ // if there is a break opportunity and the next one -+ // is not a space, it could be used as a line end; -+ // add one more letter space, in case other text follows -+ if (breakOpportunity && !TextLayoutManager.isSpace(ch)) { -+ iLetterSpaces++; -+ } - } - assert iLetterSpaces >= 0; - wordIPD = wordIPD.plus(letterSpaceIPD.mult(iLetterSpaces)); _______________________________________________ pkg-java-commits mailing list pkg-java-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits