You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2002/08/16 14:44:07 UTC

cvs commit: xml-fop/src/org/apache/fop/layoutmgr BreakPoss.java LayoutContext.java LeafNodeLayoutManager.java LineBPLayoutManager.java TextBPLayoutManager.java LayoutInfo.java

keiron      2002/08/16 05:44:07

  Modified:    src/org/apache/fop/area LineArea.java
               src/org/apache/fop/area/inline InlineArea.java
               src/org/apache/fop/fo FObj.java
               src/org/apache/fop/fo/flow BidiOverride.java
                        ExternalGraphic.java InstreamForeignObject.java
                        Leader.java
               src/org/apache/fop/layoutmgr BreakPoss.java
                        LayoutContext.java LeafNodeLayoutManager.java
                        LineBPLayoutManager.java TextBPLayoutManager.java
  Removed:     src/org/apache/fop/layoutmgr LayoutInfo.java
  Log:
  calculate line height and do vertical alignment better
  
  Revision  Changes    Path
  1.7       +1 -104    xml-fop/src/org/apache/fop/area/LineArea.java
  
  Index: LineArea.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/LineArea.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LineArea.java	26 May 2002 15:02:42 -0000	1.6
  +++ LineArea.java	16 Aug 2002 12:44:07 -0000	1.7
  @@ -59,108 +59,5 @@
       public List getInlineAreas() {
           return inlineAreas;
       }
  -
  -    public void verticalAlign(int lh, int lead, int follow) {
  -        int maxHeight = lh;
  -        List inlineAreas = getInlineAreas();
  -
  -        // get smallest possible offset to before edge
  -        // this depends on the height of no and middle alignments
  -        int before = lead;
  -        int after = follow;
  -        int halfLeading = (lineHeight - lead - follow) / 2;
  -        before += halfLeading;
  -        for (Iterator iter = inlineAreas.iterator(); iter.hasNext();) {
  -            InlineArea inline = (InlineArea) iter.next();
  -            LayoutInfo info = inline.info;
  -            int al;
  -            int ld = inline.getHeight();
  -            if (info != null) {
  -                al = info.alignment;
  -                ld = info.lead;
  -            } else {
  -                al = VerticalAlign.BASELINE;
  -            }
  -            if (al == VerticalAlign.BASELINE) {
  -                if (ld > before) {
  -                    before = ld;
  -                }
  -                if (inline.getHeight() > before) {
  -                    before = inline.getHeight();
  -                }
  -            } else if (al == VerticalAlign.MIDDLE) {
  -                if (inline.getHeight() / 2 + lead / 2 > before) {
  -                    before = inline.getHeight() / 2 + lead / 2;
  -                }
  -                if (inline.getHeight() / 2 - lead / 2 > after) {
  -                    after = inline.getHeight() / 2 - lead / 2;
  -                }
  -            } else if (al == VerticalAlign.TOP) {
  -            } else if (al == VerticalAlign.BOTTOM) {
  -            }
  -        }
  -        // then align all before, no and middle alignment
  -        for (Iterator iter = inlineAreas.iterator(); iter.hasNext();) {
  -            InlineArea inline = (InlineArea) iter.next();
  -            LayoutInfo info = inline.info;
  -            int al;
  -            int ld = inline.getHeight();
  -            boolean bloffset = false;
  -            if (info != null) {
  -                al = info.alignment;
  -                ld = info.lead;
  -                bloffset = info.blOffset;
  -            } else {
  -                al = VerticalAlign.BASELINE;
  -            }
  -            if (al == VerticalAlign.BASELINE) {
  -                // the offset position for text is the baseline
  -                if (bloffset) {
  -                    inline.setOffset(before);
  -                } else {
  -                    inline.setOffset(before - ld);
  -                }
  -                if (inline.getHeight() - ld > after) {
  -                    after = inline.getHeight() - ld;
  -                }
  -            } else if (al == VerticalAlign.MIDDLE) {
  -                inline.setOffset(before - inline.getHeight() / 2 -
  -                                 lead / 2);
  -            } else if (al == VerticalAlign.TOP) {
  -                inline.setOffset(0);
  -                if (inline.getHeight() - before > after) {
  -                    after = inline.getHeight() - before;
  -                }
  -            } else if (al == VerticalAlign.BOTTOM) {
  -                if (inline.getHeight() - before > after) {
  -                    after = inline.getHeight() - before;
  -                }
  -            }
  -        }
  -
  -        // after alignment depends on maximum height of before
  -        // and middle alignments
  -        for (Iterator iter = inlineAreas.iterator(); iter.hasNext();) {
  -            InlineArea inline = (InlineArea) iter.next();
  -            LayoutInfo info = inline.info;
  -            int al;
  -            if (info != null) {
  -                al = info.alignment;
  -            } else {
  -                al = VerticalAlign.BASELINE;
  -            }
  -            if (al == VerticalAlign.BASELINE) {
  -            } else if (al == VerticalAlign.MIDDLE) {
  -            } else if (al == VerticalAlign.TOP) {
  -            } else if (al == VerticalAlign.BOTTOM) {
  -                inline.setOffset(before + after - inline.getHeight());
  -            }
  -        }
  -        if (before + after > maxHeight) {
  -            setHeight(before + after);
  -        } else {
  -            setHeight(maxHeight);
  -        }
  -    }
   }
   
  
  
  
  1.8       +1 -3      xml-fop/src/org/apache/fop/area/inline/InlineArea.java
  
  Index: InlineArea.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/inline/InlineArea.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- InlineArea.java	26 May 2002 15:02:43 -0000	1.7
  +++ InlineArea.java	16 Aug 2002 12:44:07 -0000	1.8
  @@ -32,8 +32,6 @@
   
       // position within the line area, either top or baseline
       int verticalPosition;
  -    // width, height, vertical alignment
  -    public LayoutInfo info = null;
   
       // store properties in array list, need better solution
       ArrayList props = null;
  
  
  
  1.35      +5 -2      xml-fop/src/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- FObj.java	7 Aug 2002 16:54:56 -0000	1.34
  +++ FObj.java	16 Aug 2002 12:44:07 -0000	1.35
  @@ -211,7 +211,10 @@
        * @return A ListIterator.
        */
       public ListIterator getChildren() {
  -        return children.listIterator();
  +        if(children != null) {
  +            return children.listIterator();
  +        }
  +        return null;
       }
   
       /**
  
  
  
  1.10      +3 -3      xml-fop/src/org/apache/fop/fo/flow/BidiOverride.java
  
  Index: BidiOverride.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/BidiOverride.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BidiOverride.java	20 Jun 2002 09:14:12 -0000	1.9
  +++ BidiOverride.java	16 Aug 2002 12:44:07 -0000	1.10
  @@ -85,7 +85,7 @@
           BidiLayoutManager(FObj obj, LeafNodeLayoutManager cLM) {
               super(obj);
               childs = new ArrayList();
  -            for (int count = cLM.size() - 1; count >= 0; count--) {
  +/*            for (int count = cLM.size() - 1; count >= 0; count--) {
                   InlineArea ia = cLM.get(count);
                   if (ia instanceof Word) {
                       // reverse word
  @@ -95,7 +95,7 @@
                   }
                   childs.add(ia);
               }
  -        }
  +*/        }
   
           public int size() {
               return childs.size();
  
  
  
  1.26      +3 -4      xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java
  
  Index: ExternalGraphic.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ExternalGraphic.java	7 Aug 2002 16:54:57 -0000	1.25
  +++ ExternalGraphic.java	16 Aug 2002 12:44:07 -0000	1.26
  @@ -48,6 +48,8 @@
       public void addLayoutManager(List list) {
           LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
           lm.setCurrentArea(getInlineArea());
  +        lm.setAlignment(properties.get("vertical-align").getEnum());
  +        lm.setLead(viewHeight);
           list.add(lm);
       }
   
  @@ -63,9 +65,6 @@
           vp.setClip(clip);
           vp.setContentPosition(placement);
           vp.setOffset(0);
  -        vp.info = new LayoutInfo();
  -        vp.info.alignment = properties.get("vertical-align").getEnum();
  -        vp.info.lead = vp.getHeight();
   
           return vp;
       }
  
  
  
  1.31      +3 -4      xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java
  
  Index: InstreamForeignObject.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- InstreamForeignObject.java	7 Aug 2002 16:54:57 -0000	1.30
  +++ InstreamForeignObject.java	16 Aug 2002 12:44:07 -0000	1.31
  @@ -57,6 +57,8 @@
       public void addLayoutManager(List list) {
           LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this);
           lm.setCurrentArea(getInlineArea());
  +        lm.setAlignment(properties.get("vertical-align").getEnum());
  +        lm.setLead(areaCurrent.getHeight());
           list.add(lm);
       }
   
  @@ -247,9 +249,6 @@
           areaCurrent.setContentPosition(placement);
           areaCurrent.setClip(clip);
           areaCurrent.setOffset(0);
  -        areaCurrent.info = new LayoutInfo();
  -        areaCurrent.info.alignment = properties.get("vertical-align").getEnum();
  -        areaCurrent.info.lead = areaCurrent.getHeight();
   
           return areaCurrent;
       }
  
  
  
  1.21      +2 -4      xml-fop/src/org/apache/fop/fo/flow/Leader.java
  
  Index: Leader.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Leader.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Leader.java	20 Jun 2002 09:14:13 -0000	1.20
  +++ Leader.java	16 Aug 2002 12:44:07 -0000	1.21
  @@ -34,9 +34,7 @@
   
       public void addLayoutManager(List list) {
           list.add(new LeafNodeLayoutManager(this) {
  -            public InlineArea get(int index) {
  -                if(index > 0)
  -                    return null;
  +            public InlineArea get() {
                   int contentIPD = parentLM.getContentIPD();
                   return getInlineArea(contentIPD);
               }
  
  
  
  1.6       +39 -3     xml-fop/src/org/apache/fop/layoutmgr/BreakPoss.java
  
  Index: BreakPoss.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BreakPoss.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BreakPoss.java	8 Aug 2002 15:08:08 -0000	1.5
  +++ BreakPoss.java	16 Aug 2002 12:44:07 -0000	1.6
  @@ -54,8 +54,11 @@
       /**
        * Max height above and below the baseline. These are cumulative.
        */
  -    private int m_iMaxAscender;
  -    private int m_iMaxDescender;
  +    private int m_iLead;
  +    // the max height of before and after alignment
  +    private int m_iTotal;
  +    // middle alignment height for after
  +    private int m_iMiddle;
   
       /** Size in the non-stacking direction (perpendicular). */
       private MinOptMax m_nonStackSize;
  @@ -197,5 +200,38 @@
   
       public boolean checkIPD() {
           return ((m_flags & NEED_IPD) != 0);
  +    }
  +
  +    public int getLead() {
  +        return m_iLead;
  +    }
  +
  +    public int getTotal() {
  +        return m_iTotal;
  +    }
  +
  +    public int getMiddle() {
  +        return m_iMiddle;
  +    }
  +
  +    /**
  +     * set lead height of baseline positioned element
  +     */
  +    public void setLead(int ld) {
  +        m_iLead = ld;
  +    }
  +
  +    /**
  +     * Set total height of top or bottom aligned element
  +     */
  +    public void setTotal(int t) {
  +        m_iTotal = t;
  +    }
  +
  +    /**
  +     * Set distance below baseline of middle aligned element
  +     */
  +    public void setMiddle(int t) {
  +        m_iMiddle = t;
       }
   }
  
  
  
  1.7       +23 -1     xml-fop/src/org/apache/fop/layoutmgr/LayoutContext.java
  
  Index: LayoutContext.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LayoutContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LayoutContext.java	11 Aug 2002 07:31:30 -0000	1.6
  +++ LayoutContext.java	16 Aug 2002 12:44:07 -0000	1.7
  @@ -69,6 +69,9 @@
       /** Stretch or shrink value when making areas. */
       private double m_dSpaceAdjust = 0.0;
   
  +    private int m_iLineHeight;
  +    private int m_iBaseline;
  +
       public LayoutContext(LayoutContext parentLC) {
           this.flags = parentLC.flags;
           this.refIPD = parentLC.refIPD;
  @@ -77,6 +80,8 @@
           this.m_trailingSpace = parentLC.m_trailingSpace; //???
           this.m_hyphContext = parentLC.m_hyphContext;
           this.m_dSpaceAdjust = parentLC.m_dSpaceAdjust;
  +        this.m_iLineHeight = parentLC.m_iLineHeight;
  +        this.m_iBaseline = parentLC.m_iBaseline;
           // Copy other fields as necessary. Use clone???
       }
   
  @@ -171,4 +176,21 @@
       public double getSpaceAdjust() {
           return m_dSpaceAdjust;
       }
  +
  +    public void setLineHeight(int lh) {
  +        m_iLineHeight = lh;
  +    }
  +
  +    public int getLineHeight() {
  +        return m_iLineHeight;
  +    }
  +
  +    public void setBaseline(int bl) {
  +        m_iBaseline = bl;
  +    }
  +
  +    public int getBaseline() {
  +        return m_iBaseline;
  +    }
   }
  +
  
  
  
  1.10      +48 -12    xml-fop/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java
  
  Index: LeafNodeLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LeafNodeLayoutManager.java	14 Aug 2002 14:46:41 -0000	1.9
  +++ LeafNodeLayoutManager.java	16 Aug 2002 12:44:07 -0000	1.10
  @@ -11,7 +11,7 @@
   import org.apache.fop.area.Area;
   import org.apache.fop.area.MinOptMax;
   import org.apache.fop.area.inline.InlineArea;
  -
  +import org.apache.fop.fo.properties.VerticalAlign;
   
   /**
    * Base LayoutManager for leaf-node FObj, ie: ones which have no children.
  @@ -21,18 +21,14 @@
   public class LeafNodeLayoutManager extends AbstractBPLayoutManager {
   
       private InlineArea curArea = null;
  +    private int alignment;
  +    private int lead;
   
       public LeafNodeLayoutManager(FObj fobj) {
           super(fobj);
       }
   
  -    public int size() {
  -        return 1;
  -    }
  -
  -    public InlineArea get(int index) {
  -        if (index > 0)
  -            return null;
  +    public InlineArea get() {
           return curArea;
       }
   
  @@ -48,8 +44,12 @@
           curArea = ia;
       }
   
  -    protected boolean flush() {
  -        return false;
  +    public void setAlignment(int al) {
  +        alignment = al;
  +    }
  +
  +    public void setLead(int l) {
  +        lead = l;
       }
   
       /**
  @@ -68,7 +68,7 @@
   
       public BreakPoss getNextBreakPoss(LayoutContext context,
                                         Position prevBreakPoss) {
  -        curArea = get(0);
  +        curArea = get();
           if (curArea == null) {
               setFinished(true);
               return null;
  @@ -79,6 +79,24 @@
                                        BreakPoss.ISLAST);
           bp.setStackingSize(curArea.getAllocationIPD());
           bp.setNonStackingSize(curArea.getAllocationBPD());
  +
  +        int bpd = curArea.getHeight();
  +        switch(alignment) {
  +            case VerticalAlign.MIDDLE:
  +                bp.setMiddle(bpd / 2 /* - fontLead/2 */);
  +                bp.setLead(bpd / 2 /* + fontLead/2 */);
  +            break;
  +            case VerticalAlign.TOP:
  +                bp.setTotal(bpd);
  +            break;
  +            case VerticalAlign.BOTTOM:
  +                bp.setTotal(bpd);
  +            break;
  +            case VerticalAlign.BASELINE:
  +            default:
  +                bp.setLead(bpd);
  +            break;
  +        }
           setFinished(true);
           return bp;
       }
  @@ -92,6 +110,24 @@
   
       public void addAreas(PositionIterator posIter, LayoutContext context) {
           parentLM.addChild(curArea);
  +
  +        int bpd = curArea.getHeight();
  +        switch(alignment) {
  +            case VerticalAlign.MIDDLE:
  +                curArea.setOffset(context.getBaseline() - bpd / 2 /* - fontLead/2 */);
  +            break;
  +            case VerticalAlign.TOP:
  +                //curArea.setOffset(0);
  +            break;
  +            case VerticalAlign.BOTTOM:
  +                curArea.setOffset(context.getLineHeight() - bpd);
  +            break;
  +            case VerticalAlign.BASELINE:
  +            default:
  +                curArea.setOffset(context.getBaseline() - bpd);
  +            break;
  +        }
  +
           while (posIter.hasNext()) {
               posIter.next();
           }
  
  
  
  1.11      +44 -11    xml-fop/src/org/apache/fop/layoutmgr/LineBPLayoutManager.java
  
  Index: LineBPLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LineBPLayoutManager.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- LineBPLayoutManager.java	11 Aug 2002 07:31:30 -0000	1.10
  +++ LineBPLayoutManager.java	16 Aug 2002 12:44:07 -0000	1.11
  @@ -47,12 +47,16 @@
       private static class LineBreakPosition extends LeafPosition {
           // int m_iPos;
           double m_dAdjust; // Percentage to adjust (stretch or shrink)
  +        int lineHeight;
  +        int baseline;
   
           LineBreakPosition(BPLayoutManager lm, int iBreakIndex,
  -                          double dAdjust) {
  +                          double dAdjust, int lh, int bl) {
               super(lm, iBreakIndex);
               // m_iPos = iBreakIndex;
               m_dAdjust = dAdjust;
  +            lineHeight = lh;
  +            baseline = bl;
           }
       }
   
  @@ -104,7 +108,7 @@
                * (page) should check reference area and possibly
                * create a new one.
                */
  -            return new BreakPoss(new LineBreakPosition(this, -1, 0.0),
  +            return new BreakPoss(new LineBreakPosition(this, -1, 0.0, lineHeight, lead),
                                    BreakPoss.NEED_IPD);
           }
   
  @@ -286,7 +290,7 @@
           // Don't justify last line in the sequence or if forced line-end
           boolean bJustify = (m_bJustify && !m_prevBP.isForcedBreak() &&
                               !isFinished());
  -        return makeLineBreak(m_prevBP, availIPD, actual, bJustify);
  +        return makeLineBreak(iPrevLineEnd, availIPD, actual, bJustify);
       }
   
   
  @@ -344,8 +348,6 @@
           return true;
       }
   
  -
  -
       private HyphContext getHyphenContext(BreakPoss prevBP,
                                            BreakPoss newBP) {
           // Get a "word" to hyphenate by getting characters from all
  @@ -403,8 +405,8 @@
       }
   
   
  -    private BreakPoss makeLineBreak(BreakPoss inlineBP,
  -                                    MinOptMax target, MinOptMax actual, boolean bJustify) {
  +    private BreakPoss makeLineBreak(int prevLineEnd, MinOptMax target,
  +                                    MinOptMax actual, boolean bJustify) {
           // make a new BP
           // Store information needed to make areas in the LineBreakPosition!
           // Calculate stretch or shrink factor
  @@ -421,16 +423,45 @@
                             (double)(actual.opt - actual.min);
               }
           }
  +
  +        // lead to baseline is
  +        // max of: baseline fixed alignment and middle/2
  +        // after baseline is
  +        // max: top height-lead, middle/2 and bottom height-lead
  +        int halfLeading = (lineHeight - lead - follow) / 2;
  +        // height before baseline
  +        int lineLead = lead + halfLeading;
  +        // maximum size of top and bottom alignment
  +        int maxtb = follow + halfLeading;
  +        // max size of middle alignment below baseline
  +        int middlefollow = maxtb;
  +        for(Iterator iter = m_vecInlineBreaks.listIterator(prevLineEnd);
  +                iter.hasNext(); ) {
  +            BreakPoss bp = (BreakPoss)iter.next();
  +            if(bp.getLead() > lineLead) {
  +                lineLead = bp.getLead();
  +            } 
  +            if(bp.getTotal() > maxtb) {
  +                maxtb = bp.getTotal();
  +            }
  +            if(bp.getMiddle() > middlefollow) {
  +                middlefollow = bp.getMiddle();
  +            } 
  +        }
  +        if(maxtb - lineLead > middlefollow) {
  +            middlefollow = maxtb - lineLead;
  +        }
  +
           //log.debug("Adjustment factor=" + dAdjust);
           BreakPoss curLineBP = new BreakPoss( new LineBreakPosition(this,
  -                                             m_vecInlineBreaks.size() - 1, dAdjust));
  +                                             m_vecInlineBreaks.size() - 1, dAdjust, lineLead + middlefollow, lineLead));
   
           /* FIX ME!!
            * Need to calculate line height based on all inline BP info
            * for this line not just the current inlineBP!
            */
           curLineBP.setFlag(BreakPoss.ISLAST, isFinished());
  -        curLineBP.setStackingSize(inlineBP.getNonStackingSize());
  +        curLineBP.setStackingSize(new MinOptMax(lineLead + middlefollow));
           return curLineBP;
       }
   
  @@ -452,6 +483,9 @@
           while (parentIter.hasNext()) {
               LineBreakPosition lbp = (LineBreakPosition) parentIter.next();
               LineArea lineArea = new LineArea();
  +            lineArea.setHeight(lbp.lineHeight);
  +            lc.setBaseline(lbp.baseline);
  +            lc.setLineHeight(lbp.lineHeight);
               setCurrentArea(lineArea);
               // Add the inline areas to lineArea
               PositionIterator inlinePosIter =
  @@ -471,7 +505,6 @@
               addSpace(lineArea, lc.getTrailingSpace().resolve(true),
                        lc.getSpaceAdjust());
   }
  -            lineArea.verticalAlign(lineHeight, lead, follow);
               parentLM.addChild(lineArea);
           }
           setCurrentArea(null); // ?? necessary
  
  
  
  1.10      +4 -7      xml-fop/src/org/apache/fop/layoutmgr/TextBPLayoutManager.java
  
  Index: TextBPLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/TextBPLayoutManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TextBPLayoutManager.java	9 Aug 2002 07:11:16 -0000	1.9
  +++ TextBPLayoutManager.java	16 Aug 2002 12:44:07 -0000	1.10
  @@ -468,7 +468,7 @@
           // Make an area containing all characters between start and end.
           Word word = createWord(
                         new String(chars, iStart, ai.m_iBreakIndex - iStart),
  -                      ai.m_ipdArea.opt + iAdjust);
  +                      ai.m_ipdArea.opt + iAdjust, context.getBaseline());
           if (iWScount > 0) {
               //log.error("Adjustment per word-space= " +
               //                   iAdjust / iWScount);
  @@ -498,16 +498,13 @@
   
   
   
  -    protected Word createWord(String str, int width) {
  +    protected Word createWord(String str, int width, int base) {
           Word curWordArea = new Word();
           curWordArea.setWidth(width);
           curWordArea.setHeight(textInfo.fs.getAscender() -
                                 textInfo.fs.getDescender());
           curWordArea.setOffset(textInfo.fs.getAscender());
  -        curWordArea.info = new LayoutInfo();
  -        curWordArea.info.lead = textInfo.fs.getAscender();
  -        curWordArea.info.alignment = VerticalAlign.BASELINE;
  -        curWordArea.info.blOffset = true;
  +        curWordArea.setOffset(base);
   
           curWordArea.setWord(str);
           curWordArea.addTrait(Trait.FONT_NAME, textInfo.fs.getFontName());
  
  
  

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