DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16237>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16237

superscripts and subscipts are placed too high / too low

           Summary: superscripts and subscipts are placed too high / too low
           Product: Fop
           Version: 0.20.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: page-master/layout
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Using "super" / "sub" in property vertical-align will place the characters
too high / too low. This is due to a minor mistake in class LineArea.
In method verticalAlign() the offset of the super/subscript is computed by
taking 2/3 of ascender for the choosen font. The value which should be used
must be 1/3 because you want to get a 2/3 overlap with the text before/after.

    
    /**
     * Balance (vertically) the inline areas within this line.
     */
    public void verticalAlign() {
        int superHeight = -this.placementOffset;
        int maxHeight = this.allocationHeight;
        Enumeration e = children.elements();
        while (e.hasMoreElements()) {
            Box b = (Box)e.nextElement();
            if (b instanceof InlineArea) {
                InlineArea ia = (InlineArea)b;
                if (ia instanceof WordArea) {
                    ia.setYOffset(placementOffset);
                }
                if (ia.getHeight() > maxHeight) {
                    maxHeight = ia.getHeight();
                }
                int vert = ia.getVerticalAlign();
                if (vert == VerticalAlign.SUPER) {
                    int fh = fontState.getAscender();
                    // was: ia.setYOffset((int)(placementOffset - (2.0 * fh / 
3.0)));
                    ia.setYOffset((int)(placementOffset - (fh / 3.0)));
                } else if (vert == VerticalAlign.SUB) {
                    int fh = fontState.getAscender();
                    // was: ia.setYOffset((int)(placementOffset + (2.0 * fh / 
3.0)));
                    ia.setYOffset((int)(placementOffset + (fh / 3.0)));
                }

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

Reply via email to