Author: adelmelle
Date: Fri Feb  1 15:30:13 2008
New Revision: 617708

URL: http://svn.apache.org/viewvc?rev=617708&view=rev
Log:
Bugzilla 44343:
Fixed a bug when using relative (smaller/larger) font-sizes in combination with 
percentages.
Percentages now resolved as per the spec (XSL-FO 1.1 7.9.4):
"A percentage value specifies an absolute font size relative to the parent 
element's font-size."

Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
    xmlgraphics/fop/trunk/status.xml

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java?rev=617708&r1=617707&r2=617708&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
 Fri Feb  1 15:30:13 2008
@@ -43,6 +43,19 @@
         super(propId);
     }
     
+    
+    /** [EMAIL PROTECTED] */
+    public Property make(PropertyList propertyList, String value, FObj fo) 
throws PropertyException {
+        Property p = super.make(propertyList, value, fo);
+        if (p instanceof PercentLength) {
+            Property pp = propertyList.getFromParent(this.propId);
+            p = FixedLength.getInstance(
+                    pp.getLength().getValue() * 
((PercentLength)p).getPercentage() / 100, "mpt");
+        }
+        return p;
+    }
+
+
     /**
      * [EMAIL PROTECTED]
      * Implements the parts of 7.8.4 relevant to relative font sizes
@@ -52,12 +65,12 @@
                                     FObj fo) throws PropertyException {
         if (p.getEnum() == EN_LARGER || p.getEnum() == EN_SMALLER) {
             // get the corresponding property from parent
-            Property pp = propertyList.getFromParent(this.getPropId());
+            Property pp = propertyList.getFromParent(this.propId);
             int baseFontSize = 
computeClosestAbsoluteFontSize(pp.getLength().getValue());
             if (p.getEnum() == EN_LARGER) {
-                return new FixedLength((int)Math.round((baseFontSize * 
FONT_SIZE_GROWTH_FACTOR)));
+                return FixedLength.getInstance((int)Math.round((baseFontSize * 
FONT_SIZE_GROWTH_FACTOR)), "mpt");
             } else {
-                return new FixedLength((int)Math.round((baseFontSize / 
FONT_SIZE_GROWTH_FACTOR)));
+                return FixedLength.getInstance((int)Math.round((baseFontSize / 
FONT_SIZE_GROWTH_FACTOR)), "mpt");
             }
         }
         return super.convertProperty(p, propertyList, fo);

Modified: xmlgraphics/fop/trunk/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=617708&r1=617707&r2=617708&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Feb  1 15:30:13 2008
@@ -28,6 +28,10 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="AD" type="fix" fixes-bug="44343">
+        Fixed a bug when using relative font-size (smaller/larger) in 
combination
+        with percentages.
+      </action>
       <action context="Fonts" dev="JM" type="fix">
         Bugfix for handling of optional tables in subset TrueType fonts. This 
bug caused errors
         in various PDF viewers.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to