xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r719276 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./ src/java/org/apache/fop/fonts/ src/java/org/apache/fop/fonts/truetype/ src/java/org/apache/fop/layoutmgr/ src/java/org/apache/fop/layoutmgr/inline/ src/java/org/apache/fop/ren...
Date Thu, 20 Nov 2008 16:44:30 GMT
Author: acumiskey
Date: Thu Nov 20 08:44:30 2008
New Revision: 719276

URL: http://svn.apache.org/viewvc?rev=719276&view=rev
Log:
Merged revisions 718666,718705,719038,719110 via svnmerge from 
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r718666 | adelmelle | 2008-11-18 17:58:54 +0000 (Tue, 18 Nov 2008) | 1 line
  
  Bugfix: do not reset TextLM.hasChanged, but combine (||) with previous value.
........
  r718705 | adelmelle | 2008-11-18 20:14:22 +0000 (Tue, 18 Nov 2008) | 1 line
  
  Change FontCache.changeLock to a boolean[1], so it can be serialized...
........
  r719038 | jeremias | 2008-11-19 19:46:45 +0000 (Wed, 19 Nov 2008) | 1 line
  
  Reduced warning on ascender+descender > EM box to DEBUG level, as this case is compensated
for by additional code in guessVerticalMetricsFromGlyphBBox() and is therefore only confusing.
I tested problematic fonts and they show an acceptable line layout. No semantics changed.
........
  r719110 | adelmelle | 2008-11-19 22:45:06 +0000 (Wed, 19 Nov 2008) | 3 lines
  
  Bugzilla 46240:
  Fixed a bug in combining break-before with a span change.
........

Added:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/layoutengine/standard-testcases/block_break-before_bug46240.xml
      - copied unchanged from r719110, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_break-before_bug46240.xml
Modified:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/   (props changed)
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/FontCache.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/LayoutContext.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java
  (props changed)
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 20 08:44:30 2008
@@ -1,2 +1,2 @@
 /xmlgraphics/fop/branches/fop-0_95:684572,688085,688696
-/xmlgraphics/fop/trunk:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,707631-708012,708192-708851,711781,718309-718502,718557-718591
+/xmlgraphics/fop/trunk:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,707631-708012,708192-708851,711781,718309-718502,718557-718591,718666-719110

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 20 08:44:30 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-718592
+/xmlgraphics/fop/trunk:1-719274

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/FontCache.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/FontCache.java?rev=719276&r1=719275&r2=719276&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/FontCache.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/FontCache.java
Thu Nov 20 08:44:30 2008
@@ -64,7 +64,7 @@
     private transient boolean changed = false;
 
     /** change lock */
-    private final Object changeLock = new Object();
+    private final boolean[] changeLock = new boolean[1];
 
     /** master mapping of font url -> font info.  This needs to be
      *  a list, since a TTC file may contain more than 1 font. */

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java?rev=719276&r1=719275&r2=719276&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/fonts/truetype/TTFFile.java
Thu Nov 20 08:44:30 2008
@@ -1248,10 +1248,11 @@
             }
         }
 
-        log.debug("Font box height: " + (ascender - descender));
-        if (ascender - descender > upem) {
-            log.warn("Ascender and descender together are larger than the em box."
-                    + " This could lead to a wrong baseline placement in Apache FOP.");
+        if (log.isDebugEnabled()) {
+            log.debug("Font box height: " + (ascender - descender));
+            if (ascender - descender > upem) {
+                log.debug("Ascender and descender together are larger than the em box.");
+            }
         }
     }
 
@@ -1259,7 +1260,7 @@
         // Approximate capHeight from height of "H"
         // It's most unlikely that a font misses the PCLT table
         // This also assumes that postscriptnames exists ("H")
-        // Should look it up int the cmap (that wouldn't help
+        // Should look it up in the cmap (that wouldn't help
         // for charsets without H anyway...)
         // Same for xHeight with the letter "x"
         int localCapHeight = 0;
@@ -1294,10 +1295,12 @@
                 }
             }
         }
-        log.debug("Ascender from glyph 'd': " + localAscender
-                + " " + convertTTFUnit2PDFUnit(localAscender));
-        log.debug("Descender from glyph 'p': " + localDescender
-                + " " + convertTTFUnit2PDFUnit(localDescender));
+        if (log.isDebugEnabled()) {
+            log.debug("Ascender from glyph 'd': " + localAscender
+                    + " " + convertTTFUnit2PDFUnit(localAscender));
+            log.debug("Descender from glyph 'p': " + localDescender
+                    + " " + convertTTFUnit2PDFUnit(localDescender));
+        }
         if (ascender - descender > upem) {
             log.debug("Replacing specified ascender/descender with derived values to get
values"
                     + " which fit in the em box.");
@@ -1305,10 +1308,12 @@
             descender = localDescender;
         }
 
-        log.debug("xHeight from glyph 'x': " + localXHeight
-                + " " + convertTTFUnit2PDFUnit(localXHeight));
-        log.debug("CapHeight from glyph 'H': " + localCapHeight
-                + " " + convertTTFUnit2PDFUnit(localCapHeight));
+        if (log.isDebugEnabled()) {
+            log.debug("xHeight from glyph 'x': " + localXHeight
+                    + " " + convertTTFUnit2PDFUnit(localXHeight));
+            log.debug("CapHeight from glyph 'H': " + localCapHeight
+                    + " " + convertTTFUnit2PDFUnit(localCapHeight));
+        }
         if (capHeight == 0) {
             capHeight = localCapHeight;
             if (capHeight == 0) {

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java?rev=719276&r1=719275&r2=719276&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
Thu Nov 20 08:44:30 2008
@@ -50,8 +50,6 @@
     /** Array of areas currently being filled stored by area class */
     private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
 
-    private int currentSpan = EN_NONE;
-
     /**
      * This is the top level layout manager.
      * It is created by the PageSequence FO.
@@ -89,10 +87,11 @@
             } else if (curLM instanceof BlockContainerLayoutManager) {
                 span = ((BlockContainerLayoutManager)curLM).getBlockContainerFO().getSpan();
             }
+
+            int currentSpan = context.getCurrentSpan();
             if (currentSpan != span) {
                 log.debug("span change from " + currentSpan + " to " + span);
                 context.signalSpanChange(span);
-                currentSpan = span;
                 SpaceResolver.resolveElementList(returnList);
                 return returnList;
             }
@@ -228,7 +227,7 @@
             oldElement = (KnuthElement)oldListIterator.next();
             if (oldElement.getPosition() instanceof NonLeafPosition) {
                 // oldElement was created by a descendant of this FlowLM
-                oldElement.setPosition(((NonLeafPosition)oldElement.getPosition()).getPosition());
+                oldElement.setPosition((oldElement.getPosition()).getPosition());
             } else {
                 // thisElement was created by this FlowLM, remove it
                 oldListIterator.remove();
@@ -344,7 +343,7 @@
      * @return the BPD of the content area
      */
     public int getContentAreaBPD() {
-        return (int) getCurrentPV().getBodyRegion().getBPD();
+        return getCurrentPV().getBodyRegion().getBPD();
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/LayoutContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/LayoutContext.java?rev=719276&r1=719275&r2=719276&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/LayoutContext.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/LayoutContext.java
Thu Nov 20 08:44:30 2008
@@ -88,7 +88,8 @@
      */
     private MinOptMax stackLimitIP;
 
-    /** True if current element list is spanning in multi-column layout. */
+    /** to keep track of spanning in multi-column layout */
+    private int currentSpan = Constants.NOT_SET;
     private int nextSpan = Constants.NOT_SET;
 
     /** inline-progression-dimension of nearest ancestor reference area */
@@ -522,22 +523,37 @@
     }
 
     /**
-     * @return true if the current element list ends early because of a span change
-     * in multi-column layout.
+     * @return one of: {@link Constants#NOT_SET}, {@link Constants#EN_NONE}
+     *                  {@link Constants#EN_ALL}
      */
     public int getNextSpan() {
         return nextSpan;
     }
 
     /**
+     * @return one of: {@link Constants#NOT_SET}, {@link Constants#EN_NONE}
+     *                  {@link Constants#EN_ALL}
+     */
+    public int getCurrentSpan() {
+        return (currentSpan == Constants.NOT_SET)
+                ? Constants.EN_NONE : currentSpan;
+    }
+
+    /**
      * Used to signal the PSLM that the element list ends early because of a span change
in
      * multi-column layout.
      * @param span the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)
      */
     public void signalSpanChange(int span) {
-        if (span == Constants.NOT_SET || span == Constants.EN_NONE || span == Constants.EN_ALL)
{
+        switch (span) {
+        case Constants.NOT_SET:
+        case Constants.EN_NONE:
+        case Constants.EN_ALL:
+            this.currentSpan = this.nextSpan;
             this.nextSpan = span;
-        } else {
+            break;
+        default:
+            assert false;
             throw new IllegalArgumentException("Illegal value on signalSpanChange() for span:
"
                     + span);
         }

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=719276&r1=719275&r2=719276&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
Thu Nov 20 08:44:30 2008
@@ -910,7 +910,7 @@
             }
             startIndex = stopIndex;
         }
-        this.hasChanged = !nothingChanged;
+        this.hasChanged = (this.hasChanged || !nothingChanged);
     }
 
     /** {@inheritDoc} */

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 20 08:44:30 2008
@@ -1,2 +1,2 @@
 /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java:684572,688085,688696
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,711781,718309-718502,718557-718591
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,711781,718309-718502,718557-718591,718666-719110

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml?rev=719276&r1=719275&r2=719276&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml Thu Nov 20 08:44:30 2008
@@ -65,6 +65,9 @@
       <action context="Fonts" dev="AC" importance="high" type="fix">
         More robust AFP font parsing, although it is still in need of some rework in the
future.
       </action>
+      <action context="Layout" dev="AD" type="fix" fixes-bug="46240">
+        Fixed a bug when combining break-before with a span change.
+      </action>
       <action context="Code" dev="AD" type="fix" fixes-bug="46211" due-to="rogov.AT.devexperts.com">
         Fixed some multi-threading issues in FontCache.java:
         <ul>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message