You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ga...@apache.org on 2014/11/11 08:01:15 UTC

svn commit: r1638034 - in /xmlgraphics/batik/branches/text-background/sources/org/apache/batik: bridge/TextUtilities.java gvt/TextNode.java

Author: gadams
Date: Tue Nov 11 07:01:14 2014
New Revision: 1638034

URL: http://svn.apache.org/r1638034
Log:
Handle line-height normal keyword; fix infinite loop bug.

Modified:
    xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/TextUtilities.java
    xmlgraphics/batik/branches/text-background/sources/org/apache/batik/gvt/TextNode.java

Modified: xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/TextUtilities.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/TextUtilities.java?rev=1638034&r1=1638033&r2=1638034&view=diff
==============================================================================
--- xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/TextUtilities.java (original)
+++ xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/TextUtilities.java Tue Nov 11 07:01:14 2014
@@ -159,12 +159,17 @@ public abstract class TextUtilities impl
             (v == SVG12ValueConstants.NORMAL_VALUE)) {
             return fontSize*1.1f;
         }
-        float lineHeight = v.getFloatValue();
+        float lineHeight = fontSize;
         if (v instanceof ComputedValue)
             v = ((ComputedValue)v).getComputedValue();
-        if ((v instanceof LineHeightValue) &&
-            ((LineHeightValue)v).getFontSizeRelative())
-            lineHeight *= fontSize;
+        if (v instanceof LineHeightValue) {
+            lineHeight = v.getFloatValue();
+            if (((LineHeightValue)v).getFontSizeRelative())
+                lineHeight *= fontSize;
+        } else if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
+            if (v.getStringValue().equals(CSS_NORMAL_VALUE))
+                lineHeight = fontSize * 1.1f;
+        }
         return Float.valueOf(lineHeight);
     }
 

Modified: xmlgraphics/batik/branches/text-background/sources/org/apache/batik/gvt/TextNode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/branches/text-background/sources/org/apache/batik/gvt/TextNode.java?rev=1638034&r1=1638033&r2=1638034&view=diff
==============================================================================
--- xmlgraphics/batik/branches/text-background/sources/org/apache/batik/gvt/TextNode.java (original)
+++ xmlgraphics/batik/branches/text-background/sources/org/apache/batik/gvt/TextNode.java Tue Nov 11 07:01:14 2014
@@ -216,7 +216,7 @@ public class TextNode extends AbstractGr
      */
     public void setAttributedCharacterIterator
         (AttributedCharacterIterator newAci) {
-        this.setAttributedCharacterIterator(newAci);
+        this.setAttributedCharacterIterator(newAci, null);
     }
 
     public void setAttributedCharacterIterator