/**
* Get the allocation block progression dimension of this area.
- * This adds the content, borders and the padding to find the
+ * This adds the content, borders, padding and spaces to find the
* total allocated BPD.
*
- * @return the total IPD allocation for this area
+ * @return the total BPD allocation for this area
*/
public int getAllocBPD() {
- return getBorderAndPaddingWidthBefore() + getBPD() + getBorderAndPaddingWidthAfter();
+ return getSpaceBefore() + getBorderAndPaddingWidthBefore() + getBPD()
+ + getBorderAndPaddingWidthAfter() + getSpaceAfter();
}
/**
return margin;
}
+
+ /**
+ * Returns the space before
+ *
+ * @return width in millipoints
+ */
+ public int getSpaceBefore() {
+ int margin = 0;
+ Integer space = (Integer) getTrait(Trait.SPACE_BEFORE);
+ if (space != null) {
+ margin = space.intValue();
+ }
+ return margin;
+ }
+
+ /**
+ * Returns the space after
+ *
+ * @return width in millipoints
+ */
+ public int getSpaceAfter() {
+ int margin = 0;
+ Integer space = (Integer) getTrait(Trait.SPACE_AFTER);
+ if (space != null) {
+ margin = space.intValue();
+ }
+ return margin;
+ }
+
+ /**
+ * Returns the space start
+ *
+ * @return width in millipoints
+ */
+ public int getSpaceStart() {
+ int margin = 0;
+ Integer space = (Integer) getTrait(Trait.SPACE_START);
+ if (space != null) {
+ margin = space.intValue();
+ }
+ return margin;
+ }
+
+ /**
+ * Returns the space end
+ *
+ * @return width in millipoints
+ */
+ public int getSpaceEnd() {
+ int margin = 0;
+ Integer space = (Integer) getTrait(Trait.SPACE_END);
+ if (space != null) {
+ margin = space.intValue();
+ }
+ return margin;
+ }
+
/**
* Add a child to this area.
* The default is to do nothing. Subclasses must override
if (children == null) {
children = new ArrayList();
}
- bpd += line.getBPD();
+ bpd += line.getAllocBPD();
children.add(line);
}
*/
protected class TextAdjustingInfo extends InlineAdjustingInfo {
- // difference between the optimal width of a space
- // and the default width of a space according to the font
- // (this is equivalent to the property word-spacing.optimum)
+ /** difference between the optimal width of a space
+ * and the default width of a space according to the font
+ * (this is equivalent to the property word-spacing.optimum)
+ */
protected int spaceDifference = 0;
/**
}
}
- private int iTextWordSpaceAdjust = 0;
- private int iTextLetterSpaceAdjust = 0;
+ private int textWordSpaceAdjust = 0;
+ private int textLetterSpaceAdjust = 0;
private TextAdjustingInfo adjustingInfo = null;
+ private int baselineOffset = 0;
/**
* Default constructor
* @return the text word space adjustment
*/
public int getTextWordSpaceAdjust() {
- return iTextWordSpaceAdjust;
+ return textWordSpaceAdjust;
}
/**
* Set text word space adjust.
*
- * @param iTWSadjust the text word space adjustment
+ * @param textWordSpaceAdjust the text word space adjustment
*/
- public void setTextWordSpaceAdjust(int iTWSadjust) {
- iTextWordSpaceAdjust = iTWSadjust;
+ public void setTextWordSpaceAdjust(int textWordSpaceAdjust) {
+ this.textWordSpaceAdjust = textWordSpaceAdjust;
}
+
/**
* Get text letter space adjust.
*
* @return the text letter space adjustment
*/
public int getTextLetterSpaceAdjust() {
- return iTextLetterSpaceAdjust;
+ return textLetterSpaceAdjust;
}
/**
* Set text letter space adjust.
*
- * @param iTLSadjust the text letter space adjustment
+ * @param textLetterSpaceAdjust the text letter space adjustment
*/
- public void setTextLetterSpaceAdjust(int iTLSadjust) {
- iTextLetterSpaceAdjust = iTLSadjust;
+ public void setTextLetterSpaceAdjust(int textLetterSpaceAdjust) {
+ this.textLetterSpaceAdjust = textLetterSpaceAdjust;
}
/**
// balancing factor
double balancingFactor = 1.0;
if (variationFactor < 0) {
- if (iTextWordSpaceAdjust < 0) {
+ if (textWordSpaceAdjust < 0) {
// from a negative adjustment to a positive one
- balancingFactor = ((double) adjustingInfo.availableStretch / adjustingInfo.availableShrink)
+ balancingFactor
+ = ((double) adjustingInfo.availableStretch / adjustingInfo.availableShrink)
* ((double) lineShrink / lineStretch);
} else {
// from a positive adjustment to a negative one
- balancingFactor = ((double) adjustingInfo.availableShrink / adjustingInfo.availableStretch)
+ balancingFactor
+ = ((double) adjustingInfo.availableShrink / adjustingInfo.availableStretch)
* ((double) lineStretch / lineShrink);
}
}
- iTextWordSpaceAdjust = (int) ((iTextWordSpaceAdjust - adjustingInfo.spaceDifference)
+ textWordSpaceAdjust = (int) ((textWordSpaceAdjust - adjustingInfo.spaceDifference)
* variationFactor * balancingFactor)
+ adjustingInfo.spaceDifference;
- iTextLetterSpaceAdjust *= variationFactor;
+ textLetterSpaceAdjust *= variationFactor;
// update the ipd of the area
int oldAdjustment = adjustingInfo.adjustment;
adjustingInfo.adjustment *= balancingFactor * variationFactor;
}
return false;
}
+
+ /**
+ * Get baseline offset, i.e. the distance from the before edge
+ * of this area to the nominal baseline.
+ *
+ * @return the baseline offset
+ */
+ public int getBaselineOffset() {
+ return baselineOffset;
+ }
+
+ /**
+ * Set the baseline offset.
+ *
+ * @param baselineOffset the baseline offset
+ */
+ public void setBaselineOffset(int baselineOffset) {
+ this.baselineOffset = baselineOffset;
+ }
}
*
* @param v the offset
*/
+ /*
public void setOffset(int v) {
setChildOffset(inlines.listIterator(), v);
}
+ */
private void setChildOffset(ListIterator childrenIterator, int v) {
while (childrenIterator.hasNext()) {
* page-number or a page-number-citation is resolved
*/
protected class InlineAdjustingInfo {
- // stretch of the inline area
+ /** stretch of the inline area */
protected int availableStretch;
- // shrink of the inline area
+ /** shrink of the inline area */
protected int availableShrink;
- // total adjustment (= ipd - width of fixed elements)
+ /** total adjustment (= ipd - width of fixed elements) */
protected int adjustment;
/**
}
/**
- * offset position from top of parent area
+ * offset position from before edge of parent area
*/
- protected int verticalPosition = 0;
+ protected int offset = 0;
/**
* parent area
/**
* Set the offset of this inline area.
* This is used to set the offset of the inline area
- * which is normally relative to the top of the line
- * or the baseline.
+ * which is relative to the before edge of the parent area.
*
- * @param v the offset
+ * @param offset the offset
*/
- public void setOffset(int v) {
- verticalPosition = v;
+ public void setOffset(int offset) {
+ this.offset = offset;
}
/**
* Get the offset of this inline area.
* This returns the offset of the inline area
- * which is normally relative to the top of the line
- * or the baseline.
+ * which is relative to the before edge of the parent area.
*
* @return the offset
*/
public int getOffset() {
- return verticalPosition;
+ return offset;
}
/**
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
+import org.apache.fop.fo.flow.Character;
+import org.apache.fop.fo.flow.ExternalGraphic;
+import org.apache.fop.fo.flow.InstreamForeignObject;
/**
* Models a length which can be used as a factor in a percentage length
public static final int IMAGE_BACKGROUND_POSITION_VERTICAL = 10;
/** constant for a table-unit-based length */
public static final int TABLE_UNITS = 11;
-
- /** array of valid percent-based length types */
- public static final int[] PERCENT_BASED_LENGTH_TYPES
- = {CUSTOM_BASE, FONTSIZE, INH_FONTSIZE, PARENT_AREA_WIDTH,
- CONTAINING_REFAREA_WIDTH,
- IMAGE_INTRINSIC_WIDTH, IMAGE_INTRINSIC_HEIGHT,
- IMAGE_BACKGROUND_POSITION_HORIZONTAL, IMAGE_BACKGROUND_POSITION_VERTICAL,
- TABLE_UNITS
- };
+ /** constant for a alignment adjust percent-based length */
+ public static final int ALIGNMENT_ADJUST = 12;
/**
* The FO for which this property is to be calculated.
*/
private /* final */ int iBaseType;
- private Length fontSize;
+ /** For percentages based on other length properties */
+ private Length baseLength;
/**
* Constructor
this.iBaseType = iBaseType;
switch (iBaseType) {
case FONTSIZE:
- this.fontSize = plist.get(Constants.PR_FONT_SIZE).getLength();
+ this.baseLength = plist.get(Constants.PR_FONT_SIZE).getLength();
break;
case INH_FONTSIZE:
- this.fontSize = plist.getInherited(Constants.PR_FONT_SIZE).getLength();
+ this.baseLength = plist.getInherited(Constants.PR_FONT_SIZE).getLength();
break;
default:
// TODO: pacify CheckStyle
* @see org.apache.fop.datatypes.PercentBase#getBaseLength(PercentBaseContext)
*/
public int getBaseLength(PercentBaseContext context) throws PropertyException {
- int baseLength = 0;
+ int baseLen = 0;
if (context != null) {
if (iBaseType == FONTSIZE || iBaseType == INH_FONTSIZE) {
- return fontSize.getValue(context);
+ return baseLength.getValue(context);
}
- baseLength = context.getBaseLength(iBaseType, fobj);
+ baseLen = context.getBaseLength(iBaseType, fobj);
} else {
fobj.getLogger().error("getBaseLength called without context");
}
- return baseLength;
+ return baseLen;
}
}
import org.apache.fop.fo.properties.TableBorderPrecedence;
import org.apache.fop.fo.properties.TextDecorationProperty;
import org.apache.fop.fo.properties.ToBeImplementedProperty;
+import org.apache.fop.fo.properties.VerticalAlignShorthandParser;
/**
* This class creates and returns an array of Property.Maker instances
m.addEnum("text-top", getEnumProperty(EN_TEXT_TOP, "TEXT_TOP"));
m.addEnum("text-bottom", getEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM"));
m.setDefault("auto");
+ m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
+ m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
addPropertyMaker("alignment-adjust", m);
// alignment-baseline
m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
+ m.addEnum("top", getEnumProperty(EN_TOP, "TOP"));
+ m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
+ m.addEnum("text-top", getEnumProperty(EN_TEXT_TOP, "TEXT_TOP"));
+ m.addEnum("text-bottom", getEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM"));
m.setDefault("auto");
+ m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
addPropertyMaker("alignment-baseline", m);
// baseline-shift
m.addEnum("sub", getEnumProperty(EN_SUB, "SUB"));
m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER"));
m.setDefault("baseline");
+ m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
+ m.setPercentBase(LengthBase.CUSTOM_BASE);
addPropertyMaker("baseline-shift", m);
// display-align
m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE" ));
m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
m.setDefault("auto");
+ m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
addPropertyMaker("dominant-baseline", m);
// relative-align
m.setInherited(false);
m.addEnum("use-font-metrics", getEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS"));
m.setDefault("use-font-metrics");
+ m.setPercentBase(LengthBase.FONTSIZE);
addPropertyMaker("text-altitude", m);
// text-depth
m.setInherited(false);
m.addEnum("use-font-metrics", getEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS"));
m.setDefault("use-font-metrics");
+ m.setPercentBase(LengthBase.FONTSIZE);
addPropertyMaker("text-depth", m);
// unicode-bidi
m.setDefault("auto");
addPropertyMaker("size", m);
- // vertical-align TODO: Should be a LengthProperty.
- m = new EnumProperty.Maker(PR_VERTICAL_ALIGN);
+ // vertical-align
+ m = new LengthProperty.Maker(PR_VERTICAL_ALIGN);
m.setInherited(false);
m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
m.addEnum("text-bottom", getEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM"));
m.addEnum("top", getEnumProperty(EN_TOP, "TOP"));
m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
+ m.setDatatypeParser(new VerticalAlignShorthandParser());
m.setDefault("baseline");
addPropertyMaker("vertical-align", m);
{
Property p = values[propId];
if (p == null) {
+ if (propId == 94) {
+ propId = propId;
+ }
p = values[propId] = super.get(propId, bTryInherit, bTryDefault);
}
return p;
import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
+import org.apache.fop.fo.properties.SpaceProperty;
/**
* Common base class for instream-foreign-object and external-graphics
private LengthRangeProperty inlineProgressionDimension;
private KeepProperty keepWithNext;
private KeepProperty keepWithPrevious;
- private Length lineHeight;
+ private SpaceProperty lineHeight;
private int overflow;
private int scaling;
private int scalingMethod;
private int textAlign;
- private int verticalAlign; // shorthand!!!
private Length width;
// End of property values
inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange();
keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
overflow = pList.get(PR_OVERFLOW).getEnum();
scaling = pList.get(PR_SCALING).getEnum();
scalingMethod = pList.get(PR_SCALING_METHOD).getEnum();
textAlign = pList.get(PR_TEXT_ALIGN).getEnum();
- verticalAlign = pList.get(PR_VERTICAL_ALIGN).getEnum();
width = pList.get(PR_WIDTH).getLength();
}
/**
* @return the "line-height" property.
*/
- public Length getLineHeight() {
+ public SpaceProperty getLineHeight() {
return lineHeight;
}
return scaling;
}
- /**
- * @return the "vertical-align" property.
- */
- public int getVerticalAlign() {
- return verticalAlign;
- }
-
/**
* @return the "overflow" property.
*/
return overflow;
}
+ /**
+ * @return the "alignment-adjust" property
+ */
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
+ }
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
/**
* @see org.apache.fop.fo.IntrinsicSizeAccess#getIntrinsicWidth()
*/
private ColorTypeProperty prColor;
// private ToBeImplementedProperty prDirection;
// private ToBeImplementedProperty prLetterSpacing;
- private Length prLineHeight;
+ private SpaceProperty lineHeight;
// private ToBeImplementedProperty prScoreSpaces;
// private ToBeImplementedProperty prUnicodeBidi;
private SpaceProperty prWordSpacing;
int lvlFootnote = findAncestor(FO_FOOTNOTE);
if (lvlLeader > 0) {
- if (lvlInCntr < 0 ||
- (lvlInCntr > 0 && lvlInCntr > lvlLeader)) {
+ if (lvlInCntr < 0 || (lvlInCntr > 0 && lvlInCntr > lvlLeader)) {
canHaveBlockLevelChildren = false;
}
} else if (lvlInline > 0 && lvlFootnote == (lvlInline + 1)) {
- if (lvlInCntr < 0 ||
- (lvlInCntr > 0 && lvlInCntr > lvlInline)) {
+ if (lvlInCntr < 0 || (lvlInCntr > 0 && lvlInCntr > lvlInline)) {
canHaveBlockLevelChildren = false;
}
}
prColor = pList.get(PR_COLOR).getColorType();
// prDirection = pList.get(PR_DIRECTION);
// prLetterSpacing = pList.get(PR_LETTER_SPACING);
- prLineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
// prScoreSpaces = pList.get(PR_SCORE_SPACES);
// prUnicodeBidi = pList.get(PR_UNICODE_BIDI);
prWordSpacing = pList.get(PR_WORD_SPACING).getSpace();
} else if (!isBlockOrInlineItem(nsURI, localName)) {
invalidChildError(loc, nsURI, localName);
} else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) {
- String ruleViolated = "An fo:bidi-override" +
- " that is a descendant of an fo:leader or of the fo:inline child" +
- " of an fo:footnote may not have block-level children, unless it" +
- " has a nearer ancestor that is an fo:inline-container.";
+ String ruleViolated = "An fo:bidi-override"
+ + " that is a descendant of an fo:leader or of the fo:inline child"
+ + " of an fo:footnote may not have block-level children, unless it"
+ + " has a nearer ancestor that is an fo:inline-container.";
invalidChildError(loc, nsURI, localName, ruleViolated);
} else {
blockOrInlineItemFound = true;
}
}
+ /**
+ * @return the "line-height" property.
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
package org.apache.fop.fo.flow;
+import java.util.Iterator;
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
boolean bInWS = false;
boolean bPrevWasLF = false;
- /* bSeenNonWSYet is an indicator used for trimming all leading
+ /* seenNonWSYet is an indicator used for trimming all leading
whitespace for the first inline child of the block
*/
boolean bSeenNonWSYet = false;
import org.apache.fop.fo.properties.CommonTextDecoration;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.SpaceProperty;
/**
* This class represents the flow object 'fo:character'. Its use is defined by
private KeepProperty keepWithNext;
private KeepProperty keepWithPrevious;
private Property letterSpacing;
- private Length lineHeight;
+ private SpaceProperty lineHeight;
private int scoreSpaces;
private int suppressAtLineBreak;
/** Holds the text decoration values. May be null */
private CommonTextDecoration textDecoration;
// private ToBeImplementedProperty textShadow;
private int textTransform;
- private int verticalAlign;
private int visibility;
private Property wordSpacing;
// End of property values
keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
letterSpacing = pList.get(PR_LETTER_SPACING);
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum();
suppressAtLineBreak = pList.get(PR_SUPPRESS_AT_LINE_BREAK).getEnum();
textDecoration = pList.getTextDecorationProps();
// textShadow = pList.get(PR_TEXT_SHADOW);
textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum();
- verticalAlign = pList.get(PR_VERTICAL_ALIGN).getEnum();
visibility = pList.get(PR_VISIBILITY).getEnum();
wordSpacing = pList.get(PR_WORD_SPACING);
}
return color;
}
+ /**
+ * @return the "alignment-adjust" property
+ */
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
+ }
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
/**
* @return the "id" property.
*/
return letterSpacing;
}
+ /**
+ * @return the "line-height" property.
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
return textDecoration;
return wordSpacing;
}
- /**
- * @return the "vertical-align" property.
- */
- public int getVerticalAlign() {
- return verticalAlign;
- }
-
/**
* @see org.apache.fop.fo.FObj#getName()
*/
private ColorTypeProperty color;
private String id;
// private ToBeImplementedProperty letterSpacing;
- private Length lineHeight;
+ private SpaceProperty lineHeight;
private int scoreSpaces;
private int textDecoration;
// private ToBeImplementedProperty textShadow;
color = pList.get(PR_COLOR).getColorType();
id = pList.get(PR_ID).getString();
// letterSpacing = pList.get(PR_LETTER_SPACING);
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum();
textDecoration = pList.get(PR_TEXT_DECORATION).getEnum();
// textShadow = pList.get(PR_TEXT_SHADOW);
invalidChildError(loc, nsURI, localName);
}
+ /**
+ * @return the "line-height" property.
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
private KeepProperty keepTogether;
private KeepProperty keepWithNext;
private KeepProperty keepWithPrevious;
- private int verticalAlign;
private Length width;
private int wrapOption;
// End of property values
keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep();
keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
- verticalAlign = pList.get(PR_VERTICAL_ALIGN).getEnum();
width = pList.get(PR_WIDTH).getLength();
wrapOption = pList.get(PR_WRAP_OPTION).getEnum();
}
}
/**
- * Return the "vertical-align" property.
+ * @return the "alignment-adjust" property
*/
- public int getVerticalAlign() {
- return verticalAlign;
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
}
-
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
/**
* @see org.apache.fop.fo.FObjMixed#charIterator
*/
import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
+import org.apache.fop.fo.properties.SpaceProperty;
/**
* Class modelling the fo:inline-container object.
private KeepProperty keepTogether;
private KeepProperty keepWithNext;
private KeepProperty keepWithPrevious;
- private Length lineHeight;
+ private SpaceProperty lineHeight;
private int overflow;
private Numeric referenceOrientation;
private Length width;
keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep();
keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
overflow = pList.get(PR_OVERFLOW).getEnum();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
width = pList.get(PR_WIDTH).getLength();
}
}
+ /**
+ * @return the "alignment-adjust" property
+ */
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
+ }
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
+ /**
+ * @return the "line-height" property.
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
/**
* @return the "id" property.
*/
public int getNameId() {
return FO_INLINE_CONTAINER;
}
+
}
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonFont;
import org.apache.fop.fo.properties.CommonMarginInline;
+import org.apache.fop.fo.properties.SpaceProperty;
/**
* Class modelling the commonalities of several inline-level
protected CommonAural commonAural;
protected CommonFont commonFont;
protected ColorType color;
- protected Length lineHeight;
+ protected SpaceProperty lineHeight;
protected int visibility;
// End of property values
commonAural = pList.getAuralProps();
commonFont = pList.getFontProps();
color = pList.get(PR_COLOR).getColorType();
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
visibility = pList.get(PR_VISIBILITY).getEnum();
}
public ColorType getColor() {
return color;
}
+
+ /**
+ * @return the "line-height" property
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
}
private CommonRelativePosition commonRelativePosition;
private Length alignmentAdjust;
private int alignmentBaseline;
- private int verticalAlign;
private Length baselineShift;
private int dominantBaseline;
private Length textDepth;
commonRelativePosition = pList.getRelativePositionProps();
alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength();
alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum();
- verticalAlign = pList.get(PR_VERTICAL_ALIGN).getEnum();
baselineShift = pList.get(PR_BASELINE_SHIFT).getLength();
dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum();
textDepth = pList.get(PR_TEXT_DEPTH).getLength();
}
/**
- * @return the "vertical-align" property.
+ * @return the "alignment-adjust" property
*/
- public int getVerticalAlign() {
- return verticalAlign;
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
}
-
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
private KeepProperty keepWithNext;
private KeepProperty keepWithPrevious;
// private ToBeImplementedProperty letterSpacing;
- private Length lineHeight;
+ private SpaceProperty lineHeight;
private int scoreSpaces;
private Length textAltitude;
/** Holds the text decoration values. May be null */
keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
// letterSpacing = pList.get(PR_LETTER_SPACING);
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum();
textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength();
textDecoration = pList.getTextDecorationProps();
return textDecoration;
}
- /** @see org.apache.fop.fo.FONode#getName() */
+ /**
+ * @return the "alignment-adjust" property
+ */
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
+ }
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
+ /**
+ * @return the "line-height" property
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
+ /** @see org.apache.fop.fo.FONode#getName() */
public String getName() {
return "fo:page-number";
}
private KeepProperty keepWithNext;
private KeepProperty keepWithPrevious;
// private ToBeImplementedProperty letterSpacing;
- private Length lineHeight;
+ private SpaceProperty lineHeight;
private String refId;
private int scoreSpaces;
private Length textAltitude;
keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
// letterSpacing = pList.get(PR_LETTER_SPACING);
- lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
refId = pList.get(PR_REF_ID).getString();
scoreSpaces = pList.get(PR_SCORE_SPACES).getEnum();
textAltitude = pList.get(PR_TEXT_ALTITUDE).getLength();
return textDecoration;
}
+ /**
+ * @return the "alignment-adjust" property
+ */
+ public Length getAlignmentAdjust() {
+ return alignmentAdjust;
+ }
+
+ /**
+ * @return the "alignment-baseline" property
+ */
+ public int getAlignmentBaseline() {
+ return alignmentBaseline;
+ }
+
+ /**
+ * @return the "baseline-shift" property
+ */
+ public Length getBaselineShift() {
+ return baselineShift;
+ }
+
+ /**
+ * @return the "dominant-baseline" property
+ */
+ public int getDominantBaseline() {
+ return dominantBaseline;
+ }
+
+ /** @return the Common Border, Padding, and Background Properties. */
+ public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
+ return commonBorderPaddingBackground;
+ }
+
+ /**
+ * @return the "line-height" property
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
/** @return the "id" property. */
public String getId() {
return id;
--- /dev/null
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo.properties;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * A shorthand parser for the vertical-align shorthand. It is used to set
+ * values for alignment-baseline, alignment-adjust, baseline-shift
+ * and dominant-baseline.
+ */
+public class VerticalAlignShorthandParser implements ShorthandParser, Constants {
+
+ /**
+ * @see ShorthandParser#getValueForProperty(int, Property, PropertyMaker, PropertyList)
+ */
+ public Property getValueForProperty(int propId,
+ Property property,
+ PropertyMaker maker,
+ PropertyList propertyList) {
+ int propVal = property.getEnum();
+ switch (propVal) {
+ case EN_BASELINE:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_BASELINE, "BASELINE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_TOP:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_TEXT_TOP:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_MIDDLE:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_MIDDLE, "MIDDLE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_BOTTOM:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_AFTER_EDGE, "AFTER_EDGE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_TEXT_BOTTOM:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_SUB:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_BASELINE, "BASELINE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_SUB, "SUB"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ case EN_SUPER:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_BASELINE, "BASELINE");
+ case PR_ALIGNMENT_ADJUST:
+ return new EnumLength(new EnumProperty(EN_AUTO, "AUTO"));
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_SUPER, "SUPER"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ default:
+ switch (propId) {
+ case PR_ALIGNMENT_BASELINE:
+ return new EnumProperty(EN_BASELINE, "BASELINE");
+ case PR_ALIGNMENT_ADJUST:
+ return property;
+ case PR_BASELINE_SHIFT:
+ return new EnumLength(new EnumProperty(EN_BASELINE, "BASELINE"));
+ case PR_DOMINANT_BASELINE:
+ return new EnumProperty(EN_AUTO, "AUTO");
+ }
+ }
+ return null;
+ }
+
+}
public abstract class AbstractBaseLayoutManager
implements LayoutManager, PercentBaseContext {
+ /** Indicator if this LM generates reference areas */
protected boolean generatesReferenceArea = false;
+ /** Indicator if this LM generates block areas */
protected boolean generatesBlockArea = false;
-
+ /** The formatting object for this LM */
protected FObj fobj = null;
/**
return false;
}
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#getFObj
+ */
public FObj getFObj() {
return fobj;
}
*/
public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
implements Constants {
+
+ /** Parent LayoutManager for this LayoutManager */
protected LayoutManager parentLM = null;
+ /** List of child LayoutManagers */
protected List childLMs = null;
+ /** Iterator for child LayoutManagers */
protected ListIterator fobjIter = null;
+ /** Marker map for markers related to this LayoutManager */
protected Map markers = null;
/** True if this LayoutManager has handled all of its content. */
private boolean bFinished = false;
- /** child LM and child LM iterator during getNextBreakPoss phase */
+ /** child LM and child LM iterator during getNextKnuthElement phase */
protected LayoutManager curChildLM = null;
+ /** child LM and child LM iterator during getNextKnuthElement phase */
protected ListIterator childLMiter = null;
+ private int lastGeneratedPosition = -1;
+ private int smallestPosNumberChecked = Integer.MAX_VALUE;
+
/**
* Abstract layout manager.
*/
childLMiter = new LMiter(this);
}
+ /** @see LayoutManager#setParent(LayoutManager) */
public void setParent(LayoutManager lm) {
this.parentLM = lm;
}
+ /** @see LayoutManager#getParent */
public LayoutManager getParent() {
return this.parentLM;
}
+ /** @see LayoutManager#initialize */
public void initialize() {
// Empty
}
* all children have finished layout.
* Note: child must implement LayoutManager! If it doesn't, skip it
* and print a warning.
+ * @return the current child LayoutManager
*/
protected LayoutManager getChildLM() {
if (curChildLM != null && !curChildLM.isFinished()) {
return null;
}
+ /**
+ * Return indication if getChildLM will return another LM.
+ * @return true if another child LM is still available
+ */
+ protected boolean hasNextChildLM() {
+ return childLMiter.hasNext();
+ }
+
/**
* Reset the layoutmanager "iterator" so that it will start
* with the passed Position's generating LM
}
}
+ /** @see LayoutManager#resetPosition(Position) */
public void resetPosition(Position resetPos) {
// if (resetPos == null) {
// reset(null);
return bFinished;
}
+ /**
+ * Set the flag indicating the LayoutManager has handled all of its content.
+ * @param fin the flag value to be set
+ */
public void setFinished(boolean fin) {
bFinished = fin;
}
/**
- * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(org.apache.fop.layoutmgr.PositionIterator, org.apache.fop.layoutmgr.LayoutContext)
+ * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(
+ * org.apache.fop.layoutmgr.PositionIterator
+ * , org.apache.fop.layoutmgr.LayoutContext)
*/
public void addAreas(PositionIterator posIter, LayoutContext context) {
}
return null;
}
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#getChangedKnuthElements(List, int)
+ */
public LinkedList getChangedKnuthElements(List oldList,
- /*int flaggedPenalty,*/
int alignment) {
log.warn("null implementation of getChangeKnuthElement() called!");
return null;
* Finally, based on the dimensions of the parent area, it initializes
* its own area. This includes setting the content IPD and the maximum
* BPD.
+ * @param childArea the child area for which the parent area is wanted
+ * @return the parent area for the given child
*/
public Area getParentArea(Area childArea) {
return null;
* Add a child area to the current area. If this causes the maximum
* dimension of the current area to be exceeded, the parent LM is called
* to add it.
+ * @param childArea the child area to be added
*/
public void addChildArea(Area childArea) {
}
}
}
+ /**
+ * Adds a Position to the Position participating in the first|last determination by assigning
+ * it a unique position index.
+ * @param pos the Position
+ * @return the same Position but with a position index
+ */
+ protected Position notifyPos(Position pos) {
+ if (pos.getIndex() >= 0) {
+ throw new IllegalStateException("Position already got its index");
+ }
+ lastGeneratedPosition++;
+ pos.setIndex(lastGeneratedPosition);
+ return pos;
+ }
+
+ /**
+ * Indicates whether the given Position is the first area-generating Position of this LM.
+ * @param pos the Position (must be one with a position index)
+ * @return True if it is the first Position
+ */
+ public boolean isFirst(Position pos) {
+ //log.trace("isFirst() smallestPosNumberChecked=" + smallestPosNumberChecked + " " + pos);
+ if (pos.getIndex() < 0) {
+ throw new IllegalArgumentException("Only Positions with an index can be checked");
+ }
+ if (pos.getIndex() == this.smallestPosNumberChecked) {
+ return true;
+ } else if (pos.getIndex() < this.smallestPosNumberChecked) {
+ this.smallestPosNumberChecked = pos.getIndex();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Indicates whether the given Position is the last area-generating Position of this LM.
+ * @param pos the Position (must be one with a position index)
+ * @return True if it is the last Position
+ */
+ public boolean isLast(Position pos) {
+ //log.trace("isLast() lastGenPos=" + lastGeneratedPosition + " " + pos);
+ if (pos.getIndex() < 0) {
+ throw new IllegalArgumentException("Only Positions with an index can be checked");
+ }
+ return (pos.getIndex() == this.lastGeneratedPosition
+ && isFinished());
+ }
+
}
childLC.setStackLimit(MinOptMax.subtract(context
.getStackLimit(), stackLimit));
childLC.setRefIPD(relDims.ipd);
+ childLC.setWritingMode(getBlockContainerFO().getWritingMode());
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
protected LayoutContext createLayoutContext() {
LayoutContext lc = super.createLayoutContext();
lc.setRefIPD(ipd.opt);
+ lc.setWritingMode(getBlockContainerFO().getWritingMode());
return lc;
}
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(context.getStackLimit());
childLC.setRefIPD(context.getRefIPD());
-
+ childLC.setWritingMode(getBlockContainerFO().getWritingMode());
+
LinkedList returnedList = null;
if (!curLM.isFinished()) {
returnedList = curLM.getNextKnuthElements(childLC, alignment);
*/
private LineLayoutManager createLineManager(LayoutManager firstlm) {
LineLayoutManager llm;
- llm = new LineLayoutManager(getBlockFO(), lineHeight, lead, follow, middleShift);
+ llm = new LineLayoutManager(getBlockFO(), lineHeight, lead, follow);
List inlines = new java.util.ArrayList();
inlines.add(firstlm);
while (proxyLMiter.hasNext()) {
/** see foSpaceBefore */
protected MinOptMax foSpaceAfter = null;
- private int lastGeneratedPosition = -1;
- private int smallestPosNumberChecked = Integer.MAX_VALUE;
-
private Position auxiliaryPosition;
private int contentAreaIPD = 0;
}
}
- /**
- * Adds a Position to the Position participating in the first|last determination by assigning
- * it a unique position index.
- * @param pos the Position
- * @return the same Position but with a position index
- */
- protected Position notifyPos(Position pos) {
- if (pos.getIndex() >= 0) {
- throw new IllegalStateException("Position already got its index");
- }
- lastGeneratedPosition++;
- pos.setIndex(lastGeneratedPosition);
- return pos;
- }
-
- /**
- * Indicates whether the given Position is the first area-generating Position of this LM.
- * @param pos the Position (must be one with a position index)
- * @return True if it is the first Position
- */
- public boolean isFirst(Position pos) {
- //log.trace("isFirst() smallestPosNumberChecked=" + smallestPosNumberChecked + " " + pos);
- if (pos.getIndex() < 0) {
- throw new IllegalArgumentException("Only Positions with an index can be checked");
- }
- if (pos.getIndex() == this.smallestPosNumberChecked) {
- return true;
- } else if (pos.getIndex() < this.smallestPosNumberChecked) {
- this.smallestPosNumberChecked = pos.getIndex();
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Indicates whether the given Position is the last area-generating Position of this LM.
- * @param pos the Position (must be one with a position index)
- * @return True if it is the last Position
- */
- public boolean isLast(Position pos) {
- //log.trace("isLast() lastGenPos=" + lastGeneratedPosition + " " + pos);
- if (pos.getIndex() < 0) {
- throw new IllegalArgumentException("Only Positions with an index can be checked");
- }
- return (pos.getIndex() == this.lastGeneratedPosition
- && isFinished());
- }
-
/** @return a cached auxiliary Position instance used for things like spaces. */
protected Position getAuxiliaryPosition() {
if (this.auxiliaryPosition == null) {
return contentAreaIPD;
}
+ /**
+ * Sets the IPD of the content area
+ * @param contentAreaIPD the IPD of the content area
+ */
protected void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(context.getStackLimit());
childLC.setRefIPD(context.getRefIPD());
-
+ childLC.setWritingMode(getCurrentPV().getSPM().getWritingMode());
+
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
//log.debug("FLM.getNextKnuthElements> returnedList.size() = " + returnedList.size());
import org.apache.fop.fo.Constants;
import org.apache.fop.layoutmgr.inline.HyphContext;
import org.apache.fop.traits.MinOptMax;
+import org.apache.fop.layoutmgr.inline.AlignmentContext;
/**
/** inline-progression-dimension of nearest ancestor reference area */
int refIPD;
+ /** the writing mode established by the nearest ancestor reference area */
+ private int writingMode = Constants.EN_LR_TB;
+
/** Current pending space-after or space-end from preceding area */
SpaceSpecifier trailingSpace;
/** Stretch or shrink value when adding spaces. */
private double dSpaceAdjust = 0.0;
- private int iLineHeight;
- private int iBaseline;
- private int iMiddleShift;
- private int iTopShift; /*LF*/
- private int iBottomShift; /*LF*/
- private int iSpaceBefore; /*LF*/
- private int iSpaceAfter; /*LF*/
+ private AlignmentContext alignmentContext = null;
+
+ /** Amount of space before / start */
+ private int spaceBefore = 0;
+
+ /** Amount of space after / end */
+ private int spaceAfter = 0;
+
+ /** Amount of space to reserve at the beginning of each line */
+ private int lineStartBorderAndPaddingWidth = 0;
+ /** Amount of space to reserve at the end of each line */
+ private int lineEndBorderAndPaddingWidth = 0;
public LayoutContext(LayoutContext parentLC) {
this.flags = parentLC.flags;
this.refIPD = parentLC.refIPD;
+ this.writingMode = parentLC.writingMode;
this.stackLimit = null; // Don't reference parent MinOptMax!
this.leadingSpace = parentLC.leadingSpace; //???
this.trailingSpace = parentLC.trailingSpace; //???
this.bpAlignment = parentLC.bpAlignment;
this.dSpaceAdjust = parentLC.dSpaceAdjust;
this.ipdAdjust = parentLC.ipdAdjust;
- this.iLineHeight = parentLC.iLineHeight;
- this.iBaseline = parentLC.iBaseline;
- this.iMiddleShift = parentLC.iMiddleShift;
-/*LF*/ this.iTopShift = parentLC.iTopShift;
-/*LF*/ this.iBottomShift = parentLC.iBottomShift;
-/*LF*/ this.iSpaceBefore = parentLC.iSpaceBefore;
-/*LF*/ this.iSpaceAfter = parentLC.iSpaceAfter;
+ this.alignmentContext = parentLC.alignmentContext;
+ this.lineStartBorderAndPaddingWidth = parentLC.lineStartBorderAndPaddingWidth;
+ this.lineEndBorderAndPaddingWidth = parentLC.lineEndBorderAndPaddingWidth;
// Copy other fields as necessary. Use clone???
}
return ipdAdjust;
}
- public void setLineHeight(int lh) {
- iLineHeight = lh;
- }
-
- public int getLineHeight() {
- return iLineHeight;
- }
-
- public void setBaseline(int bl) {
- iBaseline = bl;
- }
-
- public int getBaseline() {
- return iBaseline;
+ public void setAlignmentContext(AlignmentContext alignmentContext) {
+ this.alignmentContext = alignmentContext;
}
- public void setMiddleShift(int ms) {
- iMiddleShift = ms;
+ public AlignmentContext getAlignmentContext() {
+ return this.alignmentContext;
}
- public int getMiddleBaseline() {
- return iBaseline + iMiddleShift;
+ public void resetAlignmentContext() {
+ if (this.alignmentContext != null) {
+ this.alignmentContext = this.alignmentContext.getParentAlignmentContext();
+ }
}
- public void setTopShift(int ts) {
- iTopShift = ts;
- }
-
- public int getTopBaseline() {
- return iBaseline + iTopShift;
- }
-
- public void setBottomShift(int bs) {
- iBottomShift = bs;
- }
-
- public int getBottomBaseline() {
- return iBaseline + iBottomShift;
- }
-
- public int getSpaceBefore() {
- return iSpaceBefore;
+ /**
+ * Get the width to be reserved for border and padding at the start of the line.
+ * @return the width to be reserved
+ */
+ public int getLineStartBorderAndPaddingWidth() {
+ return lineStartBorderAndPaddingWidth;
}
- public void setSpaceBefore(int sp) {
- iSpaceBefore = sp;
+ /**
+ * Set the width to be reserved for border and padding at the start of the line.
+ * @param lineStartBorderAndPaddingWidth the width to be reserved
+ */
+ public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth) {
+ this.lineStartBorderAndPaddingWidth = lineStartBorderAndPaddingWidth;
}
-
- public int getSpaceAfter() {
- return iSpaceAfter;
+
+ /**
+ * Get the width to be reserved for border and padding at the end of the line.
+ * @return the width to be reserved
+ */
+ public int getLineEndBorderAndPaddingWidth() {
+ return lineEndBorderAndPaddingWidth;
}
-
- public void setSpaceAfter(int sp) {
- iSpaceAfter = sp;
+
+ /**
+ * Set the width to be reserved for border and padding at the end of the line.
+ * @param lineEndBorderAndPaddingWidth the width to be reserved
+ */
+ public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth) {
+ this.lineEndBorderAndPaddingWidth = lineEndBorderAndPaddingWidth;
}
/**
}
}
+ /**
+ * Get the writing mode of the relevant reference area.
+ * @return the applicable writing mode
+ */
+ public int getWritingMode() {
+ return writingMode;
+ }
+
+ /**
+ * Set the writing mode.
+ * @param writingMode the writing mode
+ */
+ public void setWritingMode(int writingMode) {
+ this.writingMode = writingMode;
+ }
+
+ /**
+ * Get the current amount of space before / start
+ * @return the space before / start amount
+ */
+ public int getSpaceBefore() {
+ return spaceBefore;
+ }
+
+ /**
+ * Set the amount of space before / start
+ * @param spaceBefore the amount of space before / start
+ */
+ public void setSpaceBefore(int spaceBefore) {
+ this.spaceBefore = spaceBefore;
+ }
+
+ /**
+ * Get the current amount of space after / end
+ * @return the space after / end amount
+ */
+ public int getSpaceAfter() {
+ return spaceAfter;
+ }
+
+ /**
+ * Set the amount of space after / end
+ * @param spaceAfter the amount of space after / end
+ */
+ public void setSpaceAfter(int spaceAfter) {
+ this.spaceAfter = spaceAfter;
+ }
+
/** @see java.lang.Object#toString() */
public String toString() {
return "Layout Context:" +
"\nReference IPD: \t" + getRefIPD() +
"\nSpace Adjust: \t" + getSpaceAdjust() +
"\nIPD Adjust: \t" + getIPDAdjust() +
- "\nLine Height: \t" + getLineHeight() +
- "\nBaseline: \t" + getBaseline() +
- "\nMiddle Baseline: \t" + getMiddleBaseline() +
"\nResolve Leading Space: \t" + resolveLeadingSpace() +
"\nSuppress Leading Space: \t" + suppressLeadingSpace() +
"\nIs First Area: \t" + isFirstArea() +
"\nStarts New Area: \t" + startsNewArea() +
"\nIs Last Area: \t" + isLastArea() +
"\nTry Hyphenate: \t" + tryHyphenate() +
- "\nKeeps: \t[" + (isKeepWithNextPending()?"keep-with-next":"") + "]["
- + (isKeepWithPreviousPending()?"keep-with-previous":"") + "] pending";
+ "\nKeeps: \t[" + (isKeepWithNextPending() ? "keep-with-next" : "") + "]["
+ + (isKeepWithPreviousPending() ? "keep-with-previous" : "") + "] pending";
}
+
}
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(context.getStackLimit());
childLC.setRefIPD(context.getRefIPD());
+ childLC.setWritingMode(context.getWritingMode());
LinkedList returnedList = null;
if (!curLM.isFinished()) {
*/
public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManager {
+ /** The graphics object this LM deals with */
protected AbstractGraphics fobj;
/**
int ipd = -1;
boolean bpdauto = false;
if (hasLH) {
- bpd = fobj.getLineHeight().getValue(this);
+ bpd = fobj.getLineHeight().getOptimum(this).getLength().getValue(this);
} else {
// this property does not apply when the line-height applies
// isn't the block-progression-dimension always in the same
//Determine extra IPD from borders etc.
int startIPD = borderProps.getPadding(CommonBorderPaddingBackground.START,
- false/*bNotFirst*/, this);
+ false, this);
startIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.START,
- false/*bNotFirst*/);
- int endIPD = borderProps.getPadding(CommonBorderPaddingBackground.END, false/*bNotLast*/, this);
- endIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, false/*bNotLast*/);
+ false);
+ int endIPD = borderProps.getPadding(CommonBorderPaddingBackground.END, false, this);
+ endIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, false);
xoffset += startIPD;
//ipd += startIPD;
int alignment) {
Viewport areaCurrent = getInlineArea();
setCurrentArea(areaCurrent);
- setAlignment(fobj.getVerticalAlign());
- setLead(areaCurrent.getAllocBPD());
return super.getNextKnuthElements(context, alignment);
}
/**
- * @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#addId()
+ * @see LeafNodeLayoutManager.makeAlignmentContext(LayoutContext)
*/
- protected void addId() {
- getPSLM().addIDToPage(fobj.getId());
+ protected AlignmentContext makeAlignmentContext(LayoutContext context) {
+ return new AlignmentContext(
+ get(context).getAllocBPD()
+ , fobj.getAlignmentAdjust()
+ , fobj.getAlignmentBaseline()
+ , fobj.getBaselineShift()
+ , fobj.getDominantBaseline()
+ , context.getAlignmentContext()
+ );
}
/**
- * Offset this area.
- * Offset the inline area in the bpd direction when adding the
- * inline area.
- * This is used for vertical alignment.
- * External graphic uses the large allocation rectangle so we have
- * to take the border/padding into account as well.
- * @param area the inline area to be updated
- * @param context the layout context used for adding the area
- * @see LeafNodeLayoutManager#offsetArea(InlineArea, LayoutContext)
+ * @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#addId()
*/
- protected void offsetArea(InlineArea area, LayoutContext context) {
- int bpd = area.getBPD()
- + area.getBorderAndPaddingWidthBefore()
- + area.getBorderAndPaddingWidthAfter();
- switch (verticalAlignment) {
- case EN_MIDDLE:
- area.setOffset(context.getMiddleBaseline() - bpd / 2);
- break;
- case EN_TOP:
- area.setOffset(context.getTopBaseline());
- break;
- case EN_BOTTOM:
- area.setOffset(context.getBottomBaseline() - bpd);
- break;
- case EN_BASELINE:
- default:
- area.setOffset(context.getBaseline() - bpd);
- break;
- }
+ protected void addId() {
+ getPSLM().addIDToPage(fobj.getId());
}
/**
return getIntrinsicWidth();
case LengthBase.IMAGE_INTRINSIC_HEIGHT:
return getIntrinsicHeight();
+ case LengthBase.ALIGNMENT_ADJUST:
+ return get(null).getBPD();
default: // Delegate to super class
return super.getBaseLength(lengthBase, fobj);
}
--- /dev/null
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.inline;
+
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.LengthBase;
+import org.apache.fop.datatypes.SimplePercentBaseContext;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fonts.Font;
+
+/**
+ * The alignment context is carried within a LayoutContext and as
+ * part of the Knuth Inline elements to facilitate proper line building.
+ * All measurements are in mpt.
+ */
+public class AlignmentContext implements Constants {
+
+ /** The height or BPD of this context */
+ private int areaHeight;
+ /** The computed line-height property value applicable */
+ private int lineHeight;
+ /** The distance in BPD from the top of the box to the alignmentPoint */
+ private int alignmentPoint;
+ /** The baseline shift value in effect */
+ private int baselineShiftValue;
+ /** The computed alignment baseline identifier */
+ private int alignmentBaselineIdentifier;
+ /** The x height */
+ private int xHeight;
+ private ScaledBaselineTable scaledBaselineTable = null;
+ private ScaledBaselineTable actualBaselineTable = null;
+ private AlignmentContext parentAlignmentContext = null;
+
+ /**
+ * Creates a new instance of AlignmentContext
+ * for graphics areas.
+ * @param height the total height of the area
+ * @param alignmentAdjust the alignment-adjust property
+ * @param alignmentBaseline the alignment-baseline property
+ * @param baselineShift the baseline-shift property
+ * @param dominantBaseline the dominant-baseline property
+ * @param parentAlignmentContext the parent alignment context
+ */
+ public AlignmentContext(int height
+ , Length alignmentAdjust
+ , int alignmentBaseline
+ , Length baselineShift
+ , int dominantBaseline
+ , AlignmentContext parentAlignmentContext) {
+
+ this.areaHeight = height;
+ this.lineHeight = height;
+ this.xHeight = height;
+ this.parentAlignmentContext = parentAlignmentContext;
+ this.scaledBaselineTable = parentAlignmentContext.getScaledBaselineTable();
+ setAlignmentBaselineIdentifier(alignmentBaseline
+ , parentAlignmentContext.getDominantBaselineIdentifier());
+ setBaselineShift(baselineShift);
+ int dominantBaselineIdentifier = parentAlignmentContext.getDominantBaselineIdentifier();
+ boolean newScaledBaselineTableRequired = false;
+ if (baselineShiftValue != 0) {
+ newScaledBaselineTableRequired = true;
+ }
+ switch (dominantBaseline) {
+ case EN_AUTO:
+ newScaledBaselineTableRequired = baselineShiftValue != 0;
+ break;
+ case EN_USE_SCRIPT: // TODO
+ break;
+ case EN_NO_CHANGE:
+ break;
+ case EN_RESET_SIZE:
+ newScaledBaselineTableRequired = true;
+ break;
+ default:
+ newScaledBaselineTableRequired = true;
+ dominantBaselineIdentifier = dominantBaseline;
+ break;
+ }
+ actualBaselineTable = ScaledBaselineTableFactory.makeGraphicsScaledBaselineTable(
+ height,
+ dominantBaselineIdentifier,
+ scaledBaselineTable.getWritingMode());
+ if (newScaledBaselineTableRequired) {
+ scaledBaselineTable = ScaledBaselineTableFactory.makeGraphicsScaledBaselineTable(
+ height,
+ dominantBaselineIdentifier,
+ scaledBaselineTable.getWritingMode());
+ }
+ setAlignmentAdjust(alignmentAdjust);
+ }
+
+ /**
+ * Creates a new instance of AlignmentContext
+ * @param font the font
+ * @param lineHeight the computed value of the lineHeight property
+ * @param alignmentAdjust the alignment-adjust property
+ * @param alignmentBaseline the alignment-baseline property
+ * @param baselineShift the baseline-shift property
+ * @param dominantBaseline the dominant-baseline property
+ * @param parentAlignmentContext the parent alignment context
+ */
+ public AlignmentContext(Font font
+ , int lineHeight
+ , Length alignmentAdjust
+ , int alignmentBaseline
+ , Length baselineShift
+ , int dominantBaseline
+ , AlignmentContext parentAlignmentContext) {
+ this.areaHeight = font.getAscender() - font.getDescender();
+ this.lineHeight = lineHeight;
+ this.parentAlignmentContext = parentAlignmentContext;
+ this.scaledBaselineTable = parentAlignmentContext.getScaledBaselineTable();
+ this.xHeight = font.getXHeight();
+ setAlignmentBaselineIdentifier(alignmentBaseline
+ , parentAlignmentContext.getDominantBaselineIdentifier());
+ setBaselineShift(baselineShift);
+ int dominantBaselineIdentifier = parentAlignmentContext.getDominantBaselineIdentifier();
+ boolean newScaledBaselineTableRequired = false;
+ if (baselineShiftValue != 0) {
+ newScaledBaselineTableRequired = true;
+ }
+ switch (dominantBaseline) {
+ case EN_AUTO:
+ newScaledBaselineTableRequired = baselineShiftValue != 0;
+ break;
+ case EN_USE_SCRIPT: // TODO
+ break;
+ case EN_NO_CHANGE:
+ break;
+ case EN_RESET_SIZE:
+ newScaledBaselineTableRequired = true;
+ break;
+ default:
+ newScaledBaselineTableRequired = true;
+ dominantBaselineIdentifier = dominantBaseline;
+ break;
+ }
+ actualBaselineTable = ScaledBaselineTableFactory.makeFontScaledBaselineTable(font,
+ dominantBaselineIdentifier,
+ scaledBaselineTable.getWritingMode());
+ if (newScaledBaselineTableRequired) {
+ scaledBaselineTable = ScaledBaselineTableFactory.makeFontScaledBaselineTable(font,
+ dominantBaselineIdentifier,
+ scaledBaselineTable.getWritingMode());
+ }
+ setAlignmentAdjust(alignmentAdjust);
+ }
+
+ /**
+ * Creates a new instance of AlignmentContext based simply
+ * on the font and the writing mode.
+ * @param font the font
+ * @param lineHeight the omputed value of the lineHeight property
+ * @param writingMode the current writing mode
+ */
+ public AlignmentContext(Font font, int lineHeight, int writingMode) {
+ this.areaHeight = font.getAscender() - font.getDescender();
+ this.lineHeight = lineHeight;
+ this.xHeight = font.getXHeight();
+ this.parentAlignmentContext = null;
+ this.scaledBaselineTable
+ = ScaledBaselineTableFactory.makeFontScaledBaselineTable(font, writingMode);
+ this.actualBaselineTable = scaledBaselineTable;
+ this.alignmentBaselineIdentifier = getDominantBaselineIdentifier();
+ this.alignmentPoint = font.getAscender();
+ this.baselineShiftValue = 0;
+ }
+
+ /**
+ * Returns the alignment point for this context.
+ * This is the point on the start edge of the area this context
+ * applies to measured from the before edge of the area.
+ * @return the default alignment point
+ */
+ public int getAlignmentPoint() {
+ return alignmentPoint;
+ }
+
+ /**
+ * Returns the current value of baseline shift in effect.
+ * @return the baseline shift
+ */
+ public int getBaselineShiftValue() {
+ return baselineShiftValue;
+ }
+
+ /**
+ * Returns the current alignment baseline identifier
+ * @return the alignment baseline identifier
+ */
+ public int getAlignmentBaselineIdentifier() {
+ return alignmentBaselineIdentifier;
+ }
+
+ /**
+ * Sets the current alignment baseline identifer. For
+ * alignment-baseline values of "auto" and "baseline" this
+ * method does the conversion into the appropriate computed
+ * value assuming script is "auto" and the fo is not fo:character.
+ * @param alignmentBaseline the alignment-baseline property
+ * @param parentDominantBaselineIdentifier the dominant baseline of the parent fo
+ */
+ private void setAlignmentBaselineIdentifier(int alignmentBaseline
+ , int parentDominantBaselineIdentifier) {
+ switch (alignmentBaseline) {
+ case EN_AUTO: // fall through
+ case EN_BASELINE:
+ this.alignmentBaselineIdentifier = parentDominantBaselineIdentifier;
+ break;
+ case EN_BEFORE_EDGE:
+ case EN_TEXT_BEFORE_EDGE:
+ case EN_CENTRAL:
+ case EN_MIDDLE:
+ case EN_AFTER_EDGE:
+ case EN_TEXT_AFTER_EDGE:
+ case EN_IDEOGRAPHIC:
+ case EN_ALPHABETIC:
+ case EN_HANGING:
+ case EN_MATHEMATICAL:
+ this.alignmentBaselineIdentifier = alignmentBaseline;
+ break;
+ case EN_TOP:
+ if (isHorizontalWritingMode()) {
+ this.alignmentBaselineIdentifier = EN_BEFORE_EDGE;
+ } else {
+ this.alignmentBaselineIdentifier = getDominantBaselineIdentifier();
+ }
+ break;
+ case EN_BOTTOM:
+ if (isHorizontalWritingMode()) {
+ this.alignmentBaselineIdentifier = EN_AFTER_EDGE;
+ } else {
+ this.alignmentBaselineIdentifier = getDominantBaselineIdentifier();
+ }
+ break;
+ case EN_TEXT_TOP:
+ if (isHorizontalWritingMode()) {
+ this.alignmentBaselineIdentifier = EN_TEXT_BEFORE_EDGE;
+ } else {
+ this.alignmentBaselineIdentifier = getDominantBaselineIdentifier();
+ }
+ break;
+ case EN_TEXT_BOTTOM:
+ if (isHorizontalWritingMode()) {
+ this.alignmentBaselineIdentifier = EN_TEXT_AFTER_EDGE;
+ } else {
+ this.alignmentBaselineIdentifier = getDominantBaselineIdentifier();
+ }
+ break;
+ }
+ }
+
+ /**
+ * Sets the current alignment baseline identifer. For
+ * alignment-baseline values of "auto" and "baseline" this
+ * method does the conversion into the appropriate computed
+ * value assuming script is "auto" and the fo is not fo:character.
+ * @param alignmentAdjust the alignment-adjust property
+ */
+ private void setAlignmentAdjust(Length alignmentAdjust) {
+ int beforeEdge = actualBaselineTable.getBaseline(EN_BEFORE_EDGE);
+ switch (alignmentAdjust.getEnum()) {
+ case EN_AUTO:
+ alignmentPoint = beforeEdge
+ - actualBaselineTable.getBaseline(alignmentBaselineIdentifier);
+ break;
+ case EN_BASELINE:
+ alignmentPoint = beforeEdge;
+ break;
+ case EN_BEFORE_EDGE:
+ case EN_TEXT_BEFORE_EDGE:
+ case EN_CENTRAL:
+ case EN_MIDDLE:
+ case EN_AFTER_EDGE:
+ case EN_TEXT_AFTER_EDGE:
+ case EN_IDEOGRAPHIC:
+ case EN_ALPHABETIC:
+ case EN_HANGING:
+ case EN_MATHEMATICAL:
+ alignmentPoint = beforeEdge
+ - actualBaselineTable.getBaseline(alignmentAdjust.getEnum());
+ break;
+ case EN_TOP: // fall through
+ if (isHorizontalWritingMode()) {
+ alignmentPoint = 0;
+ } else {
+ alignmentPoint = beforeEdge;
+ }
+ break;
+ case EN_BOTTOM:
+ if (isHorizontalWritingMode()) {
+ alignmentPoint = beforeEdge - actualBaselineTable.getBaseline(EN_AFTER_EDGE);
+ } else {
+ alignmentPoint = beforeEdge;
+ }
+ break;
+ case EN_TEXT_TOP:
+ if (isHorizontalWritingMode()) {
+ alignmentPoint = beforeEdge
+ - actualBaselineTable.getBaseline(EN_TEXT_BEFORE_EDGE);
+ } else {
+ alignmentPoint = beforeEdge;
+ }
+ break;
+ case EN_TEXT_BOTTOM:
+ if (isHorizontalWritingMode()) {
+ alignmentPoint = beforeEdge
+ - actualBaselineTable.getBaseline(EN_TEXT_AFTER_EDGE);
+ } else {
+ alignmentPoint = beforeEdge;
+ }
+ break;
+ default:
+ alignmentPoint = beforeEdge
+ + alignmentAdjust.getValue(new SimplePercentBaseContext(null
+ , LengthBase.ALIGNMENT_ADJUST
+ , lineHeight));
+ break;
+ }
+ }
+
+ /**
+ * Return the scaled baseline table for this context.
+ * @return the scaled baseline table
+ */
+ public ScaledBaselineTable getScaledBaselineTable() {
+ return this.scaledBaselineTable;
+ }
+
+ /**
+ * Return the dominant baseline identifier.
+ * @return the dominant baseline identifier
+ */
+ public int getDominantBaselineIdentifier() {
+ return scaledBaselineTable.getDominantBaselineIdentifier();
+ }
+
+ /**
+ * Return the writing mode.
+ * @return the writing mode
+ */
+ public int getWritingMode() {
+ return scaledBaselineTable.getWritingMode();
+ }
+
+ /**
+ * Calculates the baseline shift value based on the baseline-shift
+ * property value.
+ * @param baselineShift the baseline shift property value
+ * @return the computed baseline shift value
+ */
+ private void setBaselineShift(Length baselineShift) {
+ baselineShiftValue = 0;
+ ScaledBaselineTable sbt = null;
+ switch (baselineShift.getEnum()) {
+ case EN_BASELINE: //Nothing to do
+ break;
+ case EN_SUB:
+ baselineShiftValue = Math.round(-(xHeight / 2)
+ + parentAlignmentContext.getActualBaselineOffset(EN_ALPHABETIC)
+ );
+ break;
+ case EN_SUPER:
+ baselineShiftValue = Math.round(parentAlignmentContext.getXHeight()
+ + parentAlignmentContext.getActualBaselineOffset(EN_ALPHABETIC)
+ );
+ break;
+ case 0: // A <length> or <percentage> value
+ baselineShiftValue = baselineShift.getValue(
+ new SimplePercentBaseContext(null
+ , LengthBase.CUSTOM_BASE
+ , parentAlignmentContext.getLineHeight()));
+ break;
+ }
+ }
+
+ /**
+ * Return the parent alignment context.
+ * @return the parent alignment context
+ */
+ public AlignmentContext getParentAlignmentContext() {
+ return parentAlignmentContext;
+ }
+
+ /**
+ * Return the offset between the current dominant baseline and
+ * the parent dominant baseline.
+ * @return the offset in shift direction
+ */
+ public int getBaselineOffset() {
+ if (parentAlignmentContext == null) {
+ return 0;
+ }
+ return parentAlignmentContext.getScaledBaselineTable()
+ .getBaseline(alignmentBaselineIdentifier)
+ - scaledBaselineTable
+ .deriveScaledBaselineTable(parentAlignmentContext.getDominantBaselineIdentifier())
+ .getBaseline(alignmentBaselineIdentifier)
+ - scaledBaselineTable
+ .getBaseline(parentAlignmentContext.getDominantBaselineIdentifier())
+ + baselineShiftValue;
+ }
+
+ /**
+ * Return the offset between the current dominant baseline and
+ * the outermost parent dominant baseline.
+ * @return the offet in shift direction
+ */
+ public int getTotalBaselineOffset() {
+ int offset = 0;
+ if (parentAlignmentContext != null) {
+ offset = getBaselineOffset() + parentAlignmentContext.getTotalBaselineOffset();
+ }
+ return offset;
+ }
+
+ /**
+ * Return the offset between the alignment baseline and
+ * the outermost parent dominant baseline.
+ * @return the offset in shift direction
+ */
+ public int getTotalAlignmentBaselineOffset() {
+ return getTotalAlignmentBaselineOffset(alignmentBaselineIdentifier);
+ }
+
+ /**
+ * Return the offset between the given alignment baseline and
+ * the outermost parent dominant baseline.
+ * @param alignmentBaselineId the alignment baseline
+ * @return the offset
+ */
+ public int getTotalAlignmentBaselineOffset(int alignmentBaselineId) {
+ int offset = baselineShiftValue;
+ if (parentAlignmentContext != null) {
+ offset = parentAlignmentContext.getTotalBaselineOffset()
+ + parentAlignmentContext.getScaledBaselineTable()
+ .getBaseline(alignmentBaselineId)
+ + baselineShiftValue;
+ }
+ return offset;
+ }
+
+ /**
+ * Return the offset between the dominant baseline and
+ * the given actual baseline
+ * @param baselineIdentifier the baseline
+ * @return the offset
+ */
+ public int getActualBaselineOffset(int baselineIdentifier) {
+ // This is the offset from the dominant baseline to the alignment baseline
+ int offset = getTotalAlignmentBaselineOffset() - getTotalBaselineOffset();
+ // Add the offset to the actual baseline we want
+ offset += actualBaselineTable.deriveScaledBaselineTable(alignmentBaselineIdentifier)
+ .getBaseline(baselineIdentifier);
+ return offset;
+ }
+
+ /**
+ * Return the offset the outermost parent dominant baseline
+ * and the top of this box.
+ * @return the offset
+ */
+ private int getTotalTopOffset() {
+ int offset = getTotalAlignmentBaselineOffset() + getAltitude();
+ return offset;
+ }
+
+ /**
+ * Return the total height of the context.
+ * @return the height
+ */
+ public int getHeight() {
+ return areaHeight;
+ }
+
+ /**
+ * Return the line height of the context.
+ * @return the height
+ */
+ public int getLineHeight() {
+ return lineHeight;
+ }
+
+ /**
+ * The altitude of the context that is the height above the
+ * alignment point.
+ * @return the altitude
+ */
+ public int getAltitude() {
+ return alignmentPoint;
+ }
+
+ /**
+ * The depth of the context that is the height below
+ * alignment point.
+ * @return the altitude
+ */
+ public int getDepth() {
+ return getHeight() - alignmentPoint;
+ }
+
+ /**
+ * The x height of the context.
+ * @return the x height
+ */
+ public int getXHeight() {
+ return this.xHeight;
+ }
+
+ /**
+ * Resizes the line as specified. Assumes that the new alignment point
+ * is on the dominant baseline, that is this function should be called for
+ * line areas only.
+ * @param newLineHeight the new height of the line
+ * @param newAlignmentPoint the new alignment point
+ */
+ public void resizeLine(int newLineHeight, int newAlignmentPoint) {
+ areaHeight = newLineHeight;
+ alignmentPoint = newAlignmentPoint;
+ scaledBaselineTable.setBeforeAndAfterBaselines(alignmentPoint
+ , alignmentPoint - areaHeight);
+ }
+
+ /**
+ * Returns the offset from the before-edge of the parent to
+ * this context.
+ * @return the offset for rendering
+ */
+ public int getOffset() {
+ int offset = 0;
+ if (parentAlignmentContext != null) {
+ offset = parentAlignmentContext.getTotalTopOffset() - getTotalTopOffset();
+ } else {
+ offset = getAltitude() - scaledBaselineTable.getBaseline(EN_TEXT_BEFORE_EDGE);
+ }
+ return offset;
+ }
+
+ /**
+ * Returns an indication if we still use the initial baseline table.
+ * The initial baseline table is the table generated by the Line LM.
+ * @return true if this is still the initial baseline table
+ */
+ public boolean usesInitialBaselineTable() {
+ return parentAlignmentContext == null
+ || (scaledBaselineTable == parentAlignmentContext.getScaledBaselineTable()
+ && parentAlignmentContext.usesInitialBaselineTable());
+ }
+
+ private boolean isHorizontalWritingMode() {
+ return (getWritingMode() == EN_LR_TB || getWritingMode() == EN_RL_TB);
+ }
+
+ /** @see java.lang.Object#toString() */
+ public String toString() {
+ StringBuffer sb = new StringBuffer(64);
+ sb.append("ah=" + areaHeight);
+ sb.append(" lp=" + lineHeight);
+ sb.append(" ap=" + alignmentPoint);
+ sb.append(" ab=" + alignmentBaselineIdentifier);
+ sb.append(" bs=" + baselineShiftValue);
+ return sb.toString();
+ }
+
+}
--- /dev/null
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.inline;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.LengthBase;
+import org.apache.fop.datatypes.SimplePercentBaseContext;
+import org.apache.fop.fo.Constants;
+
+
+/**
+ * An implementation of the ScaledBaselineTable interface which calculates
+ * all baselines given the height above and below the dominant baseline.
+ */
+public class BasicScaledBaselineTable implements ScaledBaselineTable, Constants {
+
+ /** A logger for this class */
+ protected Log log = LogFactory.getLog(BasicScaledBaselineTable.class);
+
+ private int altitude;
+ private int depth;
+ private int xHeight;
+ private int dominantBaselineIdentifier;
+ private int writingMode;
+ private int dominantBaselineOffset;
+ private int beforeEdgeOffset;
+ private int afterEdgeOffset;
+
+ private static final float HANGING_BASELINE_FACTOR = 0.8f;
+ private static final float MATHEMATICAL_BASELINE_FACTOR = 0.5f;
+
+ /**
+ *
+ * Creates a new instance of BasicScaledBaselineTable for the given
+ * altitude, depth, xHeight, baseline and writingmode.
+ * @param altitude the height of the box or the font ascender
+ * @param depth the font descender or 0
+ * @param xHeight the font xHeight
+ * @param dominantBaselineIdentifier the dominant baseline given as an integer constant
+ * @param writingMode the writing mode given as an integer constant
+ */
+ public BasicScaledBaselineTable(int altitude
+ , int depth
+ , int xHeight
+ , int dominantBaselineIdentifier
+ , int writingMode) {
+ this.altitude = altitude;
+ this.depth = depth;
+ this.xHeight = xHeight;
+ this.dominantBaselineIdentifier = dominantBaselineIdentifier;
+ this.writingMode = writingMode;
+ this.dominantBaselineOffset = getBaselineDefaultOffset(this.dominantBaselineIdentifier);
+ this.beforeEdgeOffset = altitude - dominantBaselineOffset;
+ this.afterEdgeOffset = depth - dominantBaselineOffset;
+ }
+
+ /**
+ * Return the dominant baseline for this baseline table.
+ * @return the dominant baseline
+ */
+ public int getDominantBaselineIdentifier() {
+ return this.dominantBaselineIdentifier;
+ }
+
+ /**
+ * Return the writing mode for this baseline table.
+ * @return the writing mode
+ */
+ public int getWritingMode() {
+ return this.writingMode;
+ }
+
+ /**
+ * Return the baseline offset measured from the dominant
+ * baseline for the given baseline.
+ * @param baselineIdentifier the baseline identifier
+ * @return the baseline offset
+ */
+ public int getBaseline(int baselineIdentifier) {
+ int offset = 0;
+ if (!isHorizontalWritingMode()) {
+ switch (baselineIdentifier) {
+ case EN_TOP:
+ case EN_TEXT_TOP:
+ case EN_TEXT_BOTTOM:
+ case EN_BOTTOM:
+ log.warn("The given baseline is only supported for horizontal"
+ + " writing modes");
+ return 0;
+ }
+ }
+ switch (baselineIdentifier) {
+ case EN_TOP: // fall through
+ case EN_BEFORE_EDGE:
+ offset = beforeEdgeOffset;
+ break;
+ case EN_TEXT_TOP:
+ case EN_TEXT_BEFORE_EDGE:
+ case EN_HANGING:
+ case EN_CENTRAL:
+ case EN_MIDDLE:
+ case EN_MATHEMATICAL:
+ case EN_ALPHABETIC:
+ case EN_IDEOGRAPHIC:
+ case EN_TEXT_BOTTOM:
+ case EN_TEXT_AFTER_EDGE:
+ offset = getBaselineDefaultOffset(baselineIdentifier) - dominantBaselineOffset;
+ break;
+ case EN_BOTTOM: // fall through
+ case EN_AFTER_EDGE:
+ offset = afterEdgeOffset;
+ break;
+ }
+ return offset;
+ }
+
+ private boolean isHorizontalWritingMode() {
+ return writingMode == EN_LR_TB || writingMode == EN_RL_TB;
+ }
+
+ /**
+ * Return the baseline offset measured from the font's default
+ * baseline for the given baseline.
+ * @param baselineIdentifier the baseline identifier
+ * @return the baseline offset
+ */
+ private int getBaselineDefaultOffset(int baselineIdentifier) {
+ int offset = 0;
+ switch (baselineIdentifier) {
+ case EN_TEXT_BEFORE_EDGE:
+ offset = altitude;
+ break;
+ case EN_HANGING:
+ offset = (int)Math.round(altitude * HANGING_BASELINE_FACTOR);
+ break;
+ case EN_CENTRAL:
+ offset = (altitude - depth) / 2 + depth;
+ break;
+ case EN_MIDDLE:
+ offset = xHeight / 2;
+ break;
+ case EN_MATHEMATICAL:
+ offset = (int)Math.round(altitude * MATHEMATICAL_BASELINE_FACTOR);
+ break;
+ case EN_ALPHABETIC:
+ offset = 0;
+ break;
+ case EN_IDEOGRAPHIC: // Fall through
+ case EN_TEXT_AFTER_EDGE:
+ offset = depth;
+ break;
+ }
+ return offset;
+ }
+
+ /**
+ * @see ScaledBaselineTable#setBeforeAndAfterBaselines(int, int)
+ */
+ public void setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline) {
+ beforeEdgeOffset = beforeBaseline;
+ afterEdgeOffset = afterBaseline;
+ }
+
+ /**
+ * @see ScaledBaselineTable#getScaledBaselineTable(int)
+ */
+ public ScaledBaselineTable deriveScaledBaselineTable(int baselineIdentifier) {
+ BasicScaledBaselineTable bac
+ = new BasicScaledBaselineTable(altitude, depth, xHeight
+ , baselineIdentifier, this.writingMode);
+ return bac;
+ }
+
+}
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.TraitSetter;
-import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.Trait;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
import java.util.List;
import java.util.LinkedList;
+import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
+import org.apache.fop.layoutmgr.inline.AlignmentContext;
+import org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager.AreaInfo;
/**
* LayoutManager for the fo:character formatting object
private Character fobj;
private MinOptMax letterSpaceIPD;
private int hyphIPD;
- private Font fs;
+ private Font font;
+ private CommonBorderPaddingBackground borderProps = null;
/**
* Constructor
fobj = node;
}
+ /** @see LayoutManager#initialize */
public void initialize() {
- InlineArea inline = getCharacterInlineArea(fobj);
- setCurrentArea(inline);
-
- setAlignment(fobj.getVerticalAlign());
- fs = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
-
+ font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
SpaceVal ls = SpaceVal.makeLetterSpacing(fobj.getLetterSpacing());
letterSpaceIPD = ls.getSpace();
- hyphIPD = fs.getCharWidth(fobj.getCommonHyphenation().hyphenationCharacter);
+ hyphIPD = font.getCharWidth(fobj.getCommonHyphenation().hyphenationCharacter);
+ borderProps = fobj.getCommonBorderPaddingBackground();
+ setCommonBorderPaddingBackground(borderProps);
+ org.apache.fop.area.inline.Character chArea = getCharacterInlineArea(fobj);
+ chArea.setBaselineOffset(font.getAscender());
+ setCurrentArea(chArea);
}
- private InlineArea getCharacterInlineArea(Character node) {
- org.apache.fop.area.inline.Character ch =
- new org.apache.fop.area.inline.Character(node.getCharacter());
+ private org.apache.fop.area.inline.Character getCharacterInlineArea(Character node) {
+ org.apache.fop.area.inline.Character ch
+ = new org.apache.fop.area.inline.Character(node.getCharacter());
TraitSetter.setProducerID(ch, node.getId());
TraitSetter.addTextDecoration(ch, fobj.getTextDecoration());
return ch;
}
- /**
- * Offset this area.
- * Offset the inline area in the bpd direction when adding the
- * inline area.
- * This is used for vertical alignment.
- * Subclasses should override this if necessary.
- * @param area the inline area to be updated
- * @param context the layout context used for adding the area
- */
- protected void offsetArea(InlineArea area, LayoutContext context) {
- int bpd = area.getBPD();
- switch (verticalAlignment) {
- case EN_MIDDLE:
- area.setOffset(context.getMiddleBaseline() + fs.getXHeight() / 2);
- break;
- case EN_TOP:
- area.setOffset(fs.getAscender());
- break;
- case EN_BOTTOM:
- area.setOffset(context.getLineHeight() - bpd + fs.getAscender());
- break;
- case EN_BASELINE:
- default:
- area.setOffset(context.getBaseline());
- break;
- }
- }
-
- public LinkedList getNextKnuthElements(LayoutContext context,
- int alignment) {
+ /** @see LayoutManager#getNextKnuthElements(LayoutContext, int) */
+ public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
MinOptMax ipd;
curArea = get(context);
KnuthSequence seq = new KnuthSequence(true);
return null;
}
- ipd = new MinOptMax(fs.getCharWidth(((org.apache.fop.area.inline.Character) curArea).getChar().charAt(0)));
+ ipd = new MinOptMax(font.getCharWidth(fobj.getCharacter()));
curArea.setIPD(ipd.opt);
- curArea.setBPD(fs.getAscender() - fs.getDescender());
+ curArea.setBPD(font.getAscender() - font.getDescender());
- // offset is set in the offsetArea() method
- //curArea.setOffset(textInfo.fs.getAscender());
- //curArea.setOffset(context.getBaseline());
-
- curArea.addTrait(Trait.FONT_NAME, fs.getFontName());
- curArea.addTrait(Trait.FONT_SIZE, new Integer(fs.getFontSize()));
+ curArea.addTrait(Trait.FONT_NAME, font.getFontName());
+ curArea.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
curArea.addTrait(Trait.COLOR, fobj.getColor());
- int bpd = curArea.getBPD();
- int lead = 0;
- int total = 0;
- int middle = 0;
- switch (verticalAlignment) {
- case EN_MIDDLE : middle = bpd / 2 ;
- break;
- case EN_TOP : // fall through
- case EN_BOTTOM : total = bpd;
- break;
- case EN_BASELINE: // fall through
- default : lead = fs.getAscender();
- total = bpd;
- break;
- }
+ // TODO: may need some special handling for fo:character
+ alignmentContext = new AlignmentContext(font
+ , font.getFontSize()
+ , fobj.getAlignmentAdjust()
+ , fobj.getAlignmentBaseline()
+ , fobj.getBaselineShift()
+ , fobj.getDominantBaseline()
+ , context.getAlignmentContext());
+ addKnuthElementsForBorderPaddingStart(seq);
+
// create the AreaInfo object to store the computed values
- areaInfo = new AreaInfo((short) 0, ipd, false,
- lead, total, middle);
+ areaInfo = new AreaInfo((short) 0, ipd, false, alignmentContext);
// node is a fo:Character
if (letterSpaceIPD.min == letterSpaceIPD.max) {
// constant letter space, only return a box
- seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
- areaInfo.total, areaInfo.middle,
- new LeafPosition(this, 0), false));
+ seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
+ notifyPos(new LeafPosition(this, 0)), false));
} else {
// adjustable letter space, return a sequence of elements;
// at the moment the character is supposed to have no letter spaces,
// but returning this sequence allows us to change only one element
// if addALetterSpaceTo() is called
- seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
- areaInfo.total, areaInfo.middle,
- new LeafPosition(this, 0), false));
+ seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
+ notifyPos(new LeafPosition(this, 0)), false));
seq.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new LeafPosition(this, -1), true));
seq.add(new KnuthGlue(0, 0, 0,
new LeafPosition(this, -1), true));
- seq.add(new KnuthInlineBox(0, 0, 0, 0,
- new LeafPosition(this, -1), true));
+ seq.add(new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), true));
}
+ addKnuthElementsForBorderPaddingEnd(seq);
+
LinkedList returnList = new LinkedList();
returnList.add(seq);
setFinished(true);
return returnList;
}
+ /** @see InlineLevelLayoutManager#getWordChars(StringBuffer, Position) */
public void getWordChars(StringBuffer sbChars, Position bp) {
sbChars.append
(((org.apache.fop.area.inline.Character) curArea).getChar());
}
+ /** @see InlineLevelLayoutManager#hyphenate(Position, HyphContext) */
public void hyphenate(Position pos, HyphContext hc) {
if (hc.getNextHyphPoint() == 1) {
// the character ends a syllable
areaInfo.bHyphenated = true;
- bSomethingChanged = true;
+ isSomethingChanged = true;
} else {
// hc.getNextHyphPoint() returned -1 (no more hyphenation points)
// or a number > 1;
hc.updateOffset(1);
}
+ /** @see InlineLevelLayoutManager#applyChanges(list) */
public boolean applyChanges(List oldList) {
setFinished(false);
- if (bSomethingChanged) {
+ if (isSomethingChanged) {
// there is nothing to do,
// possible changes have already been applied
// in the hyphenate() method
}
}
- public LinkedList getChangedKnuthElements(List oldList,
- int flaggedPenalty,
- int alignment) {
+ /** @see LayoutManager#getChangedKnuthElements(List, int) */
+ public LinkedList getChangedKnuthElements(List oldList, int alignment) {
if (isFinished()) {
return null;
}
LinkedList returnList = new LinkedList();
+ addKnuthElementsForBorderPaddingStart(returnList);
+
if (letterSpaceIPD.min == letterSpaceIPD.max
|| areaInfo.iLScount == 0) {
// constant letter space, or no letter space
- returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
- areaInfo.total, areaInfo.middle,
- new LeafPosition(this, 0), false));
+ returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt,
+ areaInfo.alignmentContext,
+ notifyPos(new LeafPosition(this, 0)), false));
if (areaInfo.bHyphenated) {
returnList.add
- (new KnuthPenalty(hyphIPD, flaggedPenalty, true,
+ (new KnuthPenalty(hyphIPD, KnuthPenalty.FLAGGED_PENALTY, true,
new LeafPosition(this, -1), false));
}
} else {
returnList.add
(new KnuthInlineBox(areaInfo.ipdArea.opt
- areaInfo.iLScount * letterSpaceIPD.opt,
- areaInfo.lead, areaInfo.total, areaInfo.middle,
- new LeafPosition(this, 0), false));
+ areaInfo.alignmentContext,
+ notifyPos(new LeafPosition(this, 0)), false));
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new LeafPosition(this, -1), true));
returnList.add
areaInfo.iLScount * letterSpaceIPD.max - letterSpaceIPD.opt,
areaInfo.iLScount * letterSpaceIPD.opt - letterSpaceIPD.min,
new LeafPosition(this, -1), true));
- returnList.add(new KnuthInlineBox(0, 0, 0, 0,
- new LeafPosition(this, -1), true));
+ returnList.add(new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), true));
if (areaInfo.bHyphenated) {
returnList.add
- (new KnuthPenalty(hyphIPD, flaggedPenalty, true,
+ (new KnuthPenalty(hyphIPD, KnuthPenalty.FLAGGED_PENALTY, true,
new LeafPosition(this, -1), false));
}
}
+ addKnuthElementsForBorderPaddingEnd(returnList);
+
setFinished(true);
return returnList;
}
+ /** @see LeafNodeLayoutManager#addId */
protected void addId() {
getPSLM().addIDToPage(fobj.getId());
}
+
}
ListIterator contentIter = contentList.listIterator();
while (contentIter.hasNext()) {
KnuthElement element = (KnuthElement) contentIter.next();
- if (element.isBox()) {
+ if (element instanceof KnuthInlineBox) {
KnuthInlineBox box = (KnuthInlineBox) element;
- if (box.getLead() > lineLead) {
- lineLead = box.getLead();
- }
- if (box.getTotal() > maxtb) {
- maxtb = box.getTotal();
- }
- // Is this needed? cf. LineLM.makeLineBreakPosition
- // if (box.getMiddle() > lineLead) {
- // lineLead = box.getMiddle();
- // }
- if (box.getMiddle() > middlefollow) {
- middlefollow = box.getMiddle();
- }
+ // TODO handle alignment here?
}
}
}
LayoutContext lc = new LayoutContext(0);
- lc.setBaseline(lineLead);
- lc.setLineHeight(lineHeight);
lc.setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true);
lc.setLeadingSpace(new SpaceSpecifier(false));
//Inline part of the footnote is empty. Need to send back an auxiliary
//zero-width, zero-height inline box so the footnote gets painted.
KnuthSequence seq = new KnuthSequence(true);
- seq.add(new KnuthInlineBox(0, 0, 0, 0, null, true));
+ seq.add(new KnuthInlineBox(0, null, null, true));
returnedList.add(seq);
}
setFinished(true);
import java.util.ListIterator;
import java.util.LinkedList;
+import java.util.List;
import org.apache.fop.area.Area;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.InlineBlockParent;
import org.apache.fop.area.inline.InlineParent;
+import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.InlineLevel;
+import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonMarginInline;
import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.fonts.Font;
+import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.KnuthElement;
import org.apache.fop.layoutmgr.KnuthSequence;
import org.apache.fop.layoutmgr.KnuthPenalty;
import org.apache.fop.layoutmgr.SpaceSpecifier;
import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.PositionIterator;
+import org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager.StackingIter;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
* LayoutManager for objects which stack children in the inline direction,
* such as Inline or Line
*/
-public class InlineLayoutManager extends InlineStackingLayoutManager
- implements InlineLevelLayoutManager {
+public class InlineLayoutManager extends InlineStackingLayoutManager {
private InlineLevel fobj;
private CommonMarginInline inlineProps = null;
private boolean areaCreated = false;
private LayoutManager lastChildLM = null; // Set when return last breakposs;
+ private Position auxiliaryPosition;
+
+ private Font font;
+
+ /** The alignment adjust property */
+ protected Length alignmentAdjust;
+ /** The alignment baseline property */
+ protected int alignmentBaseline = EN_BASELINE;
+ /** The baseline shift property */
+ protected Length baselineShift;
+ /** The dominant baseline property */
+ protected int dominantBaseline;
+ /** The line height property */
+ protected SpaceProperty lineHeight;
+
+ private AlignmentContext alignmentContext = null;
+
/**
* Create an inline layout manager.
* This is used for fo's that create areas that
return (Inline)fobj;
}
+ /** @see LayoutManager#initialize */
public void initialize() {
inlineProps = fobj.getCommonMarginInline();
borderProps = fobj.getCommonBorderPaddingBackground();
padding += borderProps.getPadding(CommonBorderPaddingBackground.AFTER, false, this);
padding += borderProps.getBorderWidth(CommonBorderPaddingBackground.AFTER, false);
extraBPD = new MinOptMax(padding);
+ font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
+ lineHeight = fobj.getLineHeight();
+ if (fobj instanceof Inline) {
+ alignmentAdjust = ((Inline)fobj).getAlignmentAdjust();
+ alignmentBaseline = ((Inline)fobj).getAlignmentBaseline();
+ baselineShift = ((Inline)fobj).getBaselineShift();
+ dominantBaseline = ((Inline)fobj).getDominantBaseline();
+ } else if (fobj instanceof Leader) {
+ alignmentAdjust = ((Leader)fobj).getAlignmentAdjust();
+ alignmentBaseline = ((Leader)fobj).getAlignmentBaseline();
+ baselineShift = ((Leader)fobj).getBaselineShift();
+ dominantBaseline = ((Leader)fobj).getDominantBaseline();
+ }
+
}
+ /** @see InlineStackingLayoutManager#getExtraIPD(boolean, boolean) */
protected MinOptMax getExtraIPD(boolean isNotFirst, boolean isNotLast) {
- int borderAndPadding = borderProps.getPadding(CommonBorderPaddingBackground.START,
- isNotFirst, this);
- borderAndPadding += borderProps.getBorderWidth(CommonBorderPaddingBackground.START,
- isNotFirst);
- borderAndPadding += borderProps.getPadding(CommonBorderPaddingBackground.END, isNotLast, this);
- borderAndPadding += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, isNotLast);
+ int borderAndPadding
+ = borderProps.getPadding(CommonBorderPaddingBackground.START, isNotFirst, this);
+ borderAndPadding
+ += borderProps.getBorderWidth(CommonBorderPaddingBackground.START, isNotFirst);
+ borderAndPadding
+ += borderProps.getPadding(CommonBorderPaddingBackground.END, isNotLast, this);
+ borderAndPadding
+ += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, isNotLast);
return new MinOptMax(borderAndPadding);
}
+ /** @see InlineStackingLayoutManager#hasLeadingFence(boolean) */
protected boolean hasLeadingFence(boolean isNotFirst) {
- return borderProps.getPadding(CommonBorderPaddingBackground.START, isNotFirst, this)>0
- || borderProps.getBorderWidth(CommonBorderPaddingBackground.START, isNotFirst)>0;
+ return borderProps.getPadding(CommonBorderPaddingBackground.START, isNotFirst, this) > 0
+ || borderProps.getBorderWidth(CommonBorderPaddingBackground.START, isNotFirst) > 0;
}
+ /** @see InlineStackingLayoutManager#hasTrailingFence(boolean) */
protected boolean hasTrailingFence(boolean isNotLast) {
- return borderProps.getPadding(CommonBorderPaddingBackground.END, isNotLast, this)>0
- || borderProps.getBorderWidth(CommonBorderPaddingBackground.END, isNotLast)>0;
+ return borderProps.getPadding(CommonBorderPaddingBackground.END, isNotLast, this) > 0
+ || borderProps.getBorderWidth(CommonBorderPaddingBackground.END, isNotLast) > 0;
}
+ /** @see InlineStackingLayoutManager#getSpaceStart */
protected SpaceProperty getSpaceStart() {
return inlineProps.spaceStart;
}
+ /** @see InlineStackingLayoutManager#getSpaceEnd */
protected SpaceProperty getSpaceEnd() {
return inlineProps.spaceEnd;
}
* @see org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager#setTraits(boolean, boolean)
*/
protected void setTraits(boolean isNotFirst, boolean isNotLast) {
-
- // Add border and padding to current area and set flags (FIRST, LAST ...)
- TraitSetter.setBorderPaddingTraits(getCurrentArea(),
- borderProps, isNotFirst, isNotLast, this);
-
if (borderProps != null) {
- TraitSetter.addBorders(getCurrentArea(), borderProps, this);
+ // Add border and padding to current area and set flags (FIRST, LAST ...)
+ TraitSetter.setBorderPaddingTraits(getCurrentArea(),
+ borderProps, isNotFirst, isNotLast, this);
TraitSetter.addBackground(getCurrentArea(), borderProps, this);
}
}
/** @see org.apache.fop.layoutmgr.LayoutManager */
- public LinkedList getNextKnuthElements(LayoutContext lc, int alignment) {
+ public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
InlineLevelLayoutManager curILM;
LayoutManager curLM, lastLM = null;
LinkedList returnList = new LinkedList();
KnuthSequence lastSequence = null;
- SpaceSpecifier leadingSpace = lc.getLeadingSpace();
-
- if (lc.startsNewArea()) {
+ SpaceSpecifier leadingSpace = context.getLeadingSpace();
+
+ alignmentContext = new AlignmentContext(font
+ , lineHeight.getOptimum(this).getLength().getValue(this)
+ , alignmentAdjust
+ , alignmentBaseline
+ , baselineShift
+ , dominantBaseline
+ , context.getAlignmentContext());
+
+ childLC = new LayoutContext(context);
+ childLC.setAlignmentContext(alignmentContext);
+
+ if (context.startsNewArea()) {
// First call to this LM in new parent "area", but this may
// not be the first area created by this inline
- childLC = new LayoutContext(lc);
if (getSpaceStart() != null) {
- lc.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart(), this));
+ context.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart(), this));
}
// Check for "fence"
- if (hasLeadingFence(!lc.isFirstArea())) {
+ if (hasLeadingFence(!context.isFirstArea())) {
// Reset leading space sequence for child areas
leadingSpace = new SpaceSpecifier(false);
}
StringBuffer trace = new StringBuffer("InlineLM:");
+ // We'll add the border to the first inline sequence created.
+ // This flag makes sure we do it only once.
+ boolean borderAdded = false;
+
+ if (borderProps != null) {
+ childLC.setLineStartBorderAndPaddingWidth(context.getLineStartBorderAndPaddingWidth()
+ + borderProps.getPadding(CommonBorderPaddingBackground.START, true, this)
+ + borderProps.getBorderWidth(CommonBorderPaddingBackground.START, true)
+ );
+ childLC.setLineEndBorderAndPaddingWidth(context.getLineEndBorderAndPaddingWidth()
+ + borderProps.getPadding(CommonBorderPaddingBackground.END, true, this)
+ + borderProps.getBorderWidth(CommonBorderPaddingBackground.END, true)
+ );
+ }
+
while ((curLM = (LayoutManager) getChildLM()) != null) {
+ if (!(curLM instanceof InlineLevelLayoutManager)) {
+ // A block LM
+ // Leave room for start/end border and padding
+ if (borderProps != null) {
+ childLC.setRefIPD(childLC.getRefIPD()
+ - borderProps.getIPPaddingAndBorder(false, this));
+ }
+ }
// get KnuthElements from curLM
- returnedList = curLM.getNextKnuthElements(lc, alignment);
+ returnedList = curLM.getNextKnuthElements(childLC, alignment);
if (returnedList == null) {
// curLM returned null because it finished;
// just iterate once more to see if there is another child
while (listIter.hasNext()) {
returnedElement = (KnuthElement) listIter.next();
returnedElement.setPosition
- (new NonLeafPosition(this,
- returnedElement.getPosition()));
+ (notifyPos(new NonLeafPosition(this,
+ returnedElement.getPosition())));
}
if (!sequence.isInlineSequence()) {
if (lastSequence != null && lastSequence.isInlineSequence()) {
- // log.error("Last inline sequence should be closed before a block sequence");
+ // log.error("Last inline sequence should be closed before"
+ // + " a block sequence");
lastSequence.add(new KnuthPenalty(0, -KnuthElement.INFINITE,
false, null, false));
lastSequence = null;
if (lastSequence == null) {
lastSequence = new KnuthSequence(true);
returnList.add(lastSequence);
+ if (!borderAdded) {
+ addKnuthElementsForBorderPaddingStart(lastSequence);
+ borderAdded = true;
+ }
if (log.isTraceEnabled()) {
trace.append(" [");
}
if (log.isTraceEnabled()) {
trace.append(" [");
}
+ if (!borderAdded) {
+ addKnuthElementsForBorderPaddingStart(lastSequence);
+ borderAdded = true;
+ }
} else {
if (log.isTraceEnabled()) {
trace.append(" +");
while (iter.hasNext()) {
KnuthElement element = (KnuthElement) iter.next();
element.setPosition
- (new NonLeafPosition(this,
- element.getPosition()));
+ (notifyPos(new NonLeafPosition(this,
+ element.getPosition())));
}
lastSequence.addAll(returnedList);
if (log.isTraceEnabled()) {
trace.append(" L");
}
}
+ lastChildLM = curLM;
}
+
+ if (lastSequence != null) {
+ addKnuthElementsForBorderPaddingEnd(lastSequence);
+ }
+
setFinished(true);
log.trace(trace);
return returnList.size() == 0 ? null : returnList;
*/
public void addAreas(PositionIterator parentIter,
LayoutContext context) {
+
+ Position lastPos = null;
+
addId();
setChildContext(new LayoutContext(context)); // Store current value
LayoutManager lastLM = null; // last child LM in this iterator
while (parentIter.hasNext()) {
pos = (NonLeafPosition) parentIter.next();
- positionList.add(pos.getPosition());
+ if (pos.getPosition() != null) {
+ positionList.add(pos.getPosition());
+ lastLM = pos.getPosition().getLM();
+ lastPos = pos;
+ }
}
- if (pos != null) {
+ /*if (pos != null) {
lastLM = pos.getPosition().getLM();
- }
+ }*/
- InlineArea parent = createArea(lastLM == null || lastLM instanceof InlineLevelLayoutManager);
- parent.setBPD(context.getLineHeight());
+ InlineArea parent = createArea(lastLM == null
+ || lastLM instanceof InlineLevelLayoutManager);
+ parent.setBPD(alignmentContext.getHeight());
+ if (parent instanceof InlineParent) {
+ parent.setOffset(alignmentContext.getOffset());
+ }
setCurrentArea(parent);
StackingIter childPosIter
context.getTrailingSpace().addSpace(new SpaceVal(getSpaceEnd(), this));
}
+ setTraits(areaCreated, !isLast(lastPos));
parentLM.addChildArea(getCurrentArea());
- setTraits(areaCreated, !isLast);
context.setFlags(LayoutContext.LAST_AREA, isLast);
areaCreated = true;
}
+ /** @see LayoutManager#addChildArea(Area) */
public void addChildArea(Area childArea) {
Area parent = getCurrentArea();
if (getContext().resolveLeadingSpace()) {
parent.addChildArea(childArea);
}
- /*
- public KnuthElement addALetterSpaceTo(KnuthElement element) {
- NonLeafPosition savedPos = (NonLeafPosition) element.getPosition();
- element.setPosition(savedPos.getPosition());
-
- KnuthElement newElement
- = ((InlineLevelLayoutManager)
- element.getLayoutManager()).addALetterSpaceTo(element);
- newElement.setPosition
- (new NonLeafPosition(this, newElement.getPosition()));
- element.setPosition(savedPos);
- return newElement;
- }
-
- public void getWordChars(StringBuffer sbChars, Position pos) {
- Position newPos = ((NonLeafPosition) pos).getPosition();
- ((InlineLevelLayoutManager)
- newPos.getLM()).getWordChars(sbChars, newPos);
- }
-
- public void hyphenate(Position pos, HyphContext hc) {
- Position newPos = ((NonLeafPosition) pos).getPosition();
- ((InlineLevelLayoutManager)
- newPos.getLM()).hyphenate(newPos, hc);
+ /** @see LayoutManager#getChangedKnuthElements(List, int) */
+ public LinkedList getChangedKnuthElements(List oldList, int alignment) {
+ LinkedList returnedList = new LinkedList();
+ addKnuthElementsForBorderPaddingStart(returnedList);
+ returnedList.addAll(super.getChangedKnuthElements(oldList, alignment));
+ addKnuthElementsForBorderPaddingEnd(returnedList);
+ return returnedList;
}
-
- public boolean applyChanges(List oldList) {
- // "unwrap" the Positions stored in the elements
- ListIterator oldListIterator = oldList.listIterator();
- KnuthElement oldElement;
- while (oldListIterator.hasNext()) {
- oldElement = (KnuthElement) oldListIterator.next();
- oldElement.setPosition
- (((NonLeafPosition) oldElement.getPosition()).getPosition());
- }
- // reset the iterator
- oldListIterator = oldList.listIterator();
-
- InlineLevelLayoutManager prevLM = null;
- InlineLevelLayoutManager currLM;
- int fromIndex = 0;
-
- boolean bSomethingChanged = false;
- while(oldListIterator.hasNext()) {
- oldElement = (KnuthElement) oldListIterator.next();
- currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager();
- // initialize prevLM
- if (prevLM == null) {
- prevLM = currLM;
- }
-
- if (currLM != prevLM || !oldListIterator.hasNext()) {
- if (oldListIterator.hasNext()) {
- bSomethingChanged
- = prevLM.applyChanges(oldList.subList(fromIndex, oldListIterator.previousIndex()))
- || bSomethingChanged;
- prevLM = currLM;
- fromIndex = oldListIterator.previousIndex();
- } else if (currLM == prevLM) {
- bSomethingChanged
- = prevLM.applyChanges(oldList.subList(fromIndex, oldList.size()))
- || bSomethingChanged;
- } else {
- bSomethingChanged
- = prevLM.applyChanges(oldList.subList(fromIndex, oldListIterator.previousIndex()))
- || bSomethingChanged;
- bSomethingChanged
- = currLM.applyChanges(oldList.subList(oldListIterator.previousIndex(), oldList.size()))
- || bSomethingChanged;
- }
+
+ /**
+ * Creates Knuth elements for start border padding and adds them to the return list.
+ * @param returnList return list to add the additional elements to
+ */
+ protected void addKnuthElementsForBorderPaddingStart(List returnList) {
+ //Border and Padding (start)
+ CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground();
+ if (borderAndPadding != null) {
+ int ipStart = borderAndPadding.getBorderStartWidth(false)
+ + borderAndPadding.getPaddingStart(false, this);
+ if (ipStart > 0) {
+ returnList.add(new KnuthBox(ipStart, getAuxiliaryPosition(), true));
}
}
-
- // "wrap" again the Positions stored in the elements
- oldListIterator = oldList.listIterator();
- while (oldListIterator.hasNext()) {
- oldElement = (KnuthElement) oldListIterator.next();
- oldElement.setPosition
- (new NonLeafPosition(this, oldElement.getPosition()));
- }
- return bSomethingChanged;
}
- public LinkedList getChangedKnuthElements(List oldList, int flaggedPenalty, int alignment) {
- // "unwrap" the Positions stored in the elements
- ListIterator oldListIterator = oldList.listIterator();
- KnuthElement oldElement;
- while (oldListIterator.hasNext()) {
- oldElement = (KnuthElement) oldListIterator.next();
- oldElement.setPosition
- (((NonLeafPosition) oldElement.getPosition()).getPosition());
- }
- // reset the iterator
- oldListIterator = oldList.listIterator();
-
- KnuthElement returnedElement;
- LinkedList returnedList = new LinkedList();
- LinkedList returnList = new LinkedList();
- InlineLevelLayoutManager prevLM = null;
- InlineLevelLayoutManager currLM;
- int fromIndex = 0;
-
- while(oldListIterator.hasNext()) {
- oldElement = (KnuthElement) oldListIterator.next();
- currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager();
- if (prevLM == null) {
- prevLM = currLM;
- }
-
- if (currLM != prevLM || !oldListIterator.hasNext()) {
- if (oldListIterator.hasNext()) {
- returnedList.addAll
- (prevLM.getChangedKnuthElements
- (oldList.subList(fromIndex,
- oldListIterator.previousIndex()),
- flaggedPenalty, alignment));
- prevLM = currLM;
- fromIndex = oldListIterator.previousIndex();
- } else if (currLM == prevLM) {
- returnedList.addAll
- (prevLM.getChangedKnuthElements
- (oldList.subList(fromIndex, oldList.size()),
- flaggedPenalty, alignment));
- } else {
- returnedList.addAll
- (prevLM.getChangedKnuthElements
- (oldList.subList(fromIndex,
- oldListIterator.previousIndex()),
- flaggedPenalty, alignment));
- returnedList.addAll
- (currLM.getChangedKnuthElements
- (oldList.subList(oldListIterator.previousIndex(),
- oldList.size()),
- flaggedPenalty, alignment));
- }
+ /**
+ * Creates Knuth elements for end border padding and adds them to the return list.
+ * @param returnList return list to add the additional elements to
+ */
+ protected void addKnuthElementsForBorderPaddingEnd(List returnList) {
+ //Border and Padding (after)
+ CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground();
+ if (borderAndPadding != null) {
+ int ipEnd = borderAndPadding.getBorderEndWidth(false)
+ + borderAndPadding.getPaddingEnd(false, this);
+ if (ipEnd > 0) {
+ returnList.add(new KnuthBox(ipEnd, getAuxiliaryPosition(), true));
}
}
+ }
- // "wrap" the Position stored in each element of returnedList
- ListIterator listIter = returnedList.listIterator();
- while (listIter.hasNext()) {
- returnedElement = (KnuthElement) listIter.next();
- returnedElement.setPosition
- (new NonLeafPosition(this, returnedElement.getPosition()));
- returnList.add(returnedElement);
- }
- return returnList;
- }*/
+ /** @return a cached auxiliary Position instance used for things like spaces. */
+ protected Position getAuxiliaryPosition() {
+ //if (this.auxiliaryPosition == null) {
+ //this.auxiliaryPosition = new NonLeafPosition(this, new LeafPosition(this, -1));
+ this.auxiliaryPosition = new NonLeafPosition(this, null);
+ //}
+ return this.auxiliaryPosition;
+ }
/** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#addId() */
protected void addId() {
private Area currentArea; // LineArea or InlineParent
//private BreakPoss prevBP;
+
+ /** The child layout context */
protected LayoutContext childLC;
private boolean bAreaCreated = false;
childLMiter = iter;
}
+ /**
+ * Returns the extra IPD needed for any leading or trailing fences for the
+ * current area.
+ * @param bNotFirst true if not the first area for this layout manager
+ * @param bNotLast true if not the last area for this layout manager
+ * @return the extra IPD as a MinOptMax spec
+ */
protected MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) {
return new MinOptMax(0);
}
+ /**
+ * Indication if the current area has a leading fence.
+ * @param bNotFirst true if not the first area for this layout manager
+ * @return the leading fence flag
+ */
protected boolean hasLeadingFence(boolean bNotFirst) {
return false;
}
+ /**
+ * Indication if the current area has a trailing fence.
+ * @param bNotLast true if not the last area for this layout manager
+ * @return the trailing fence flag
+ */
protected boolean hasTrailingFence(boolean bNotLast) {
return false;
}
+ /**
+ * Get the space at the start of the inline area.
+ * @return the space property describing the space
+ */
protected SpaceProperty getSpaceStart() {
return null;
}
+ /**
+ * Get the space at the end of the inline area.
+ * @return the space property describing the space
+ */
protected SpaceProperty getSpaceEnd() {
return null;
}
// What about prevBP?
}
+ /**
+ * TODO: Explain this method
+ * @param lm ???
+ * @return ???
+ */
protected MinOptMax getPrevIPD(LayoutManager lm) {
return (MinOptMax) hmPrevIPD.get(lm);
}
// Do nothing here, overriden in subclasses that have an 'id' property.
}
+ /**
+ * Returns the current area.
+ * @return the current area
+ */
protected Area getCurrentArea() {
return currentArea;
}
+ /**
+ * Set the current area.
+ * @param area the current area
+ */
protected void setCurrentArea(Area area) {
currentArea = area;
}
+ /**
+ * Trait setter to be overridden by subclasses.
+ * @param bNotFirst true if this is not the first child area added
+ * @param bNotLast true if this is not the last child area added
+ */
protected void setTraits(boolean bNotFirst, boolean bNotLast) {
-
}
+ /**
+ * Set the current child layout context
+ * @param lc the child layout context
+ */
protected void setChildContext(LayoutContext lc) {
childLC = lc;
}
- // Current child layout context
+ /**
+ * Current child layout context
+ * @return the current child layout context
+ */
protected LayoutContext getContext() {
return childLC;
}
+ /**
+ * Adds a space to the area
+ * @param parentArea the area to which to add the space
+ * @param spaceRange the space range specifier
+ * @param dSpaceAdjust the factor by which to stretch or shrink the space
+ */
protected void addSpace(Area parentArea, MinOptMax spaceRange,
double dSpaceAdjust) {
if (spaceRange != null) {
}
}
+ /** @see InlineLevelLayoutManager#addALetterSpaceTo(List) */
public List addALetterSpaceTo(List oldList) {
// old list contains only a box, or the sequence: box penalty glue box
oldListIterator = oldList.listIterator();
while (oldListIterator.hasNext()) {
element = (KnuthElement) oldListIterator.next();
- element.setPosition(new NonLeafPosition(this, element.getPosition()));
+ element.setPosition(notifyPos(new NonLeafPosition(this, element.getPosition())));
}
return oldList;
}
+ /** @see InlineLevelLayoutManager#getWordChars(StringBuffer, Position) */
public void getWordChars(StringBuffer sbChars, Position pos) {
Position newPos = ((NonLeafPosition) pos).getPosition();
((InlineLevelLayoutManager)
newPos.getLM()).getWordChars(sbChars, newPos);
}
+ /** @see InlineLevelLayoutManager#hyphenate(Position, HyphContext) */
public void hyphenate(Position pos, HyphContext hc) {
Position newPos = ((NonLeafPosition) pos).getPosition();
((InlineLevelLayoutManager)
newPos.getLM()).hyphenate(newPos, hc);
}
+ /** @see InlineLevelLayoutManager#applyChanges(List) */
public boolean applyChanges(List oldList) {
// "unwrap" the Positions stored in the elements
ListIterator oldListIterator = oldList.listIterator();
int fromIndex = 0;
boolean bSomethingChanged = false;
- while(oldListIterator.hasNext()) {
+ while (oldListIterator.hasNext()) {
oldElement = (KnuthElement) oldListIterator.next();
currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager();
// initialize prevLM
}
if (currLM != prevLM || !oldListIterator.hasNext()) {
- if (oldListIterator.hasNext()) {
+ if (prevLM == this || currLM == this) {
+ prevLM = currLM;
+ } else if (oldListIterator.hasNext()) {
bSomethingChanged
- = prevLM.applyChanges(oldList.subList(fromIndex, oldListIterator.previousIndex()))
+ = prevLM.applyChanges(oldList.subList(fromIndex
+ , oldListIterator.previousIndex()))
|| bSomethingChanged;
prevLM = currLM;
fromIndex = oldListIterator.previousIndex();
} else if (currLM == prevLM) {
bSomethingChanged
= prevLM.applyChanges(oldList.subList(fromIndex, oldList.size()))
- || bSomethingChanged;
+ || bSomethingChanged;
} else {
bSomethingChanged
- = prevLM.applyChanges(oldList.subList(fromIndex, oldListIterator.previousIndex()))
- || bSomethingChanged;
- bSomethingChanged
- = currLM.applyChanges(oldList.subList(oldListIterator.previousIndex(), oldList.size()))
- || bSomethingChanged;
+ = prevLM.applyChanges(oldList.subList(fromIndex
+ , oldListIterator.previousIndex()))
+ || bSomethingChanged;
+ if (currLM != null) {
+ bSomethingChanged
+ = currLM.applyChanges(oldList.subList(oldListIterator.previousIndex()
+ , oldList.size()))
+ || bSomethingChanged;
+ }
}
}
}
while (oldListIterator.hasNext()) {
oldElement = (KnuthElement) oldListIterator.next();
oldElement.setPosition
- (new NonLeafPosition(this, oldElement.getPosition()));
+ (notifyPos(new NonLeafPosition(this, oldElement.getPosition())));
}
return bSomethingChanged;
}
- public LinkedList getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/ int alignment) {
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#getChangedKnuthElements(List, int)
+ */
+ public LinkedList getChangedKnuthElements(List oldList, int alignment) {
// "unwrap" the Positions stored in the elements
ListIterator oldListIterator = oldList.listIterator();
KnuthElement oldElement;
InlineLevelLayoutManager currLM;
int fromIndex = 0;
- while(oldListIterator.hasNext()) {
+ while (oldListIterator.hasNext()) {
oldElement = (KnuthElement) oldListIterator.next();
currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager();
if (prevLM == null) {
(oldList.subList(fromIndex,
oldListIterator.previousIndex()),
/*flaggedPenalty,*/ alignment));
- returnedList.addAll
- (currLM.getChangedKnuthElements
- (oldList.subList(oldListIterator.previousIndex(),
- oldList.size()),
- /*flaggedPenalty,*/ alignment));
+ if (currLM != null) {
+ returnedList.addAll
+ (currLM.getChangedKnuthElements
+ (oldList.subList(oldListIterator.previousIndex(),
+ oldList.size()),
+ /*flaggedPenalty,*/ alignment));
+ }
}
}
}
while (listIter.hasNext()) {
returnedElement = (KnuthElement) listIter.next();
returnedElement.setPosition
- (new NonLeafPosition(this, returnedElement.getPosition()));
+ (notifyPos(new NonLeafPosition(this, returnedElement.getPosition())));
returnList.add(returnedElement);
}
return returnList;
package org.apache.fop.layoutmgr.inline;
+import org.apache.fop.layoutmgr.inline.AlignmentContext;
import org.apache.fop.layoutmgr.FootnoteBodyLayoutManager;
import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.Position;
public class KnuthInlineBox extends KnuthBox {
- private int lead;
- private int total;
- private int middle;
private FootnoteBodyLayoutManager footnoteBodyLM = null;
+ private AlignmentContext alignmentContext = null;
/**
* Create a new KnuthBox.
*
* @param w the width of this box
- * @param l the height of this box above the main baseline
- * @param t the total height of this box
- * @param m the height of this box above and below the middle baseline
+ * @param alignmentContext the alignmentContext for this box
* @param pos the Position stored in this box
* @param bAux is this box auxiliary?
*/
- public KnuthInlineBox(int w, int l, int t, int m, Position pos, boolean bAux) {
+ public KnuthInlineBox(int w, AlignmentContext alignmentContext, Position pos, boolean bAux) {
super(w, pos, bAux);
- lead = l;
- total = t;
- middle = m;
+ this.alignmentContext = alignmentContext;
}
/**
- * @return the height of this box above the main baseline.
+ * @return the alignment context.
*/
- public int getLead() {
- return lead;
- }
-
- /**
- * @return the total height of this box.
- */
- public int getTotal() {
- return total;
- }
-
- /**
- * @return the height of this box above and below the middle baseline.
- */
- public int getMiddle() {
- return middle;
+ public AlignmentContext getAlignmentContext() {
+ return alignmentContext;
}
/**
/** @see java.lang.Object#toString() */
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
- sb.append(" lead=").append(lead);
- sb.append(" total=").append(total);
- sb.append(" middle=").append(middle);
return sb.toString();
}
}
\ No newline at end of file
*/
public class LeaderLayoutManager extends LeafNodeLayoutManager {
private Leader fobj;
- Font font = null;
+ private Font font = null;
private LinkedList contentList = null;
private ContentLayoutManager clm = null;
* Constructor
*
* @param node the formatting object that creates this area
- * @todo better null checking of font object
*/
public LeaderLayoutManager(Leader node) {
super(node);
fobj = node;
}
+ /** @see LayoutManager#initialize */
public void initialize() {
font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
// the property leader-alignment does not affect vertical positioning
// (see section 7.21.1 in the XSL Recommendation)
// setAlignment(node.getLeaderAlignment());
- setAlignment(fobj.getVerticalAlign());
+ setCommonBorderPaddingBackground(fobj.getCommonBorderPaddingBackground());
}
+ /**
+ * Return the inline area for this leader.
+ * @param context the layout context
+ * @return the inline area
+ */
public InlineArea get(LayoutContext context) {
return getLeaderInlineArea();
}
+ /**
+ * Return the allocated IPD for this area.
+ * @param refIPD the IPD of the reference area
+ * @return the allocated IPD
+ */
protected MinOptMax getAllocationIPD(int refIPD) {
return getLeaderAllocIPD(refIPD);
}
private MinOptMax getLeaderAllocIPD(int ipd) {
// length of the leader
- setContentAreaIPD(ipd);
- int opt = fobj.getLeaderLength().getOptimum(this).getLength().getValue(this);
- int min = fobj.getLeaderLength().getMinimum(this).getLength().getValue(this);
- int max = fobj.getLeaderLength().getMaximum(this).getLength().getValue(this);
+ int borderPaddingWidth = 0;
+ if (commonBorderPaddingBackground != null) {
+ borderPaddingWidth = commonBorderPaddingBackground.getIPPaddingAndBorder(false, this);
+ }
+ setContentAreaIPD(ipd - borderPaddingWidth);
+ int opt = fobj.getLeaderLength().getOptimum(this).getLength().getValue(this)
+ - borderPaddingWidth;
+ int min = fobj.getLeaderLength().getMinimum(this).getLength().getValue(this)
+ - borderPaddingWidth;
+ int max = fobj.getLeaderLength().getMaximum(this).getLength().getValue(this)
+ - borderPaddingWidth;
return new MinOptMax(min, opt, max);
}
InlineArea leaderArea = null;
if (fobj.getLeaderPattern() == EN_RULE) {
- org.apache.fop.area.inline.Leader leader =
- new org.apache.fop.area.inline.Leader();
- leader.setRuleStyle(fobj.getRuleStyle());
- leader.setRuleThickness(fobj.getRuleThickness().getValue(this));
- leader.setBPD(fobj.getRuleThickness().getValue(this));
- leaderArea = leader;
+ if (fobj.getRuleStyle() != EN_NONE) {
+ org.apache.fop.area.inline.Leader leader
+ = new org.apache.fop.area.inline.Leader();
+ leader.setRuleStyle(fobj.getRuleStyle());
+ leader.setRuleThickness(fobj.getRuleThickness().getValue(this));
+ leader.setBPD(fobj.getRuleThickness().getValue(this));
+ leaderArea = leader;
+ } else {
+ leaderArea = new Space();
+ leaderArea.setBPD(1);
+ }
} else if (fobj.getLeaderPattern() == EN_SPACE) {
leaderArea = new Space();
- leaderArea.setBPD(font.getAscender());
+ leaderArea.setBPD(1);
} else if (fobj.getLeaderPattern() == EN_DOTS) {
TextArea t = new TextArea();
char dot = '.'; // userAgent.getLeaderDotCharacter();
+ int width = font.getCharWidth(dot);
t.setTextArea("" + dot);
- t.setIPD(font.getCharWidth(dot));
+ t.setIPD(width);
+ t.setBPD(width);
+ t.setBaselineOffset(width);
t.addTrait(Trait.FONT_NAME, font.getFontName());
t.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
- int width = font.getCharWidth(dot);
Space spacer = null;
if (fobj.getLeaderPatternWidth().getValue(this) > width) {
spacer = new Space();
if (spacer != null) {
fa.addChildArea(spacer);
}
- fa.setBPD(font.getAscender());
+ fa.setBPD(t.getBPD());
leaderArea = fa;
} else if (fobj.getLeaderPattern() == EN_USECONTENT) {
return leaderArea;
}
- protected void offsetArea(InlineArea area, LayoutContext context) {
- int pattern = fobj.getLeaderPattern();
- int bpd = area.getBPD();
-
- switch (pattern) {
- case EN_RULE:
- switch (verticalAlignment) {
- case EN_TOP:
- area.setOffset(0);
- break;
- case EN_MIDDLE:
- area.setOffset(context.getMiddleBaseline() - bpd / 2);
- break;
- case EN_BOTTOM:
- area.setOffset(context.getLineHeight() - bpd);
- break;
- case EN_BASELINE: // fall through
- default:
- area.setOffset(context.getBaseline() - bpd);
- break;
- }
- break;
- case EN_DOTS:
- switch (verticalAlignment) {
- case EN_TOP:
- area.setOffset(0);
- break;
- case EN_MIDDLE:
- area.setOffset(context.getMiddleBaseline());
- break;
- case EN_BOTTOM:
- area.setOffset(context.getLineHeight() - bpd + font.getAscender());
- break;
- case EN_BASELINE: // fall through
- default:
- area.setOffset(context.getBaseline());
- break;
- }
- break;
- case EN_SPACE:
- // nothing to do
- break;
- case EN_USECONTENT:
- switch (verticalAlignment) {
- case EN_TOP:
- area.setOffset(0);
- break;
- case EN_MIDDLE:
- area.setOffset(context.getMiddleBaseline());
- break;
- case EN_BOTTOM:
- area.setOffset(context.getLineHeight() - bpd);
- break;
- case EN_BASELINE: // fall through
- default:
- area.setOffset(context.getBaseline());
- break;
- }
- break;
- }
- }
-
+ /** @see LeafNodeLayoutManager#addAreas(PositionIterator, LayoutContext) */
public void addAreas(PositionIterator posIter, LayoutContext context) {
if (fobj.getLeaderPattern() != EN_USECONTENT) {
// use LeafNodeLayoutManager.addAreas()
}
}
+ /** @see LayoutManager#getNextKnuthElements(LayoutContext, int) */
public LinkedList getNextKnuthElements(LayoutContext context,
int alignment) {
MinOptMax ipd;
return null;
}
- ipd = getAllocationIPD(context.getRefIPD());
+ alignmentContext = new AlignmentContext(curArea.getBPD()
+ , fobj.getAlignmentAdjust()
+ , fobj.getAlignmentBaseline()
+ , fobj.getBaselineShift()
+ , fobj.getDominantBaseline()
+ , context.getAlignmentContext());
- int bpd = curArea.getBPD();
- int lead = 0;
- int total = 0;
- int middle = 0;
- switch (verticalAlignment) {
- case EN_MIDDLE : middle = bpd / 2 ;
- break;
- case EN_TOP : // fall through
- case EN_BOTTOM : total = bpd;
- break;
- case EN_BASELINE: // fall through
- default: lead = bpd;
- break;
- }
+ ipd = getAllocationIPD(context.getRefIPD());
// create the AreaInfo object to store the computed values
- areaInfo = new AreaInfo((short) 0, ipd, false,
- lead, total, middle);
+ areaInfo = new AreaInfo((short) 0, ipd, false, context.getAlignmentContext());
+ addKnuthElementsForBorderPaddingStart(seq);
+
// node is a fo:Leader
- seq.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
- areaInfo.middle,
+ seq.add(new KnuthInlineBox(0, alignmentContext,
new LeafPosition(this, -1), true));
seq.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new LeafPosition(this, -1), true));
areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
new LeafPosition(this, 0), false));
- seq.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
- areaInfo.middle,
+ seq.add(new KnuthInlineBox(0, alignmentContext,
new LeafPosition(this, -1), true));
+ addKnuthElementsForBorderPaddingEnd(seq);
+
LinkedList returnList = new LinkedList();
returnList.add(seq);
setFinished(true);
return returnList;
}
+ /** @see InlineLevelLayoutManager#hyphenate(Position, HyphContext) */
public void hyphenate(Position pos, HyphContext hc) {
// use the AbstractLayoutManager.hyphenate() null implementation
super.hyphenate(pos, hc);
}
+ /** @see InlineLevelLayoutManager#applyChanges(list) */
public boolean applyChanges(List oldList) {
setFinished(false);
return false;
}
+ /** @see LayoutManager#getNextKnuthElements(LayoutContext, int) */
public LinkedList getChangedKnuthElements(List oldList,
- int flaggedPenalty,
int alignment) {
if (isFinished()) {
return null;
LinkedList returnList = new LinkedList();
- returnList.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
- areaInfo.middle,
+ addKnuthElementsForBorderPaddingStart(returnList);
+
+ returnList.add(new KnuthInlineBox(0, areaInfo.alignmentContext,
new LeafPosition(this, -1), true));
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new LeafPosition(this, -1), true));
areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
new LeafPosition(this, 0), false));
- returnList.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
- areaInfo.middle,
+ returnList.add(new KnuthInlineBox(0, areaInfo.alignmentContext,
new LeafPosition(this, -1), true));
+ addKnuthElementsForBorderPaddingEnd(returnList);
+
setFinished(true);
return returnList;
}
+ /** @see LeafNodeLayoutManager#addId */
protected void addId() {
getPSLM().addIDToPage(fobj.getId());
}
package org.apache.fop.layoutmgr.inline;
+import java.util.LinkedList;
+import java.util.List;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.layoutmgr.AbstractLayoutManager;
+import org.apache.fop.layoutmgr.KnuthGlue;
+import org.apache.fop.layoutmgr.KnuthPenalty;
import org.apache.fop.layoutmgr.KnuthSequence;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.PositionIterator;
+import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.traits.MinOptMax;
-import java.util.List;
-import java.util.LinkedList;
/**
* Base LayoutManager for leaf-node FObj, ie: ones which have no children.
* The inline area that this leafnode will add.
*/
protected InlineArea curArea = null;
- protected int verticalAlignment;
- private int lead;
+ /** Any border, padding and background properties applying to this area */
+ protected CommonBorderPaddingBackground commonBorderPaddingBackground = null;
+ /** The alignment context applying to this area */
+ protected AlignmentContext alignmentContext = null;
+
private MinOptMax ipd;
- protected boolean bSomethingChanged = false;
+ /** Flag to indicate if something was changed as part of the getChangeKnuthElements sequence */
+ protected boolean isSomethingChanged = false;
+ /** Our area info for the Knuth elements */
protected AreaInfo areaInfo = null;
/**
protected short iLScount;
protected MinOptMax ipdArea;
protected boolean bHyphenated;
- protected int lead;
- protected int total;
- protected int middle;
+ protected AlignmentContext alignmentContext;
public AreaInfo(short iLS, MinOptMax ipd, boolean bHyph,
- int l, int t, int m) {
+ AlignmentContext alignmentContext) {
iLScount = iLS;
ipdArea = ipd;
bHyphenated = bHyph;
- lead = l;
- total = t;
- middle = m;
+ this.alignmentContext = alignmentContext;
}
+
}
curArea = ia;
}
- /**
- * Set the alignment of the inline area.
- * @param al the vertical alignment positioning
- */
- public void setAlignment(int al) {
- verticalAlignment = al;
- }
-
- /**
- * Set the lead for this inline area.
- * The lead is the distance from the top of the object
- * to the baseline.
- * @param l the lead value
- */
- public void setLead(int l) {
- lead = l;
- }
-
- /** @return the lead value (distance from the top of the object to the baseline) */
- public int getLead() {
- return this.lead;
- }
-
/**
* This is a leaf-node, so this method is never called.
* @param childArea the childArea to add
return null;
}
+ /**
+ * Set the border and padding properties of the inline area.
+ * @param commonBorderPaddingBackground the alignment adjust property
+ */
+ protected void setCommonBorderPaddingBackground(
+ CommonBorderPaddingBackground commonBorderPaddingBackground) {
+ this.commonBorderPaddingBackground = commonBorderPaddingBackground;
+ }
+
/**
* Get the allocation ipd of the inline area.
* This method may be overridden to handle percentage values.
if (area.getAllocIPD() > 0 || area.getAllocBPD() > 0) {
offsetArea(area, context);
widthAdjustArea(area, context);
+ if (commonBorderPaddingBackground != null) {
+ // Add border and padding to area
+ TraitSetter.setBorderPaddingTraits(area,
+ commonBorderPaddingBackground,
+ false, false, this);
+ TraitSetter.addBackground(area, commonBorderPaddingBackground, this);
+ }
parentLM.addChildArea(area);
}
* @param context the layout context used for adding the area
*/
protected void offsetArea(InlineArea area, LayoutContext context) {
- int bpd = area.getBPD();
- switch (verticalAlignment) {
- case EN_MIDDLE:
- area.setOffset(context.getMiddleBaseline() - bpd / 2);
- break;
- case EN_TOP:
- area.setOffset(context.getTopBaseline());
- break;
- case EN_BOTTOM:
- area.setOffset(context.getBottomBaseline() - bpd);
- break;
- case EN_BASELINE:
- default:
- area.setOffset(context.getBaseline() - bpd);
- break;
- }
+ area.setOffset(alignmentContext.getOffset());
+ }
+
+ /**
+ * Creates a new alignment context or returns the current
+ * alignment context.
+ * This is used for vertical alignment.
+ * Subclasses should override this if necessary.
+ * @param context the layout context used
+ * @return the appropriate alignment context
+ */
+ protected AlignmentContext makeAlignmentContext(LayoutContext context) {
+ return context.getAlignmentContext();
}
/**
}
area.setIPD(width);
}
-
- public LinkedList getNextKnuthElements(LayoutContext context,
- int alignment) {
- MinOptMax ipd;
+
+ /** @see LayoutManager#getNextKnuthElements(LayoutContext, int) */
+ public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
curArea = get(context);
-
+
if (curArea == null) {
setFinished(true);
return null;
}
- ipd = getAllocationIPD(context.getRefIPD());
-
- int bpd = curArea.getBPD();
- int lead = 0;
- int total = 0;
- int middle = 0;
- switch (verticalAlignment) {
- case EN_MIDDLE : middle = bpd / 2 ;
- lead = bpd / 2 ;
- break;
- case EN_TOP : total = bpd;
- break;
- case EN_BOTTOM : total = bpd;
- break;
- case EN_BASELINE:
- default:
- //lead = bpd;
- lead = getLead();
- total = bpd;
- break;
- }
+
+ alignmentContext = makeAlignmentContext(context);
+
+ MinOptMax ipd = getAllocationIPD(context.getRefIPD());
// create the AreaInfo object to store the computed values
- areaInfo = new AreaInfo((short) 0, ipd, false,
- lead, total, middle);
+ areaInfo = new AreaInfo((short) 0, ipd, false, alignmentContext);
// node is a fo:ExternalGraphic, fo:InstreamForeignObject,
// fo:PageNumber or fo:PageNumberCitation
KnuthSequence seq = new KnuthSequence(true);
- seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
- areaInfo.total, areaInfo.middle,
- new LeafPosition(this, 0), false));
+
+ addKnuthElementsForBorderPaddingStart(seq);
+
+ seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, alignmentContext,
+ notifyPos(new LeafPosition(this, 0)), false));
+
+ addKnuthElementsForBorderPaddingEnd(seq);
+
LinkedList returnList = new LinkedList();
+
returnList.add(seq);
setFinished(true);
return returnList;
}
+ /** @see InlineLevelLayoutManager#addALetterSpaceTo(List) */
public List addALetterSpaceTo(List oldList) {
// return the unchanged elements
return oldList;
log.warn(this.getClass().getName() + " should not receive a call to removeWordSpace(list)");
}
+ /** @see InlineLevelLayoutManager#getWordChars(StringBuffer, Position) */
public void getWordChars(StringBuffer sbChars, Position pos) {
}
+ /** @see InlineLevelLayoutManager#hyphenate(Position, HyphContext) */
public void hyphenate(Position pos, HyphContext hc) {
}
+ /** @see InlineLevelLayoutManager#applyChanges(List) */
public boolean applyChanges(List oldList) {
setFinished(false);
return false;
}
+ /** @see LayoutManager#getChangedKnuthElements(List, int) */
public LinkedList getChangedKnuthElements(List oldList,
- /*int flaggedPenalty,*/
int alignment) {
if (isFinished()) {
return null;
LinkedList returnList = new LinkedList();
+ addKnuthElementsForBorderPaddingStart(returnList);
+
// fobj is a fo:ExternalGraphic, fo:InstreamForeignObject,
// fo:PageNumber or fo:PageNumberCitation
- returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
- areaInfo.total, areaInfo.middle,
- new LeafPosition(this, 0), true));
+ returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
+ notifyPos(new LeafPosition(this, 0)), true));
+ addKnuthElementsForBorderPaddingEnd(returnList);
+
setFinished(true);
return returnList;
}
+
+ /**
+ * Creates Knuth elements for start border padding and adds them to the return list.
+ * @param returnList return list to add the additional elements to
+ */
+ protected void addKnuthElementsForBorderPaddingStart(List returnList) {
+ //Border and Padding (start)
+ if (commonBorderPaddingBackground != null) {
+ int ipStart = commonBorderPaddingBackground.getBorderStartWidth(false)
+ + commonBorderPaddingBackground.getPaddingStart(false, this);
+ if (ipStart > 0) {
+ // Add a non breakable glue
+ returnList.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
+ false, new LeafPosition(this, -1), true));
+ returnList.add(new KnuthGlue(ipStart, 0, 0, new LeafPosition(this, -1), true));
+ }
+ }
+ }
+
+ /**
+ * Creates Knuth elements for end border padding and adds them to the return list.
+ * @param returnList return list to add the additional elements to
+ */
+ protected void addKnuthElementsForBorderPaddingEnd(List returnList) {
+ //Border and Padding (after)
+ if (commonBorderPaddingBackground != null) {
+ int ipEnd = commonBorderPaddingBackground.getBorderEndWidth(false)
+ + commonBorderPaddingBackground.getPaddingEnd(false, this);
+ if (ipEnd > 0) {
+ // Add a non breakable glue
+ returnList.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
+ false, new LeafPosition(this, -1), true));
+ returnList.add(new KnuthGlue(ipEnd, 0, 0, new LeafPosition(this, -1), true));
+ }
+ }
+ }
+
}
import java.util.List;
import java.util.ArrayList;
import java.util.LinkedList;
+import org.apache.fop.area.Trait;
+import org.apache.fop.fonts.Font;
+import org.apache.fop.layoutmgr.BreakingAlgorithm.KnuthNode;
+import org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager.StackingIter;
import org.apache.fop.traits.MinOptMax;
private int startIndent;
private int lineHeight;
private int lineWidth;
+ private int spaceBefore;
+ private int spaceAfter;
private int baseline;
- private int topShift;
- private int bottomShift;
LineBreakPosition(LayoutManager lm, int index, int iBreakIndex,
int shrink, int stretch, int diff,
double ipdA, double adjust, int ind,
- int lh, int lw, int bl, int ts, int bs) {
+ int lh, int lw, int sb, int sa, int bl) {
super(lm, iBreakIndex);
availableShrink = shrink;
availableStretch = stretch;
startIndent = ind;
lineHeight = lh;
lineWidth = lw;
+ spaceBefore = sb;
+ spaceAfter = sa;
baseline = bl;
- topShift = ts;
- bottomShift = bs;
}
}
private Length lineHeight;
private int lead;
private int follow;
- // offset of the middle baseline with respect to the main baseline
- private int middleShift;
+ private AlignmentContext alignmentContext = null;
private List knuthParagraphs = null;
private int iReturnedLBP = 0;
private List lineLayoutsList;
private int iLineWidth = 0;
- // this constant is used to create elements when text-align is center:
- // every TextLM descendant of LineLM must use the same value,
- // otherwise the line breaking algorithm does not find the right
- // break point
+ /**
+ * this constant is used to create elements when text-align is center:
+ * every TextLM descendant of LineLM must use the same value,
+ * otherwise the line breaking algorithm does not find the right
+ * break point
+ */
public static final int DEFAULT_SPACE_WIDTH = 3336;
- // this class is used to remember
- // which was the first element in the paragraph
- // returned by each LM
+ /**
+ * This class is used to remember
+ * which was the first element in the paragraph
+ * returned by each LM.
+ */
private class Update {
private InlineLevelLayoutManager inlineLM;
private int iFirstIndex;
if (textAlignment == EN_CENTER && textAlignmentLast != EN_JUSTIFY) {
this.add(new KnuthGlue(0, 3 * DEFAULT_SPACE_WIDTH, 0,
null, false));
- ignoreAtStart ++;
+ ignoreAtStart++;
}
// add the element representing text indentation
// at the beginning of the first paragraph
if (knuthParagraphs.size() == 0
&& fobj.getTextIndent().getValue(layoutManager) != 0) {
- this.add(new KnuthInlineBox(fobj.getTextIndent().getValue(layoutManager), 0, 0, 0,
+ this.add(new KnuthInlineBox(fobj.getTextIndent().getValue(layoutManager), null,
null, false));
- ignoreAtStart ++;
+ ignoreAtStart++;
}
}
private int lineHeight;
private int lead;
private int follow;
- private int middleshift;
private int maxDiff;
private static final double MAX_DEMERITS = 10e6;
public LineBreakingAlgorithm (int pageAlign,
int textAlign, int textAlignLast,
int indent, int fillerWidth,
- int lh, int ld, int fl, int ms, boolean first,
+ int lh, int ld, int fl, boolean first,
LineLayoutManager llm) {
super(textAlign, textAlignLast, first, false);
pageAlignment = pageAlign;
lineHeight = lh;
lead = ld;
follow = fl;
- middleshift = ms;
thisLLM = llm;
activePossibility = -1;
maxDiff = fobj.getWidows() >= fobj.getOrphans()
int difference = bestActiveNode.difference;
int textAlign = (bestActiveNode.line < total) ? alignment : alignmentLast;
indent += (textAlign == Constants.EN_CENTER) ?
- difference / 2 :
- (textAlign == Constants.EN_END) ? difference : 0;
- indent += (bestActiveNode.line == 1 && bFirst) ?
- textIndent : 0;
+ difference / 2 : (textAlign == Constants.EN_END) ? difference : 0;
+ indent += (bestActiveNode.line == 1 && bFirst) ? textIndent : 0;
double ratio = (textAlign == Constants.EN_JUSTIFY
- || difference < 0 && -difference <= bestActiveNode.availableShrink) ?
- bestActiveNode.adjustRatio : 0;
+ || difference < 0 && -difference <= bestActiveNode.availableShrink)
+ ? bestActiveNode.adjustRatio : 0;
// add nodes at the beginning of the list, as they are found
// backwards, from the last one to the first one
}
if (addedPositions == lineLayouts.getLineCount(activePossibility)) {
- activePossibility ++;
+ activePossibility++;
addedPositions = 0;
//System.out.println(" ");
}
bestActiveNode.position,
bestActiveNode.availableShrink - (addedPositions > 0 ? 0 : ((Paragraph)par).lineFiller.opt - ((Paragraph)par).lineFiller.min), bestActiveNode.availableStretch, difference, ratio, indent),
activePossibility);
- addedPositions ++;
+ addedPositions++;
}
/* reset activePossibility, as if breakpoints have not yet been computed
double ratio,
int indent) {
// line height calculation
-
int halfLeading = (lineHeight - lead - follow) / 2;
// height before the main baseline
int lineLead = lead;
- // maximum size of top and bottom alignment
- int maxtb = follow;
- // max size of middle alignment before and after the middle baseline
- int middlefollow = maxtb;
+ // maximum follow
+ int lineFollow = follow;
// true if this line contains only zero-height, auxiliary boxes
// and the actual line width is 0; in this case, the line "collapses"
// i.e. the line area will have bpd = 0
if (fobj.getLineStackingStrategy() != EN_FONT_HEIGHT) {
ListIterator inlineIterator
= par.listIterator(firstElementIndex);
+ AlignmentContext lastAC = null;
+ int maxIgnoredHeight = 0; // See spec 7.13
for (int j = firstElementIndex;
j <= lastElementIndex;
j++) {
KnuthElement element = (KnuthElement) inlineIterator.next();
- if (element.isBox()) {
- if (((KnuthInlineBox) element).getLead() > lineLead) {
- lineLead = ((KnuthInlineBox) element).getLead();
- }
- if (((KnuthInlineBox) element).getTotal() > maxtb) {
- maxtb = ((KnuthInlineBox) element).getTotal();
- }
- if (((KnuthInlineBox) element).getMiddle() > lineLead + middleShift) {
- lineLead += ((KnuthInlineBox) element).getMiddle()
- - lineLead - middleShift;
- }
- if (((KnuthInlineBox) element).getMiddle() > middlefollow - middleShift) {
- middlefollow += ((KnuthInlineBox) element).getMiddle()
- - middlefollow + middleShift;
+ if (element instanceof KnuthInlineBox ) {
+ AlignmentContext ac = ((KnuthInlineBox) element).getAlignmentContext();
+ if (ac != null && lastAC != ac) {
+ if (!ac.usesInitialBaselineTable()
+ || ac.getAlignmentBaselineIdentifier() != EN_BEFORE_EDGE
+ && ac.getAlignmentBaselineIdentifier() != EN_AFTER_EDGE) {
+ int alignmentOffset = ac.getTotalAlignmentBaselineOffset();
+ if (alignmentOffset + ac.getAltitude() > lineLead) {
+ lineLead = alignmentOffset + ac.getAltitude();
+ }
+ if (ac.getDepth() - alignmentOffset > lineFollow) {
+ lineFollow = ac.getDepth() - alignmentOffset;
+ }
+ } else {
+ if (ac.getHeight() > maxIgnoredHeight) {
+ maxIgnoredHeight = ac.getHeight();
+ }
+ }
+ lastAC = ac;
}
if (bZeroHeightLine
- && (!element.isAuxiliary()
- || ((KnuthInlineBox) element).getTotal() > 0
- || ((KnuthInlineBox) element).getLead() > 0
- || ((KnuthInlineBox) element).getMiddle() > 0)) {
+ && (!element.isAuxiliary() || ac != null && ac.getHeight() > 0)) {
bZeroHeightLine = false;
}
}
}
- if (maxtb - lineLead > middlefollow) {
- middlefollow = maxtb - lineLead;
+ if (lineFollow < maxIgnoredHeight - lineLead) {
+ lineFollow = maxIgnoredHeight - lineLead;
}
}
- constantLineHeight = lineLead + middlefollow + (lineHeight - lead - follow);
+ constantLineHeight = lineLead + lineFollow;
if (bZeroHeightLine) {
return new LineBreakPosition(thisLLM,
knuthParagraphs.indexOf(par),
lastElementIndex,
availableShrink, availableStretch, difference, ratio, 0, indent,
- 0, iLineWidth,
- 0, 0, 0);
+ 0, iLineWidth, 0, 0, 0);
} else {
return new LineBreakPosition(thisLLM,
knuthParagraphs.indexOf(par),
lastElementIndex,
availableShrink, availableStretch, difference, ratio, 0, indent,
- lineLead + middlefollow + (lineHeight - lead - follow), iLineWidth,
- lineLead + halfLeading,
- - lineLead, middlefollow);
+ lineLead + lineFollow,
+ iLineWidth, halfLeading, halfLeading,
+ lineLead);
}
}
* Create a new Line Layout Manager.
* This is used by the block layout manager to create
* line managers for handling inline areas flowing into line areas.
- *
+ * @param block the block formatting object
* @param lh the default line height
* @param l the default lead, from top to baseline
* @param f the default follow, from baseline to bottom
*/
- public LineLayoutManager(Block block, Length lh, int l, int f, int ms) {
+ public LineLayoutManager(Block block, Length lh, int l, int f) {
super(block);
fobj = block;
// the child FObj are owned by the parent BlockLM
lineHeight = lh;
lead = l;
follow = f;
- middleShift = ms;
}
/** @see org.apache.fop.layoutmgr.LayoutManager */
public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
+ Font fs = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
+ alignmentContext = new AlignmentContext(fs, lineHeight.getValue(this), context.getWritingMode());
+ context.setAlignmentContext(alignmentContext);
// Get a break from currently active child LM
// Set up constraints for inline level managers
- InlineLevelLayoutManager curLM ; // currently active LM
+ InlineLevelLayoutManager curLM; // currently active LM
// IPD remaining in line
MinOptMax availIPD = context.getStackLimit();
if (lastPar.size() == 0) {
//only a forced linefeed on this line
//-> compensate with a zero width box
- lastPar.add(new KnuthInlineBox(0, 0, 0, 0,
- null, false));
+ lastPar.add(new KnuthInlineBox(0, null, null, false));
}
lastPar.endParagraph();
ElementListObserver.observe(lastPar, "line", null);
// height above the main baseline
int lineLead = lead + halfLeading;
// maximum size of top and bottom alignment
- int maxtb = follow + halfLeading;
- // max size of middle alignment above and below the middle baseline
- int middlefollow = maxtb;
+ int lineFollow = follow + halfLeading;
ListIterator inlineIterator
= par.listIterator(firstElementIndex);
if (box.getLead() > lineLead) {
lineLead = box.getLead();
}
- if (box.getTotal() > maxtb) {
- maxtb = box.getTotal();
+ if (box.getTotal() > lineFollow) {
+ lineFollow = box.getTotal();
}
if (box.getMiddle() > lineLead + middleShift) {
lineLead += box.getMiddle()
}
}
- if (maxtb - lineLead > middlefollow) {
- middlefollow = maxtb - lineLead;
+ if (lineFollow - lineLead > middlefollow) {
+ middlefollow = lineFollow - lineLead;
}
breakpoints.add(insertIndex,
//TODO Should this really create only a single LineBreakPosition???
//This creates an implicit keep-together on the nested block-level FOs.
lineLayouts = new LineLayoutPossibilities();
- lineLayouts.addPossibility(1,0);
+ lineLayouts.addPossibility(1, 0);
int lineHeight = 0, lineStretch = 0, lineShrink = 0;
ListIterator seqIterator = seq.listIterator();
while (seqIterator.hasNext()) {
double maxAdjustment = 1;
int iBPcount = 0;
LineBreakingAlgorithm alg = new LineBreakingAlgorithm(alignment,
- textAlignment, textAlignmentLast,
+ textAlignment, textAlignmentLast,
textIndent.getValue(this), currPar.lineFiller.opt,
- lineHeight.getValue(this), lead, follow, middleShift,
+ lineHeight.getValue(this), lead, follow,
(knuthParagraphs.indexOf(currPar) == 0),
this);
LinkedList returnList = new LinkedList();
- for (int p = 0; p < knuthParagraphs.size(); p ++) {
+ for (int p = 0; p < knuthParagraphs.size(); p++) {
// null penalty between paragraphs
if (p > 0
&& !((BlockLevelLayoutManager) parentLM).mustKeepTogether()) {
KnuthElement tempElement;
tempElement = (KnuthElement) listIter.next();
if (tempElement.getLayoutManager() != this) {
- tempElement.setPosition(new NonLeafPosition(this,
- tempElement.getPosition()));
+ tempElement.setPosition(notifyPos(new NonLeafPosition(this,
+ tempElement.getPosition())));
}
targetList.add(tempElement);
}
}
startIndex = endIndex + 1;
LineBreakPosition lbp = (LineBreakPosition) lineLayouts.getChosenPosition(i);
- returnList.add(new KnuthBlockBox(lbp.lineHeight, footnoteList, lbp, false));
+ returnList.add(new KnuthBlockBox(lbp.lineHeight + lbp.spaceBefore + lbp.spaceAfter
+ , footnoteList, lbp, false));
/* // add stretch and shrink to the returnlist
if (!seq.isInlineSequence()
&& lbp.availableStretch != 0 || lbp.availableShrink != 0) {
}
}
+ /**
+ * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#mustKeepTogether
+ */
public boolean mustKeepTogether() {
return false;
}
+ /**
+ * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#mustKeepWithPrevious
+ */
public boolean mustKeepWithPrevious() {
return false;
}
+ /**
+ * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#mustKeepWithNext
+ */
public boolean mustKeepWithNext() {
return false;
}
return lineNumberDifference * constantLineHeight;
}
+ /**
+ * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#discardSpace(KnuthGlue)
+ */
public void discardSpace(KnuthGlue spaceGlue) {
}
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#getChangedKnuthElements(List, int)
+ */
public LinkedList getChangedKnuthElements(List oldList, int alignment) {
LinkedList returnList = new LinkedList();
- for (int p = 0;
- p < knuthParagraphs.size();
- p ++) {
+ for (int p = 0; p < knuthParagraphs.size(); p++) {
lineLayouts = (LineLayoutPossibilities)lineLayoutsList.get(p);
//System.out.println("demerits of the chosen layout: " + lineLayouts.getChosenDemerits());
- for (int i = 0;
- i < lineLayouts.getChosenLineCount();
- i ++) {
+ for (int i = 0; i < lineLayouts.getChosenLineCount(); i++) {
if (!((BlockLevelLayoutManager) parentLM).mustKeepTogether()
&& i >= fobj.getOrphans()
&& i <= lineLayouts.getChosenLineCount() - fobj.getWidows()) {
* find hyphenation points for every word int the current paragraph
* @ param currPar the paragraph whose words will be hyphenated
*/
- private void findHyphenationPoints(Paragraph currPar){
+ private void findHyphenationPoints(Paragraph currPar) {
// hyphenate every word
ListIterator currParIterator
= currPar.listIterator(currPar.ignoreAtStart);
updateList.add(new Update(currLM, currParIterator.previousIndex()));
}
// append text to recreate the whole word
- boxCount ++;
+ boxCount++;
currLM.getWordChars(sbChars, nextElement.getPosition());
} else if (!nextElement.isAuxiliary()) {
// a non-auxiliary non-box KnuthElement: stop
currParIterator.previous();
break;
} else {
+ if (currLM != nextElement.getLayoutManager()) {
+ currLM = (InlineLevelLayoutManager) nextElement.getLayoutManager();
+ updateList.add(new Update(currLM, currParIterator.previousIndex()));
+ }
// an auxiliary KnuthElement: simply ignore it
- auxCount ++;
+ auxCount++;
}
}
log.trace(" Word to hyphenate: " + sbChars.toString());
updateList.clear();
}
- /** Line area is always considered to act as a fence. */
- protected boolean hasLeadingFence(boolean bNotFirst) {
+ /**
+ * Line area is always considered to act as a fence.
+ * @param isNotFirst ignored
+ * @return always true
+ */
+ protected boolean hasLeadingFence(boolean isNotFirst) {
return true;
}
- /** Line area is always considered to act as a fence. */
- protected boolean hasTrailingFence(boolean bNotLast) {
+ /**
+ * Line area is always considered to act as a fence.
+ * @param isNotLast ignored
+ * @return always true
+ */
+ protected boolean hasTrailingFence(boolean isNotLast) {
return true;
}
LayoutContext context) {
LayoutManager childLM;
LayoutContext lc = new LayoutContext(0);
+ lc.setAlignmentContext(alignmentContext);
int iCurrParIndex;
while (parentIter.hasNext()) {
Position pos = (Position) parentIter.next();
lineArea.setStartIndent(lbp.startIndent);
lineArea.setBPD(lbp.lineHeight);
lineArea.setIPD(lbp.lineWidth);
- lc.setBaseline(lbp.baseline);
- lc.setLineHeight(lbp.lineHeight);
- lc.setMiddleShift(middleShift);
- lc.setTopShift(lbp.topShift);
- lc.setBottomShift(lbp.bottomShift);
+ lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
+ lineArea.addTrait(Trait.SPACE_AFTER, new Integer(lbp.spaceAfter));
+ alignmentContext.resizeLine(lbp.lineHeight, lbp.baseline);
if (seq instanceof Paragraph) {
Paragraph currPar = (Paragraph) seq;
seqIterator = seq.listIterator(iEndElement);
tempElement = (KnuthElement) seqIterator.next();
if (tempElement.isGlue()) {
- iEndElement --;
+ iEndElement--;
// this returns the same KnuthElement
seqIterator.previous();
tempElement = (KnuthElement) seqIterator.previous();
tempElement = (KnuthElement) seqIterator.next();
while (!tempElement.isBox() && seqIterator.hasNext()) {
tempElement = (KnuthElement) seqIterator.next();
- iStartElement ++;
+ iStartElement++;
}
// Add the inline areas to lineArea
//System.out.println(" old ratio = " + lbp.ipdAdjust + " new ratio = " + updatedRatio);
} else if (false && textAlignment == EN_CENTER) {
// re-compute indent
- int updatedIndent = lbp.startIndent + (context.getStackLimit().opt - lbp.lineWidth) / 2;
+ int updatedIndent = lbp.startIndent
+ + (context.getStackLimit().opt - lbp.lineWidth) / 2;
lineArea.setStartIndent(updatedIndent);
} else if (false && textAlignment == EN_END) {
// re-compute indent
- int updatedIndent = lbp.startIndent + (context.getStackLimit().opt - lbp.lineWidth);
+ int updatedIndent = lbp.startIndent
+ + (context.getStackLimit().opt - lbp.lineWidth);
lineArea.setStartIndent(updatedIndent);
}
setCurrentArea(null); // ?? necessary
}
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(Area)
+ */
public void addChildArea(Area childArea) {
// Make sure childArea is inline area
if (childArea instanceof InlineArea) {
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.UnresolvedPageNumber;
import org.apache.fop.area.inline.TextArea;
+import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fonts.Font;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.layoutmgr.LayoutManager;
fobj = node;
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager#initialize */
public void initialize() {
font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
+ setCommonBorderPaddingBackground(fobj.getCommonBorderPaddingBackground());
}
+ /**
+ * @see LeafNodeLayoutManager.makeAlignmentContext(LayoutContext)
+ */
+ protected AlignmentContext makeAlignmentContext(LayoutContext context) {
+ return new AlignmentContext(
+ font
+ , fobj.getLineHeight().getOptimum(this).getLength().getValue(this)
+ , fobj.getAlignmentAdjust()
+ , fobj.getAlignmentBaseline()
+ , fobj.getBaselineShift()
+ , fobj.getDominantBaseline()
+ , context.getAlignmentContext()
+ );
+ }
+
+ /** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#get(LayoutContext) */
public InlineArea get(LayoutContext context) {
curArea = getPageNumberCitationInlineArea(parentLM);
return curArea;
}
+ /**
+ * @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#addAreas(PositionIterator
+ * , LayoutContext)
+ */
public void addAreas(PositionIterator posIter, LayoutContext context) {
super.addAreas(posIter, context);
if (!resolved) {
return font.getAscender();
}
- protected void offsetArea(InlineArea area, LayoutContext context) {
- area.setOffset(context.getBaseline());
- }
-
/**
* if id can be resolved then simply return a word, otherwise
* return a resolvable area
*/
private InlineArea getPageNumberCitationInlineArea(LayoutManager parentLM) {
PageViewport page = getPSLM().getFirstPVWithID(fobj.getRefId());
- InlineArea inline = null;
+ TextArea inline = null;
if (page != null) {
String str = page.getPageNumberString();
// get page string from parent, build area
}
TraitSetter.setProducerID(inline, fobj.getId());
inline.setBPD(font.getAscender() - font.getDescender());
- inline.setOffset(font.getAscender());
+ inline.setBaselineOffset(font.getAscender());
inline.addTrait(Trait.FONT_NAME, font.getFontName());
inline.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
inline.addTrait(Trait.COLOR, fobj.getColor());
}
return width;
}
-
+
+ /** @see org.apache.fop.layoutmgr.inline.LeafLayoutManager#addId */
protected void addId() {
getPSLM().addIDToPage(fobj.getId());
}
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.TextArea;
import org.apache.fop.area.Trait;
+import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fonts.Font;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.layoutmgr.TraitSetter;
fobj = node;
}
+ /** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#get(LayoutContext) */
public void initialize() {
font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo(), this);
+ setCommonBorderPaddingBackground(fobj.getCommonBorderPaddingBackground());
}
+ /**
+ * @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager
+ * #makeAlignmentContext(LayoutContext)
+ */
+ protected AlignmentContext makeAlignmentContext(LayoutContext context) {
+ return new AlignmentContext(
+ font
+ , fobj.getLineHeight().getOptimum(this).getLength().getValue(this)
+ , fobj.getAlignmentAdjust()
+ , fobj.getAlignmentBaseline()
+ , fobj.getBaselineShift()
+ , fobj.getDominantBaseline()
+ , context.getAlignmentContext()
+ );
+ }
+
+ /** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#get(LayoutContext) */
public InlineArea get(LayoutContext context) {
// get page string from parent, build area
TextArea text = new TextArea();
text.setTextArea(str);
text.setIPD(width);
text.setBPD(font.getAscender() - font.getDescender());
- text.setOffset(font.getAscender());
+ text.setBaselineOffset(font.getAscender());
text.addTrait(Trait.FONT_NAME, font.getFontName());
text.addTrait(Trait.FONT_SIZE,
new Integer(font.getFontSize()));
return text;
}
-
/** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#getLead() */
public int getLead() {
return font.getAscender();
}
- protected void offsetArea(InlineArea area, LayoutContext context) {
- area.setOffset(context.getBaseline());
- }
-
+ /** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#getEffectiveArea() */
protected InlineArea getEffectiveArea() {
TextArea baseArea = (TextArea)curArea;
//TODO Maybe replace that with a clone() call or better, a copy constructor
ta.setIPD(baseArea.getIPD());
ta.setBPD(baseArea.getBPD());
ta.setOffset(baseArea.getOffset());
+ ta.setBaselineOffset(baseArea.getBaselineOffset());
ta.addTrait(Trait.FONT_NAME, font.getFontName()); //only to initialize the trait map
ta.getTraits().putAll(baseArea.getTraits());
updateContent(ta);
return width;
}
+ /** @see org.apache.fop.layoutmgr.inline.LeafLayoutManager#addId */
protected void addId() {
getPSLM().addIDToPage(fobj.getId());
}
--- /dev/null
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.inline;
+
+import org.apache.fop.datatypes.Length;
+
+/**
+ * The FOP specific incarnation of the XSL-FO scaled baseline table.
+ * All baseline tables are scaled to the font size of the font they
+ * apply to. This interface uses a coordinate system with its origin
+ * where the dominant baseline intersects the start edge of the box.
+ * All measurements are in mpt.
+ */
+public interface ScaledBaselineTable {
+
+ /**
+ * Return the dominant baseline identifer for this alignment context.
+ * @return the dominant baseline identifier
+ */
+ int getDominantBaselineIdentifier();
+
+ /**
+ * Return the writing mode for this aligment context.
+ * @return the writing mode
+ */
+ int getWritingMode();
+
+ /**
+ * Return the offset measured from the dominant
+ * baseline for the given baseline identifier.
+ * @param baselineIdentifier the baseline identifier
+ * @return the baseline offset
+ */
+ int getBaseline(int baselineIdentifier);
+
+ /**
+ * Sets the position of the before and after baselines.
+ * This is usually only done for line areas. For other
+ * areas the position of the before and after baselines
+ * are fixed when the table is constructed.
+ * @param beforeBaseline the offset of the before-edge baseline from the dominant baseline
+ * @param afterBaseline the offset of the after-edge baseline from the dominant baseline
+ */
+ void setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline);
+
+ /**
+ * Return a new baseline table for the given baseline based
+ * on the current baseline table.
+ * @param baselineIdentifier the baseline identifer
+ * @return a new baseline with the new baseline
+ */
+ ScaledBaselineTable deriveScaledBaselineTable(int baselineIdentifier);
+
+}
--- /dev/null
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.layoutmgr.inline;
+
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fonts.Font;
+
+
+/**
+ * A factory class for making alignment contexts.
+ * Currently supports alignment contexts for basic fonts
+ * and graphic inlines.
+ */
+public class ScaledBaselineTableFactory implements Constants {
+
+ /**
+ * Creates a new instance of BasicScaledBaselineTable for the given
+ * font, baseline and writingmode.
+ * @param font the font for which a baseline table is requested
+ * @param dominantBaselineIdentifier the dominant baseline given as an integer constant
+ * @param writingMode the writing mode given as an integer constant
+ * @return a scaled baseline table for the given font
+ */
+ public static ScaledBaselineTable makeFontScaledBaselineTable(Font font
+ , int dominantBaselineIdentifier
+ , int writingMode) {
+ return new BasicScaledBaselineTable(font.getAscender(), font.getDescender()
+ , font.getXHeight(), dominantBaselineIdentifier, writingMode);
+ }
+
+ /**
+ * Creates a new instance of BasicScaledBaselineTable for the given
+ * font and writingmode. It assumes an alphabetic baseline.
+ * @param font the font for which a baseline table is requested
+ * @param writingMode the writing mode given as an integer constant
+ * @return a scaled baseline table for the given font
+ */
+ public static ScaledBaselineTable makeFontScaledBaselineTable(Font font, int writingMode) {
+ return makeFontScaledBaselineTable(font, EN_ALPHABETIC, writingMode);
+ }
+
+ /**
+ * Creates a new instance of BasicScaledBaselineTable for the given
+ * height, baseline and writingmode. This is used for non font based areas like
+ * external graphic or inline foreign object.
+ * @param height the height for which a baseline table is requested
+ * @param dominantBaselineIdentifier the dominant baseline given as an integer constant
+ * @param writingMode the writing mode given as an integer constant
+ * @return a scaled baseline table for the given dimensions
+ */
+ public static ScaledBaselineTable makeGraphicsScaledBaselineTable(int height
+ , int dominantBaselineIdentifier
+ , int writingMode) {
+ return new BasicScaledBaselineTable(height, 0, height
+ , dominantBaselineIdentifier, writingMode);
+ }
+
+}
import java.util.LinkedList;
import java.util.ListIterator;
+import org.apache.fop.area.Trait;
+import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fonts.Font;
-import org.apache.fop.layoutmgr.KnuthSequence;
import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.KnuthElement;
import org.apache.fop.layoutmgr.KnuthGlue;
import org.apache.fop.layoutmgr.KnuthPenalty;
+import org.apache.fop.layoutmgr.KnuthSequence;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.TraitSetter;
-import org.apache.fop.traits.SpaceVal;
-import org.apache.fop.area.Trait;
-import org.apache.fop.area.inline.InlineArea;
-import org.apache.fop.area.inline.TextArea;
import org.apache.fop.traits.MinOptMax;
+import org.apache.fop.traits.SpaceVal;
/**
* LayoutManager for text (a sequence of characters) which generates one
ipdArea = ipd;
bHyphenated = bHyph;
}
+
+ public String toString() {
+ return "[ lscnt=" + iLScount
+ + ", wscnt=" + iWScount
+ + ", ipd=" + ipdArea.toString()
+ + ", sidx=" + iStartIndex
+ + ", bidx=" + iBreakIndex
+ + ", hyph=" + bHyphenated
+ + "]";
+ }
+
}
// this class stores information about changes in vecAreaInfo
private ArrayList vecAreaInfo;
/** Non-space characters on which we can end a line. */
- private static final String BREAK_CHARS = "-/" ;
+ private static final String BREAK_CHARS = "-/";
private FOText foText;
private char[] textArray;
// byte order mark
private static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF';
+ private Font font = null;
/** Start index of first character in this parent Area */
private short iAreaStart = 0;
/** Start index of next TextArea */
private SpaceVal halfWS;
/** Number of space characters after previous possible break position. */
private int iNbSpacesPending;
- private Font fs;
private boolean bChanged = false;
private int iReturnedIndex = 0;
private short iTempStart = 0;
private LinkedList changeList = null;
- private int textHeight;
- private int lead = 0;
- private int total = 0;
- private int middle = 0;
- private int verticalAlignment = EN_BASELINE;
+ private AlignmentContext alignmentContext = null;
+
+ private int lineStartBAP = 0;
+ private int lineEndBAP = 0;
+
/**
* Create a Text layout manager.
*
vecAreaInfo = new java.util.ArrayList();
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager#initialize */
public void initialize() {
- fs = foText.getCommonFont().getFontState(foText.getFOEventHandler().getFontInfo(), this);
+ font = foText.getCommonFont().getFontState(foText.getFOEventHandler().getFontInfo(), this);
// With CID fonts, space isn't neccesary currentFontState.width(32)
- spaceCharIPD = fs.getCharWidth(' ');
+ spaceCharIPD = font.getCharWidth(' ');
// Use hyphenationChar property
- hyphIPD = fs.getCharWidth(foText.getCommonHyphenation().hyphenationCharacter);
+ hyphIPD = font.getCharWidth(foText.getCommonHyphenation().hyphenationCharacter);
// Make half-space: <space> on either side of a word-space)
SpaceVal ls = SpaceVal.makeLetterSpacing(foText.getLetterSpacing());
- SpaceVal ws = SpaceVal.makeWordSpacing(foText.getWordSpacing(), ls, fs);
+ SpaceVal ws = SpaceVal.makeWordSpacing(foText.getWordSpacing(), ls, font);
halfWS = new SpaceVal(MinOptMax.multiply(ws.getSpace(), 0.5),
ws.isConditional(), ws.isForcing(), ws.getPrecedence());
letterSpaceIPD = ls.getSpace();
wordSpaceIPD = MinOptMax.add(new MinOptMax(spaceCharIPD), ws.getSpace());
- // set text height
- textHeight = fs.getAscender()
- - fs.getDescender();
-
// if the text node is son of an inline, set vertical align
if (foText.getParent() instanceof Inline) {
- setAlignment(((Inline) foText.getParent()).getVerticalAlign());
- }
- switch (verticalAlignment) {
- case EN_MIDDLE : middle = textHeight / 2 ;
- break;
- case EN_TOP : // fall through
- case EN_BOTTOM : total = textHeight;
- break;
- case EN_BASELINE: // fall through
- default : lead = fs.getAscender();
- total = textHeight;
- break;
+ Inline fobj = (Inline)foText.getParent();
}
}
+ "LM mismatch!!!");
}
LeafPosition tbp = (LeafPosition) prevPos;
- AreaInfo ai =
- (AreaInfo) vecAreaInfo.get(tbp.getLeafPos());
+ AreaInfo ai = (AreaInfo) vecAreaInfo.get(tbp.getLeafPos());
if (ai.iBreakIndex != iNextStart) {
iNextStart = ai.iBreakIndex;
vecAreaInfo.ensureCapacity(tbp.getLeafPos() + 1);
for (; iNextStart < iStopIndex; iNextStart++) {
char c = textArray[iNextStart];
- hyphIPD.opt += fs.getCharWidth(c);
+ hyphIPD.opt += font.getCharWidth(c);
// letter-space?
}
// Need to include hyphen size too, but don't count it in the
// the line ends at a character like "/" or "-";
// remove the letter space after the last character
realWidth.add(MinOptMax.multiply(letterSpaceIPD, -1));
- iLScount --;
+ iLScount--;
}
// Make an area containing all characters between start and end.
adjust);
}
textArea.setIPD(width.opt + adjust);
- textArea.setBPD(fs.getAscender() - fs.getDescender());
- int bpd = textArea.getBPD();
- switch (verticalAlignment) {
- case EN_MIDDLE:
- textArea.setOffset(context.getMiddleBaseline() + fs.getXHeight() / 2);
- break;
- case EN_TOP:
- textArea.setOffset(context.getTopBaseline() + fs.getAscender());
- break;
- case EN_BOTTOM:
- textArea.setOffset(context.getBottomBaseline() - bpd + fs.getAscender());
- break;
- case EN_BASELINE:
- default:
- textArea.setOffset(context.getBaseline());
- break;
+ textArea.setBPD(font.getAscender() - font.getDescender());
+ textArea.setBaselineOffset(font.getAscender());
+ if (textArea.getBPD() == alignmentContext.getHeight()) {
+ textArea.setOffset(0);
+ } else {
+ textArea.setOffset(alignmentContext.getOffset());
}
textArea.setTextArea(str);
- textArea.addTrait(Trait.FONT_NAME, fs.getFontName());
- textArea.addTrait(Trait.FONT_SIZE, new Integer(fs.getFontSize()));
+ textArea.addTrait(Trait.FONT_NAME, font.getFontName());
+ textArea.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
textArea.addTrait(Trait.COLOR, foText.getColor());
TraitSetter.addTextDecoration(textArea, foText.getTextDecoration());
return textArea;
}
- /**
- * Set the alignment of the inline area.
- * @param al the vertical alignment positioning
- */
- public void setAlignment(int al) {
- verticalAlignment = al;
- }
+ /** @see LayoutManager#getNextKnuthElements(LayoutContext, int) */
+ public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
+ lineStartBAP = context.getLineStartBorderAndPaddingWidth();
+ lineEndBAP = context.getLineEndBorderAndPaddingWidth();
+ alignmentContext = context.getAlignmentContext();
- public LinkedList getNextKnuthElements(LayoutContext context,
- int alignment) {
LinkedList returnList = new LinkedList();
KnuthSequence sequence = new KnuthSequence(true);
AreaInfo ai = null;
// create the elements
sequence.addAll
- (createElementsForASpace(alignment, ai, vecAreaInfo.size() - 1));
+ (createElementsForASpace(alignment, ai, vecAreaInfo.size() - 1));
// advance to the next character
- iNextStart ++;
+ iNextStart++;
} else if (textArray[iNextStart] == NEWLINE) {
// linefeed; this can happen when linefeed-treatment="preserve"
// add a penalty item to the list and start a new sequence
+ if (lineEndBAP != 0) {
+ sequence.add
+ (new KnuthGlue(lineEndBAP, 0, 0,
+ new LeafPosition(this, -1), true));
+ }
sequence.add
(new KnuthPenalty(0, -KnuthElement.INFINITE,
false, null, false));
returnList.add(sequence);
// advance to the next character
- iNextStart ++;
+ iNextStart++;
} else {
// the beginning of a word
iThisStart = iNextStart;
&& !(iTempStart > iNextStart
&& BREAK_CHARS.indexOf(textArray[iTempStart - 1]) >= 0);
iTempStart++) {
- wordIPD.add(fs.getCharWidth(textArray[iTempStart]));
+ wordIPD.add(font.getCharWidth(textArray[iTempStart]));
}
int iLetterSpaces = iTempStart - iThisStart - 1;
// if the last character is '-' or '/' and the next one
&& iTempStart < textArray.length
&& textArray[iTempStart] != SPACE
&& textArray[iTempStart] != NBSPACE) {
- iLetterSpaces ++;
+ iLetterSpaces++;
}
wordIPD.add(MinOptMax.multiply(letterSpaceIPD, iLetterSpaces));
}
}
+ /** @see InlineLevelLayoutManager#addALetterSpaceTo(List) */
public List addALetterSpaceTo(List oldList) {
// old list contains only a box, or the sequence: box penalty glue box;
// look at the Position stored in the first element in oldList
KnuthElement el = (KnuthElement)oldListIterator.next();
LeafPosition pos = (LeafPosition) ((KnuthBox) el).getPosition();
AreaInfo ai = (AreaInfo) vecAreaInfo.get(pos.getLeafPos());
- ai.iLScount ++;
+ ai.iLScount++;
ai.ipdArea.add(letterSpaceIPD);
if (BREAK_CHARS.indexOf(textArray[iTempStart - 1]) >= 0) {
// the last character could be used as a line break
new LeafPosition(this, -1), false));
} else if (letterSpaceIPD.min == letterSpaceIPD.max) {
// constant letter space: replace the box
- oldListIterator.set(new KnuthInlineBox(ai.ipdArea.opt, lead, total, middle, pos, false));
+ oldListIterator.set(new KnuthInlineBox(ai.ipdArea.opt, alignmentContext, pos, false));
} else {
// adjustable letter space: replace the glue
oldListIterator.next(); // this would return the penalty element
}
}
+ /** @see InlineLevelLayoutManager#hyphenate(Position, HyphContext) */
public void hyphenate(Position pos, HyphContext hc) {
AreaInfo ai
= (AreaInfo) vecAreaInfo.get(((LeafPosition) pos).getLeafPos());
for (int i = iStartIndex; i < iStopIndex; i++) {
char c = textArray[i];
- newIPD.add(new MinOptMax(fs.getCharWidth(c)));
+ newIPD.add(new MinOptMax(font.getCharWidth(c)));
}
// add letter spaces
boolean bIsWordEnd
}
}
+ /** @see InlineLevelLayoutManager#applyChanges(List) */
public boolean applyChanges(List oldList) {
setFinished(false);
while (changeListIterator.hasNext()) {
currChange = (PendingChange) changeListIterator.next();
if (currChange.index != iOldIndex) {
- iRemovedAI ++;
- iAddedAI ++;
+ iRemovedAI++;
+ iAddedAI++;
iOldIndex = currChange.index;
vecAreaInfo.remove(currChange.index + iAddedAI - iRemovedAI);
vecAreaInfo.add(currChange.index + iAddedAI - iRemovedAI,
currChange.ai);
} else {
- iAddedAI ++;
+ iAddedAI++;
vecAreaInfo.add(currChange.index + iAddedAI - iRemovedAI,
currChange.ai);
}
return bChanged;
}
+ /** @see org.aapache.fop.layoutmgr.LayoutManager#getChangedKnuthElements(List, int) */
public LinkedList getChangedKnuthElements(List oldList,
int alignment) {
if (isFinished()) {
returnList.addAll
(createElementsForASpace(alignment, ai, iReturnedIndex));
}
- iReturnedIndex ++;
+ iReturnedIndex++;
} // end of while
setFinished(true);
return returnList;
}
+ /** @see InlineLevelLayoutManager#getWordChars(StringBuffer, Position) */
public void getWordChars(StringBuffer sbChars, Position pos) {
int iLeafValue = ((LeafPosition) pos).getLeafPos();
if (iLeafValue != -1) {
// if the second element is chosen as a line break these elements
// add a constant amount of stretch at the end of a line and at the
// beginning of the next one, otherwise they don't add any stretch
+ /*
spaceElements.add
(new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
new LeafPosition(this, -1), false));
spaceElements.add
(new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
new LeafPosition(this, -1), false));
+ */
+ spaceElements.add
+ (new KnuthGlue(lineEndBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), true));
+ spaceElements.add
+ (new KnuthPenalty(0,
+ (textArray[ai.iStartIndex] == NBSPACE ? KnuthElement.INFINITE : 0),
+ false, new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt - (lineStartBAP + lineEndBAP),
+ -6 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ mainPosition, false));
+ spaceElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), true));
+ spaceElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), true));
+ spaceElements.add
+ (new KnuthGlue(lineStartBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), true));
break;
case EN_START : // fall through
// if the second element is chosen as a line break these elements
// add a constant amount of stretch at the end of a line, otherwise
// they don't add any stretch
+ /*
spaceElements.add
(new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
new LeafPosition(this, -1), false));
(new KnuthGlue(ai.ipdArea.opt,
- 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
mainPosition, false));
+ */
+ if (lineStartBAP != 0 || lineEndBAP != 0) {
+ spaceElements.add
+ (new KnuthGlue(lineEndBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthPenalty(0, 0, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt - (lineStartBAP + lineEndBAP),
+ -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ mainPosition, false));
+ spaceElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), false));
+ spaceElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(lineStartBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ } else {
+ spaceElements.add
+ (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthPenalty(0, 0, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt,
+ -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ mainPosition, false));
+ }
break;
case EN_JUSTIFY:
// justified text:
// the stretch and shrink depends on the space width
+ /*
spaceElements.add
(new KnuthGlue(ai.ipdArea.opt,
ai.ipdArea.max - ai.ipdArea.opt,
ai.ipdArea.opt - ai.ipdArea.min,
mainPosition, false));
+ */
+ if (lineStartBAP != 0 || lineEndBAP != 0) {
+ spaceElements.add
+ (new KnuthGlue(lineEndBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthPenalty(0, 0, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt - (lineStartBAP + lineEndBAP),
+ ai.ipdArea.max - ai.ipdArea.opt,
+ ai.ipdArea.opt - ai.ipdArea.min,
+ mainPosition, false));
+ spaceElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), false));
+ spaceElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(lineStartBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ } else {
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt,
+ ai.ipdArea.max - ai.ipdArea.opt,
+ ai.ipdArea.opt - ai.ipdArea.min,
+ mainPosition, false));
+ }
break;
default:
// last line justified, the other lines unjustified:
// use only the space stretch
+ /*
spaceElements.add
(new KnuthGlue(ai.ipdArea.opt,
ai.ipdArea.max - ai.ipdArea.opt, 0,
mainPosition, false));
+ */
+ if (lineStartBAP != 0 || lineEndBAP != 0) {
+ spaceElements.add
+ (new KnuthGlue(lineEndBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthPenalty(0, 0, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt - (lineStartBAP + lineEndBAP),
+ ai.ipdArea.max - ai.ipdArea.opt, 0,
+ mainPosition, false));
+ spaceElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), false));
+ spaceElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), false));
+ spaceElements.add
+ (new KnuthGlue(lineStartBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ } else {
+ spaceElements.add
+ (new KnuthGlue(ai.ipdArea.opt,
+ ai.ipdArea.max - ai.ipdArea.opt, 0,
+ mainPosition, false));
+ }
}
return spaceElements;
// if the last character of the word fragment is '-' or '/',
// the fragment could end a line; in this case, it loses one
// of its letter spaces;
- boolean bSuppressibleLetterSpace =
- ai.iLScount == (ai.iBreakIndex - ai.iStartIndex)
- && BREAK_CHARS.indexOf(textArray[ai.iBreakIndex - 1]) >= 0;
+ boolean bSuppressibleLetterSpace
+ = ai.iLScount == (ai.iBreakIndex - ai.iStartIndex)
+ && BREAK_CHARS.indexOf(textArray[ai.iBreakIndex - 1]) >= 0;
if (letterSpaceWidth.min == letterSpaceWidth.max) {
// constant letter spacing
wordElements.add
- (new KnuthInlineBox(
- bSuppressibleLetterSpace ?
- ai.ipdArea.opt - letterSpaceWidth.opt :
- ai.ipdArea.opt,
- lead, total, middle,
- mainPosition, false));
+ (new KnuthInlineBox(
+ bSuppressibleLetterSpace
+ ? ai.ipdArea.opt - letterSpaceWidth.opt
+ : ai.ipdArea.opt,
+ alignmentContext,
+ notifyPos(mainPosition), false));
} else {
// adjustable letter spacing
- int unsuppressibleLetterSpaces = bSuppressibleLetterSpace ?
- ai.iLScount - 1 :
- ai.iLScount;
+ int unsuppressibleLetterSpaces
+ = bSuppressibleLetterSpace ? ai.iLScount - 1 : ai.iLScount;
wordElements.add
- (new KnuthInlineBox(ai.ipdArea.opt
- - ai.iLScount * letterSpaceWidth.opt,
- lead, total, middle,
- mainPosition, false));
+ (new KnuthInlineBox(ai.ipdArea.opt
+ - ai.iLScount * letterSpaceWidth.opt,
+ alignmentContext,
+ notifyPos(mainPosition), false));
wordElements.add
- (new KnuthPenalty(0, KnuthElement.INFINITE, false,
- new LeafPosition(this, -1), true));
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), true));
wordElements.add
- (new KnuthGlue(unsuppressibleLetterSpaces * letterSpaceWidth.opt,
- unsuppressibleLetterSpaces * (letterSpaceWidth.max - letterSpaceWidth.opt),
- unsuppressibleLetterSpaces * (letterSpaceWidth.opt - letterSpaceWidth.min),
- new LeafPosition(this, -1), true));
+ (new KnuthGlue(unsuppressibleLetterSpaces * letterSpaceWidth.opt,
+ unsuppressibleLetterSpaces * (letterSpaceWidth.max - letterSpaceWidth.opt),
+ unsuppressibleLetterSpaces * (letterSpaceWidth.opt - letterSpaceWidth.min),
+ new LeafPosition(this, -1), true));
wordElements.add
- (new KnuthInlineBox(0, 0, 0, 0,
- new LeafPosition(this, -1), true));
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), true));
}
// extra-elements if the word fragment is the end of a syllable,
// otherwise there is one more letter space
wordElements.addAll(createElementsForAHyphen(alignment, 0, letterSpaceWidth));
}
-
return wordElements;
}
switch (alignment) {
case EN_CENTER :
// centered text:
+ /*
hyphenElements.add
- (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, -1), false));
+ (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthPenalty(widthIfBreakOccurs,
- KnuthPenalty.FLAGGED_PENALTY, true,
- new LeafPosition(this, -1), false));
+ (new KnuthPenalty(hyphIPD,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthGlue(widthIfNoBreakOccurs.opt,
- - 6 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, -1), false));
+ (new KnuthGlue(0,
+ - 6 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthInlineBox(0, 0, 0, 0,
- new LeafPosition(this, -1), false));
+ (new KnuthInlineBox(0, 0, 0, 0,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthPenalty(0, KnuthElement.INFINITE, true,
- new LeafPosition(this, -1), false));
+ (new KnuthPenalty(0, KnuthElement.INFINITE, true,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, -1), false));
+ (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ */
+ hyphenElements.add
+ (new KnuthGlue(lineEndBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), true));
+ hyphenElements.add
+ (new KnuthPenalty(hyphIPD,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthGlue(-(lineEndBAP + lineStartBAP),
+ -6 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), true));
+ hyphenElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), true));
+ hyphenElements.add
+ (new KnuthGlue(lineStartBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), true));
break;
case EN_START : // fall through
case EN_END :
// left- or right-aligned text:
+ /*
hyphenElements.add
- (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, -1), false));
+ (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthPenalty(widthIfBreakOccurs,
- KnuthPenalty.FLAGGED_PENALTY, true,
- new LeafPosition(this, -1), false));
+ (new KnuthPenalty(widthIfBreakOccurs,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
hyphenElements.add
- (new KnuthGlue(widthIfNoBreakOccurs.opt,
- - 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
- new LeafPosition(this, -1), false));
+ (new KnuthGlue(widthIfNoBreakOccurs.opt,
+ - 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ */
+ if (lineStartBAP != 0 || lineEndBAP != 0) {
+ hyphenElements.add
+ (new KnuthGlue(lineEndBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthPenalty(widthIfBreakOccurs,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthGlue(widthIfNoBreakOccurs.opt - (lineStartBAP + lineEndBAP),
+ -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), false));
+ hyphenElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthGlue(lineStartBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ } else {
+ hyphenElements.add
+ (new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthPenalty(widthIfBreakOccurs,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthGlue(widthIfNoBreakOccurs.opt,
+ -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0,
+ new LeafPosition(this, -1), false));
+ }
break;
default:
// justified text, or last line justified:
// just a flagged penalty
+ /*
hyphenElements.add
- (new KnuthPenalty(widthIfBreakOccurs,
- KnuthPenalty.FLAGGED_PENALTY, true,
- new LeafPosition(this, -1), false));
- // extra elements representing a letter space that is suppressed
- // if a break occurs
- if (widthIfNoBreakOccurs.min != 0
- || widthIfNoBreakOccurs.max != 0) {
- hyphenElements.add
- (new KnuthGlue(widthIfNoBreakOccurs.opt,
- widthIfNoBreakOccurs.max - widthIfNoBreakOccurs.opt,
- widthIfNoBreakOccurs.opt - widthIfNoBreakOccurs.min,
+ (new KnuthPenalty(widthIfBreakOccurs,
+ KnuthPenalty.FLAGGED_PENALTY, true,
new LeafPosition(this, -1), false));
+ */
+ if (lineStartBAP != 0 || lineEndBAP != 0) {
+ hyphenElements.add
+ (new KnuthGlue(lineEndBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthPenalty(widthIfBreakOccurs,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
+ // extra elements representing a letter space that is suppressed
+ // if a break occurs
+ if (widthIfNoBreakOccurs.min != 0
+ || widthIfNoBreakOccurs.max != 0) {
+ hyphenElements.add
+ (new KnuthGlue(widthIfNoBreakOccurs.opt - (lineStartBAP + lineEndBAP),
+ widthIfNoBreakOccurs.max - widthIfNoBreakOccurs.opt,
+ widthIfNoBreakOccurs.opt - widthIfNoBreakOccurs.min,
+ new LeafPosition(this, -1), false));
+ } else {
+ hyphenElements.add
+ (new KnuthGlue(-(lineStartBAP + lineEndBAP), 0, 0,
+ new LeafPosition(this, -1), false));
+ }
+ hyphenElements.add
+ (new KnuthInlineBox(0, null,
+ notifyPos(new LeafPosition(this, -1)), false));
+ hyphenElements.add
+ (new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ new LeafPosition(this, -1), false));
+ hyphenElements.add
+ (new KnuthGlue(lineStartBAP, 0, 0,
+ new LeafPosition(this, -1), false));
+ } else {
+ hyphenElements.add
+ (new KnuthPenalty(widthIfBreakOccurs,
+ KnuthPenalty.FLAGGED_PENALTY, true,
+ new LeafPosition(this, -1), false));
+ // extra elements representing a letter space that is suppressed
+ // if a break occurs
+ if (widthIfNoBreakOccurs.min != 0
+ || widthIfNoBreakOccurs.max != 0) {
+ hyphenElements.add
+ (new KnuthGlue(widthIfNoBreakOccurs.opt,
+ widthIfNoBreakOccurs.max - widthIfNoBreakOccurs.opt,
+ widthIfNoBreakOccurs.opt - widthIfNoBreakOccurs.min,
+ new LeafPosition(this, -1), false));
+ }
}
}
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.InlineBlockParent;
+import org.apache.fop.area.inline.InlineParent;
+import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.Constants;
}
}
+ /**
+ * Common method to render the background and borders for any inline area.
+ * The all borders and padding are drawn outside the specified area.
+ * @param area the inline area for which the background, border and padding is to be
+ * rendered
+ */
+ protected void renderInlineAreaBackAndBorders(InlineArea area) {
+ float x = currentIPPosition / 1000f;
+ float y = (currentBPPosition + area.getOffset()) / 1000f;
+ float width = area.getIPD() / 1000f;
+ float height = area.getBPD() / 1000f;
+ float borderPaddingStart = area.getBorderAndPaddingWidthStart() / 1000f;
+ float borderPaddingBefore = area.getBorderAndPaddingWidthBefore() / 1000f;
+ float bpwidth = borderPaddingStart
+ + (area.getBorderAndPaddingWidthEnd() / 1000f);
+ float bpheight = borderPaddingBefore
+ + (area.getBorderAndPaddingWidthAfter() / 1000f);
+
+ if (height != 0.0f || bpheight != 0.0f && bpwidth != 0.0f) {
+ drawBackAndBorders(area, x, y - borderPaddingBefore
+ , width + bpwidth
+ , height + bpheight);
+ }
+
+ }
+
+ /** @see org.apache.fop.render.AbstractRenderer#renderInlineSpace(Space) */
+ protected void renderInlineSpace(Space space) {
+ space.setBPD(0);
+ renderInlineAreaBackAndBorders(space);
+ super.renderInlineSpace(space);
+ }
+
+ /** @see org.apache.fop.render.AbstractRenderer#renderInlineParent(InlineParent) */
+ protected void renderInlineParent(InlineParent ip) {
+ renderInlineAreaBackAndBorders(ip);
+ super.renderInlineParent(ip);
+ }
+
/** @see org.apache.fop.render.AbstractRenderer */
protected void renderInlineBlockParent(InlineBlockParent ibp) {
- float start = currentIPPosition / 1000f;
- float top = (ibp.getOffset() + currentBPPosition) / 1000f;
- float width = ibp.getIPD() / 1000f;
- float height = ibp.getBPD() / 1000f;
- drawBackAndBorders(ibp, start, top, width, height);
-
+ renderInlineAreaBackAndBorders(ibp);
super.renderInlineBlockParent(ibp);
}
*/
protected void renderLineArea(LineArea line) {
List children = line.getInlineAreas();
-
+ int saveBP = currentBPPosition;
+ currentBPPosition += line.getSpaceBefore();
for (int count = 0; count < children.size(); count++) {
InlineArea inline = (InlineArea) children.get(count);
renderInlineArea(inline);
}
+ currentBPPosition = saveBP;
}
+ /**
+ * Render the given InlineArea.
+ * @param inlineArea inline area text to render
+ */
protected void renderInlineArea(InlineArea inlineArea) {
if (inlineArea instanceof TextArea) {
renderText((TextArea) inlineArea);
}
+ /**
+ * Render the given Character.
+ * @param ch the character to render
+ */
protected void renderCharacter(Character ch) {
currentIPPosition += ch.getAllocIPD();
}
+ /**
+ * Render the given Space.
+ * @param space the space to render
+ */
protected void renderInlineSpace(Space space) {
// an inline space moves the inline progression position
// for the current block by the width or height of the space
currentIPPosition += space.getAllocIPD();
}
+ /**
+ * Render the given Leader.
+ * @param area the leader to render
+ */
protected void renderLeader(Leader area) {
currentIPPosition += area.getAllocIPD();
}
+ /**
+ * Render the given TextArea.
+ * @param text the text to render
+ */
protected void renderText(TextArea text) {
currentIPPosition += text.getAllocIPD();
}
+ /**
+ * Render the given InlineParent.
+ * @param ip the inline parent to render
+ */
protected void renderInlineParent(InlineParent ip) {
int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+ currentIPPosition += ip.getBorderAndPaddingWidthStart();
+ currentBPPosition += ip.getOffset();
Iterator iter = ip.getChildAreas().iterator();
while (iter.hasNext()) {
renderInlineArea((InlineArea) iter.next());
}
currentIPPosition = saveIP + ip.getAllocIPD();
+ currentBPPosition = saveBP;
}
+ /**
+ * Render the given InlineBlockParent.
+ * @param ibp the inline block parent to render
+ */
protected void renderInlineBlockParent(InlineBlockParent ibp) {
// For inline content the BP position is updated by the enclosing line area
int saveBP = currentBPPosition;
currentBPPosition = saveBP;
}
+ /**
+ * Render the given Viewport.
+ * @param viewport the viewport to render
+ */
protected void renderViewport(Viewport viewport) {
Area content = viewport.getContent();
int saveBP = currentBPPosition;
public void renderText(TextArea text) {
float x = currentIPPosition;
- float y = currentBPPosition + text.getOffset(); // baseline
+ float y = currentBPPosition + text.getOffset() + text.getBaselineOffset(); // baseline
String name = (String) text.getTrait(Trait.FONT_NAME);
int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
public void renderCharacter(Character ch) {
float x = currentIPPosition;
- float y = currentBPPosition + ch.getOffset(); // baseline
+ float y = currentBPPosition + ch.getOffset() + ch.getBaselineOffset(); // baseline
String name = (String) ch.getTrait(Trait.FONT_NAME);
int size = ((Integer) ch.getTrait(Trait.FONT_SIZE)).intValue();
public void renderInlineParent(InlineParent ip) {
float start = currentIPPosition / 1000f;
float top = (ip.getOffset() + currentBPPosition) / 1000f;
+
float width = ip.getIPD() / 1000f;
float height = ip.getBPD() / 1000f;
- drawBackAndBorders(ip, start, top, width, height);
-
// render contents
super.renderInlineParent(ip);
* @see org.apache.fop.render.AbstractRenderer#renderCharacter(Character)
*/
public void renderCharacter(Character ch) {
+ renderInlineAreaBackAndBorders(ch);
+
beginTextObject();
StringBuffer pdf = new StringBuffer();
// word.getOffset() = only height of text itself
// currentBlockIPPosition: 0 for beginning of line; nonzero
// where previous line area failed to take up entire allocated space
- int rx = currentIPPosition;
- int bl = currentBPPosition + ch.getOffset();
+ int rx = currentIPPosition + ch.getBorderAndPaddingWidthStart();
+ int bl = currentBPPosition + ch.getOffset() + ch.getBaselineOffset();
/* System.out.println("Text = " + ch.getTextArea() +
"; text width: " + ch.getWidth() +
* @see org.apache.fop.render.AbstractRenderer#renderText(TextArea)
*/
public void renderText(TextArea text) {
+ renderInlineAreaBackAndBorders(text);
beginTextObject();
StringBuffer pdf = new StringBuffer();
// word.getOffset() = only height of text itself
// currentBlockIPPosition: 0 for beginning of line; nonzero
// where previous line area failed to take up entire allocated space
- int rx = currentIPPosition;
- int bl = currentBPPosition + text.getOffset();
+ int rx = currentIPPosition + text.getBorderAndPaddingWidthStart();
+ int bl = currentBPPosition + text.getOffset() + text.getBaselineOffset();
/* System.out.println("Text = " + text.getTextArea() +
"; text width: " + text.getWidth() +
* @param area the leader area to render
*/
public void renderLeader(Leader area) {
+ renderInlineAreaBackAndBorders(area);
+
+ currentState.push();
saveGraphicsState();
int style = area.getRuleStyle();
boolean alt = false;
alt = true;
break;
}
- float startx = ((float) currentIPPosition) / 1000f;
- float starty = ((currentBPPosition + area.getOffset()) / 1000f);
- float endx = (currentIPPosition + area.getIPD()) / 1000f;
+ float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
+ float starty = (currentBPPosition + area.getOffset()) / 1000f;
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ + area.getIPD()) / 1000f;
+ // PDF draws lines centered on the Y coordiante, therefore we need to
+ // add half of the line thickness to the Y positions.
if (!alt) {
updateLineWidth(area.getRuleThickness() / 1000f);
- drawLine(startx, starty, endx, starty);
+ drawLine(startx, starty + area.getRuleThickness() / 2000f
+ , endx, starty + area.getRuleThickness() / 2000f);
} else {
if (style == EN_DOUBLE) {
float third = area.getRuleThickness() / 3000f;
updateLineWidth(third);
- drawLine(startx, starty, endx, starty);
+ drawLine(startx, starty + 0.5f * third, endx, starty + 0.5f * third);
- drawLine(startx, (starty + 2 * third), endx, (starty + 2 * third));
+ drawLine(startx, (starty + 2.5f * third), endx, (starty + 2.5f * third));
} else {
float half = area.getRuleThickness() / 2000f;
}
restoreGraphicsState();
+ currentState.pop();
beginTextObject();
super.renderLeader(area);
}
}
private void renderText(AbstractTextArea area, String text) {
+ renderInlineAreaBackAndBorders(area);
String fontname = (String)area.getTrait(Trait.FONT_NAME);
int fontsize = area.getTraitAsInteger(Trait.FONT_SIZE);
//Determine position
int rx = currentIPPosition;
- int bl = currentBPPosition + area.getOffset();
+ int bl = currentBPPosition + area.getOffset() + area.getBaselineOffset();
useFont(fontname, fontsize);
ColorType ct = (ColorType)area.getTrait(Trait.COLOR);
/** @see org.apache.fop.render.AbstractRenderer */
protected void renderInlineParent(InlineParent ip) {
- float start = currentIPPosition / 1000f;
- float top = (ip.getOffset() + currentBPPosition) / 1000f;
- float width = ip.getIPD() / 1000f;
- float height = ip.getBPD() / 1000f;
- drawBackAndBorders(ip, start, top, width, height);
-
super.renderInlineParent(ip);
}
public void renderText(TextArea text) {
Element textElement = SVGUtilities.createText(svgDocument,
currentIPPosition / 1000,
- (currentBPPosition + text.getOffset()) / 1000,
+ (currentBPPosition + text.getOffset()
+ + text.getBaselineOffset()) / 1000,
text.getTextArea());
currentPageG.appendChild(textElement);
public void renderCharacter(org.apache.fop.area.inline.Character ch) {
Element text = SVGUtilities.createText(svgDocument,
currentIPPosition / 1000,
- (currentBPPosition + ch.getOffset()) / 1000,
+ (currentBPPosition + ch.getOffset()
+ + ch.getBaselineOffset()) / 1000,
"" + ch.getChar());
currentPageG.appendChild(text);
if (line.getStartIndent() != 0) {
addAttribute("start-indent", line.getStartIndent());
}
- addAttribute("vpos", currentBPPosition);
startElement("lineArea", atts);
super.renderLineArea(line);
endElement("lineArea");
*/
protected void renderCharacter(org.apache.fop.area.inline.Character ch) {
atts.clear();
+ addAreaAttributes(ch);
addTraitAttributes(ch);
- addAttribute("vpos", ch.getOffset());
+ addAttribute("offset", ch.getOffset());
+ addAttribute("baseline", ch.getBaselineOffset());
startElement("char", atts);
characters(ch.getChar());
endElement("char");
protected void renderInlineSpace(Space space) {
atts.clear();
addAreaAttributes(space);
+ addTraitAttributes(space);
+ addAttribute("offset", space.getOffset());
startElement("space", atts);
endElement("space");
}
if (text.getTextLetterSpaceAdjust() != 0) {
addAttribute("tlsadjust", text.getTextLetterSpaceAdjust());
}
- addAttribute("vpos", text.getOffset());
+ addAttribute("offset", text.getOffset());
+ addAttribute("baseline", text.getBaselineOffset());
addAreaAttributes(text);
addTraitAttributes(text);
startElement("text", atts);
atts.clear();
addAreaAttributes(ip);
addTraitAttributes(ip);
+ addAttribute("offset", ip.getOffset());
startElement("inlineparent", atts);
super.renderInlineParent(ip);
endElement("inlineparent");
case EN_RIDGE:
style = "ridge";
break;
+ case EN_NONE:
+ style = "none";
+ break;
default:
style = "--NYI--";
}
atts.clear();
addAreaAttributes(area);
+ addTraitAttributes(area);
+ addAttribute("offset", area.getOffset());
addAttribute("ruleStyle", style);
addAttribute("ruleThickness", area.getRuleThickness());
startElement("leader", atts);
-character_background-image.xml
block-container_reference-orientation_bug36391.xml
+block_font-family_asian.xml
block_font-stretch.xml
block_padding_2.xml
block_space-before_space-after_2.xml
external-graphic_oversized.xml
inline-block_keep-together.xml
inline_block_nested_3.xml
-inline_border_padding.xml
+inline_border_padding_block_nested.xml
inline-container_block_nested.xml
inline-container_border_padding.xml
inline_letter-spacing.xml
page-breaking_4.xml
page-breaking_6.xml
page-height_indefinite_simple.xml
+page-number-citation_background-image.xml
page-number-citation_complex_1.xml
page-number-citation_complex_2.xml
page-number_initial-page-number_2.xml
</fo>
<checks>
<eval expected="197376" xpath="//flow/block/lineArea/inlineparent/@ipd"/>
- <eval expected="92100" xpath="//flow/block/lineArea/inlineparent/@bpd"/>
- <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=75648,vertical=23010" xpath="//flow/block/lineArea/inlineparent/@background"/>
+ <eval expected="88800" xpath="//flow/block/lineArea/inlineparent/@bpd"/>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=75648,vertical=21360" xpath="//flow/block/lineArea/inlineparent/@background"/>
</checks>
</testcase>
<skip>3</skip>
</element-list>
- <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/>
- <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/>
- <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/>
- <eval expected="14400" xpath="//flow/block[4]/lineArea/@bpd"/>
- <eval expected="14400" xpath="//flow/block[5]/lineArea/@bpd"/>
- <eval expected="14400" xpath="//flow/block[6]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[5]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[6]/lineArea/@bpd"/>
- <eval expected="10266" xpath="//flow/block[1]/lineArea/text/@vpos"/>
- <eval expected="10266" xpath="//flow/block[2]/lineArea/text/@vpos"/>
- <eval expected="10266" xpath="//flow/block[3]/lineArea/text/@vpos"/>
- <eval expected="10266" xpath="//flow/block[4]/lineArea/text/@vpos"/>
- <eval expected="10266" xpath="//flow/block[5]/lineArea/inlineparent/text/@vpos"/>
- <eval expected="10266" xpath="//flow/block[6]/lineArea/char/@vpos"/>
+ <eval expected="0" xpath="//flow/block[1]/lineArea/text/@offset"/>
+ <eval expected="8616" xpath="//flow/block[1]/lineArea/text/@baseline"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea/text/@offset"/>
+ <eval expected="8616" xpath="//flow/block[2]/lineArea/text/@baseline"/>
+ <eval expected="0" xpath="//flow/block[3]/lineArea/text/@offset"/>
+ <eval expected="8616" xpath="//flow/block[3]/lineArea/text/@baseline"/>
+ <eval expected="0" xpath="//flow/block[4]/lineArea/text/@offset"/>
+ <eval expected="8616" xpath="//flow/block[4]/lineArea/text/@baseline"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea/inlineparent/@offset"/>
+ <eval expected="8616" xpath="//flow/block[5]/lineArea/inlineparent/text/@baseline"/>
+ <eval expected="0" xpath="//flow/block[6]/lineArea/char/@offset"/>
+ <eval expected="8616" xpath="//flow/block[6]/lineArea/char/@baseline"/>
</checks>
</testcase>
</fo:root>
</fo>
<checks>
- <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/>
- <eval expected="17280" xpath="//flow/block[1]/block[1]/lineArea/@bpd"/>
- <eval expected="12000" xpath="//flow/block[1]/block[2]/lineArea/@bpd"/>
- <eval expected="18000" xpath="//flow/block[2]/lineArea/@bpd"/>
- <eval expected="18000" xpath="//flow/block[2]/block[1]/lineArea/@bpd"/>
- <eval expected="18000" xpath="//flow/block[2]/block[2]/lineArea/@bpd"/>
- <eval expected="20000" xpath="//flow/block[3]/lineArea/@bpd"/>
- <eval expected="20000" xpath="//flow/block[3]/block[1]/lineArea/@bpd"/>
- <eval expected="20000" xpath="//flow/block[3]/block[2]/lineArea/@bpd"/>
- <eval expected="18000" xpath="//flow/block[4]/lineArea/@bpd"/>
- <eval expected="21600" xpath="//flow/block[4]/block[1]/lineArea/@bpd"/>
- <eval expected="15000" xpath="//flow/block[4]/block[2]/lineArea/@bpd"/>
- <eval expected="13000" xpath="//flow/block[5]/lineArea/@bpd"/>
- <eval expected="13000" xpath="//flow/block[5]/block[1]/lineArea/@bpd"/>
- <eval expected="13000" xpath="//flow/block[5]/block[2]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpda"/>
+ <eval expected="1650" xpath="//flow/block[1]/lineArea/@space-before"/>
+ <eval expected="1650" xpath="//flow/block[1]/lineArea/@space-after"/>
+ <eval expected="13319" xpath="//flow/block[1]/block[1]/lineArea/@bpd"/>
+ <eval expected="17279" xpath="//flow/block[1]/block[1]/lineArea/@bpda"/>
+ <eval expected="1980" xpath="//flow/block[1]/block[1]/lineArea/@space-before"/>
+ <eval expected="1980" xpath="//flow/block[1]/block[1]/lineArea/@space-after"/>
+ <eval expected="9250" xpath="//flow/block[1]/block[2]/lineArea/@bpd"/>
+ <eval expected="12000" xpath="//flow/block[1]/block[2]/lineArea/@bpda"/>
+ <eval expected="1375" xpath="//flow/block[1]/block[2]/lineArea/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[1]/block[2]/lineArea/@space-after"/>
+
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="18000" xpath="//flow/block[2]/lineArea/@bpda"/>
+ <eval expected="3450" xpath="//flow/block[2]/lineArea/@space-before"/>
+ <eval expected="3450" xpath="//flow/block[2]/lineArea/@space-after"/>
+ <eval expected="13319" xpath="//flow/block[2]/block[1]/lineArea/@bpd"/>
+ <eval expected="17999" xpath="//flow/block[2]/block[1]/lineArea/@bpda"/>
+ <eval expected="2340" xpath="//flow/block[2]/block[1]/lineArea/@space-before"/>
+ <eval expected="2340" xpath="//flow/block[2]/block[1]/lineArea/@space-after"/>
+ <eval expected="9250" xpath="//flow/block[2]/block[2]/lineArea/@bpd"/>
+ <eval expected="18000" xpath="//flow/block[2]/block[2]/lineArea/@bpda"/>
+ <eval expected="4375" xpath="//flow/block[2]/block[2]/lineArea/@space-before"/>
+ <eval expected="4375" xpath="//flow/block[2]/block[2]/lineArea/@space-after"/>
+
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="20000" xpath="//flow/block[3]/lineArea/@bpda"/>
+ <eval expected="4450" xpath="//flow/block[3]/lineArea/@space-before"/>
+ <eval expected="4450" xpath="//flow/block[3]/lineArea/@space-after"/>
+ <eval expected="13319" xpath="//flow/block[3]/block[1]/lineArea/@bpd"/>
+ <eval expected="19999" xpath="//flow/block[3]/block[1]/lineArea/@bpda"/>
+ <eval expected="3340" xpath="//flow/block[3]/block[1]/lineArea/@space-before"/>
+ <eval expected="3340" xpath="//flow/block[3]/block[1]/lineArea/@space-after"/>
+ <eval expected="9250" xpath="//flow/block[3]/block[2]/lineArea/@bpd"/>
+ <eval expected="20000" xpath="//flow/block[3]/block[2]/lineArea/@bpda"/>
+ <eval expected="5375" xpath="//flow/block[3]/block[2]/lineArea/@space-before"/>
+ <eval expected="5375" xpath="//flow/block[3]/block[2]/lineArea/@space-after"/>
+
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
+ <eval expected="18000" xpath="//flow/block[4]/lineArea/@bpda"/>
+ <eval expected="3450" xpath="//flow/block[4]/lineArea/@space-before"/>
+ <eval expected="3450" xpath="//flow/block[4]/lineArea/@space-after"/>
+ <eval expected="13319" xpath="//flow/block[4]/block[1]/lineArea/@bpd"/>
+ <eval expected="21599" xpath="//flow/block[4]/block[1]/lineArea/@bpda"/>
+ <eval expected="4140" xpath="//flow/block[4]/block[1]/lineArea/@space-before"/>
+ <eval expected="4140" xpath="//flow/block[4]/block[1]/lineArea/@space-after"/>
+ <eval expected="9250" xpath="//flow/block[4]/block[2]/lineArea/@bpd"/>
+ <eval expected="15000" xpath="//flow/block[4]/block[2]/lineArea/@bpda"/>
+ <eval expected="2875" xpath="//flow/block[4]/block[2]/lineArea/@space-before"/>
+ <eval expected="2875" xpath="//flow/block[4]/block[2]/lineArea/@space-after"/>
+
+ <eval expected="11100" xpath="//flow/block[5]/lineArea/@bpd"/>
+ <eval expected="13000" xpath="//flow/block[5]/lineArea/@bpda"/>
+ <eval expected="950" xpath="//flow/block[5]/lineArea/@space-before"/>
+ <eval expected="950" xpath="//flow/block[5]/lineArea/@space-after"/>
+ <eval expected="13319" xpath="//flow/block[5]/block[1]/lineArea/@bpd"/>
+ <eval expected="13001" xpath="//flow/block[5]/block[1]/lineArea/@bpda"/>
+ <eval expected="-159" xpath="//flow/block[5]/block[1]/lineArea/@space-before"/>
+ <eval expected="-159" xpath="//flow/block[5]/block[1]/lineArea/@space-after"/>
+ <eval expected="9250" xpath="//flow/block[5]/block[2]/lineArea/@bpd"/>
+ <eval expected="13000" xpath="//flow/block[5]/block[2]/lineArea/@bpda"/>
+ <eval expected="1875" xpath="//flow/block[5]/block[2]/lineArea/@space-before"/>
+ <eval expected="1875" xpath="//flow/block[5]/block[2]/lineArea/@space-after"/>
</checks>
</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:character with background-color property.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver">
+ To <fo:character background-color="yellow" character="e" />mphasize a character highlight it.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="color=#ffff00" xpath="//flow/block[1]/lineArea/char/@background"/>
+ </checks>
+</testcase>
<testcase>
<info>
<p>
- This test checks background image on a character.
+ This test checks fo:character with background-image property.
</p>
</info>
<variables>
</fo:layout-master-set>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
- <fo:block>
- <fo:character font-size="96pt" character="A" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
+ <fo:block font-size="24pt">
+ <fo:character font-size="96pt" character="A" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
+ <fo:character font-size="48pt" character="g" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</fo>
<checks>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=8976,vertical=21360" xpath="//flow/block[1]/lineArea/char[1]/@background"/>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=-9696,vertical=-840" xpath="//flow/block[1]/lineArea/char[2]/@background"/>
</checks>
</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:character with border and padding properties.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
+ To <fo:character border="solid 1pt red" background-color="yellow" character="e"/>mphasize a letter we give it a 1pt border.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
+ To really <fo:character border="solid 5pt red" padding="5pt" background-color="yellow" character="e"/>mphasize a letter we give it a 5pt border and padding.
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
+ To <fo:character border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt" background-color="yellow" character="c"/>onfuse give it unsymmetric borders and padding.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt" font-size="20pt">
+ Big <fo:character border="solid 5pt red" padding="5pt" background-color="yellow" font-size="8pt" character="b"/>order but a smaller font.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea/char/@baseline"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea/char/@offset"/>
+ <eval expected="5560" xpath="//flow/block[2]/lineArea/char/@ipd"/>
+ <eval expected="7560" xpath="//flow/block[2]/lineArea/char/@ipda"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/char/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/char/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/char/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/char/@border-start"/>
+
+ <eval expected="7180" xpath="//flow/block[5]/lineArea/char/@baseline"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea/char/@offset"/>
+ <eval expected="5560" xpath="//flow/block[5]/lineArea/char/@ipd"/>
+ <eval expected="25560" xpath="//flow/block[5]/lineArea/char/@ipda"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/char/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/char/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/char/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/char/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/char/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/char/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/char/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/char/@padding-start"/>
+
+ <eval expected="7180" xpath="//flow/block[8]/lineArea/char/@baseline"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/char/@offset"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea/char/@ipd"/>
+ <eval expected="17000" xpath="//flow/block[8]/lineArea/char/@ipda"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[8]/lineArea/char/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea/char/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[8]/lineArea/char/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[8]/lineArea/char/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea/char/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea/char/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea/char/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[8]/lineArea/char/@padding-start"/>
+
+ <eval expected="5744" xpath="//flow/block[11]/lineArea/char/@baseline"/>
+ <eval expected="8616" xpath="//flow/block[11]/lineArea/char/@offset"/>
+ <eval expected="4448" xpath="//flow/block[11]/lineArea/char/@ipd"/>
+ <eval expected="24448" xpath="//flow/block[11]/lineArea/char/@ipda"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/char/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/char/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/char/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/char/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/char/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/char/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/char/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/char/@padding-start"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:character with vertical-align property.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ vertical-align<fo:character font-size="10pt" background-color="yellow" character="=" />not specified
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ vertical-align<fo:character font-size="10pt" vertical-align="baseline" background-color="yellow" character="=" />baseline
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ vertical-align<fo:character font-size="10pt" vertical-align="top" background-color="yellow" character="=" />top
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ vertical-align<fo:character font-size="10pt" vertical-align="middle" background-color="yellow" character="=" />middle
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ vertical-align<fo:character font-size="10pt" vertical-align="bottom" background-color="yellow" character="=" />bottom
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea/char/@offset"/>
+ <eval expected="7180" xpath="//flow/block[5]/lineArea/char/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/char/@offset"/>
+ <eval expected="4565" xpath="//flow/block[11]/lineArea/char/@offset"/>
+ <eval expected="9250" xpath="//flow/block[14]/lineArea/char/@offset"/>
+ </checks>
+</testcase>
<eval expected="46080" xpath="//flow/block[1]/lineArea/viewport/@ipd"/>
<eval expected="46080" xpath="//flow/block[1]/lineArea/viewport/@bpd"/>
<eval expected="96080" xpath="//flow/block[1]/lineArea/viewport/@bpda"/>
- <eval expected="1650" xpath="//flow/block[1]/lineArea/viewport/@offset"/>
+ <eval expected="0" xpath="//flow/block[1]/lineArea/viewport/@offset"/>
<eval expected="20000 30000 20000 30000" xpath="//flow/block[1]/lineArea/viewport/@bap"/>
<eval expected="color=#ffffff" xpath="//flow/block[1]/lineArea/viewport/@background"/>
<eval expected="(solid,#000000,5000)" xpath="//flow/block[1]/lineArea/viewport/@border-before"/>
<eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@ipd"/>
<eval expected="46080" xpath="//flow/block[2]/lineArea/viewport/@bpd"/>
<eval expected="96080" xpath="//flow/block[2]/lineArea/viewport/@bpda"/>
- <eval expected="23690" xpath="//flow/block[2]/lineArea/viewport/@offset"/>
+ <eval expected="4440" xpath="//flow/block[2]/lineArea/viewport/@offset"/>
<eval expected="20000 30000 20000 30000" xpath="//flow/block[2]/lineArea/viewport/@bap"/>
<eval expected="color=#ffffff" xpath="//flow/block[2]/lineArea/viewport/@background"/>
<eval expected="(solid,#000000,5000)" xpath="//flow/block[2]/lineArea/viewport/@border-before"/>
<!-- the footnote -->
<eval expected="360000" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@ipd"/>
<eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@bpd"/>
- <eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/@bpd"/>
<eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/inlineparent/text"/>
<eval expected="6000" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/inlineparent/text/@font-size"/>
<eval expected="I'm a footnote!" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/text[1]"/>
<eval expected="360000" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@ipd"/>
<eval expected="3" xpath="count(//pageViewport[1]/page/regionViewport/regionBody/footnote/block)"/>
<eval expected="7400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@bpd"/>
- <eval expected="7200" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/block[1]/lineArea/@bpd"/>
+ <eval expected="5550" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/block[1]/lineArea/@bpd"/>
<eval expected="I'm a block serving as a footnote separator. I'm on page 1." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/block[1]/lineArea"/>
<eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[2]/@bpd"/>
- <eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[2]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[2]/lineArea/@bpd"/>
<eval expected="1I'm a footnote!" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[2]/lineArea"/>
<eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[3]/@bpd"/>
- <eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[3]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[3]/lineArea/@bpd"/>
<eval expected="2I'm another footnote!" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[3]/lineArea"/>
<!-- page break checks -->
<eval expected="filling 10..." xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea"/>
<eval expected="2" xpath="count(//pageViewport[3]/page/regionViewport/regionBody/footnote/block)"/>
<eval expected="360000" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[1]/@ipd"/>
<eval expected="7400" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[1]/@bpd"/>
- <eval expected="7200" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[1]/block[1]/lineArea/@bpd"/>
+ <eval expected="5550" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[1]/block[1]/lineArea/@bpd"/>
<eval expected="I'm a block serving as a footnote separator. I'm on page 3." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[1]/block[1]/lineArea"/>
<eval expected="14400" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[2]/@bpd"/>
- <eval expected="14400" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[2]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[2]/lineArea/@bpd"/>
<eval expected="I come from an empty block at the end of the flow!" xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote/block[2]/lineArea"/>
</checks>
</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level alignment-adjust.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" background-color="yellow">alignment-adjust not specified</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="auto" background-color="yellow">alignment-adjust="auto"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="baseline" background-color="yellow">alignment-adjust="baseline"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="before-edge" background-color="yellow">alignment-adjust="before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="text-before-edge" background-color="yellow">alignment-adjust="text-before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="central" background-color="yellow">alignment-adjust="central"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="middle" background-color="yellow">alignment-adjust="middle"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="after-edge" background-color="yellow">alignment-adjust="after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="text-after-edge" background-color="yellow">alignment-adjust="text-after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="ideographic" background-color="yellow">alignment-adjust="ideographic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="alphabetic" background-color="yellow">alignment-adjust="alphabetic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="hanging" background-color="yellow">alignment-adjust="hanging"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="mathematical" background-color="yellow">alignment-adjust="mathematical"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="top" background-color="yellow">alignment-adjust="top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="bottom" background-color="yellow">alignment-adjust="bottom"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="text-top" background-color="yellow">alignment-adjust="text-top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="text-bottom" background-color="yellow">alignment-adjust="text-bottom"</fo:inline> After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="10052" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="10052" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="5427" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="5487" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="802" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="802" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="802" xpath="//flow/block[29]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[32]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="8616" xpath="//flow/block[35]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="6462" xpath="//flow/block[38]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="10052" xpath="//flow/block[41]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="802" xpath="//flow/block[44]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="10052" xpath="//flow/block[47]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="802" xpath="//flow/block[50]/lineArea[1]/inlineparent/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level alignment-adjust.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="0pt" background-color="yellow">alignment-adjust="0pt"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="0%" background-color="yellow">alignment-adjust="0%"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="3pt" background-color="yellow">alignment-adjust="3pt"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="-3pt" background-color="yellow">alignment-adjust="-3pt"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="30%" background-color="yellow">alignment-adjust="30%"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-adjust="-30%" background-color="yellow">alignment-adjust="-30%"</fo:inline> After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[2]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[2]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[5]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[5]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="13078" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[8]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[8]/lineArea[1]/@space-after"/>
+ <eval expected="128" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="128" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="15122" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[11]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[11]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5872" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="13678" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[14]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[14]/lineArea[1]/@space-after"/>
+ <eval expected="728" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="728" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="15722" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[17]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[17]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="6472" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level alignment-baseline.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" background-color="yellow">alignment-baseline not specified</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="auto" background-color="yellow">alignment-baseline="auto"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="baseline" background-color="yellow">alignment-baseline="baseline"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="before-edge" background-color="yellow">alignment-baseline="before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="text-before-edge" background-color="yellow">alignment-baseline="text-before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="central" background-color="yellow">alignment-baseline="central"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="middle" background-color="yellow">alignment-baseline="middle"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="after-edge" background-color="yellow">alignment-baseline="after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="text-after-edge" background-color="yellow">alignment-baseline="text-after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="ideographic" background-color="yellow">alignment-baseline="ideographic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="alphabetic" background-color="yellow">alignment-baseline="alphabetic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="hanging" background-color="yellow">alignment-baseline="hanging"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="mathematical" background-color="yellow">alignment-baseline="mathematical"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="top" background-color="yellow">alignment-baseline="top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="bottom" background-color="yellow">alignment-baseline="bottom"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="text-top" background-color="yellow">alignment-baseline="text-top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before <fo:inline font-size="10pt" alignment-baseline="text-bottom" background-color="yellow">alignment-baseline="text-bottom"</fo:inline> After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="1850" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="1826" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[29]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[32]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="574" xpath="//flow/block[35]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="1436" xpath="//flow/block[38]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[41]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[44]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[47]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[50]/lineArea[1]/inlineparent/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level alignment-baseline.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" background-color="yellow">alignment-baseline not specified</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="auto" background-color="yellow">alignment-baseline="auto"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="baseline" background-color="yellow">alignment-baseline="baseline"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="before-edge" background-color="yellow">alignment-baseline="before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="text-before-edge" background-color="yellow">alignment-baseline="text-before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="central" background-color="yellow">alignment-baseline="central"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="middle" background-color="yellow">alignment-baseline="middle"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="after-edge" background-color="yellow">alignment-baseline="after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="text-after-edge" background-color="yellow">alignment-baseline="text-after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="ideographic" background-color="yellow">alignment-baseline="ideographic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="alphabetic" background-color="yellow">alignment-baseline="alphabetic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="hanging" background-color="yellow">alignment-baseline="hanging"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="mathematical" background-color="yellow">alignment-baseline="mathematical"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="top" background-color="yellow">alignment-baseline="top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="bottom" background-color="yellow">alignment-baseline="bottom"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="text-top" background-color="yellow">alignment-baseline="text-top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ Before <fo:inline font-size="14pt" alignment-baseline="text-bottom" background-color="yellow">alignment-baseline="text-bottom"</fo:inline> After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="2872" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="1850" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1850" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="1826" xpath="//flow/block[20]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1826" xpath="//flow/block[20]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="3700" xpath="//flow/block[26]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[26]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="3700" xpath="//flow/block[29]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[29]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="2872" xpath="//flow/block[32]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[32]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="574" xpath="//flow/block[35]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="574" xpath="//flow/block[35]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="1436" xpath="//flow/block[38]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1436" xpath="//flow/block[38]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[41]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[41]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[44]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[44]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[47]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[47]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="3700" xpath="//flow/block[50]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[50]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level alignment-baseline.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" background-color="yellow">alignment-baseline not specified</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="auto" background-color="yellow">alignment-baseline="auto"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="baseline" background-color="yellow">alignment-baseline="baseline"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="before-edge" background-color="yellow">alignment-baseline="before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="text-before-edge" background-color="yellow">alignment-baseline="text-before-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="central" background-color="yellow">alignment-baseline="central"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="middle" background-color="yellow">alignment-baseline="middle"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="after-edge" background-color="yellow">alignment-baseline="after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="text-after-edge" background-color="yellow">alignment-baseline="text-after-edge"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="ideographic" background-color="yellow">alignment-baseline="ideographic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="alphabetic" background-color="yellow">alignment-baseline="alphabetic"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="hanging" background-color="yellow">alignment-baseline="hanging"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="mathematical" background-color="yellow">alignment-baseline="mathematical"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="top" background-color="yellow">alignment-baseline="top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="bottom" background-color="yellow">alignment-baseline="bottom"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="text-top" background-color="yellow">alignment-baseline="text-top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ <fo:inline font-size="14pt">B</fo:inline>efore <fo:inline font-size="10pt" alignment-baseline="text-bottom" background-color="yellow">alignment-baseline="text-bottom"</fo:inline> After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[8]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="1436" xpath="//flow/block[14]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="2361" xpath="//flow/block[17]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="2349" xpath="//flow/block[20]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[23]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="3286" xpath="//flow/block[26]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="3286" xpath="//flow/block[29]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[32]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="1723" xpath="//flow/block[35]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="2154" xpath="//flow/block[38]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[41]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[44]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="1436" xpath="//flow/block[47]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="3286" xpath="//flow/block[50]/lineArea[1]/inlineparent[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level alignment-baseline for nested inlines.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" font-family="sans-serif">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ background-color="yellow">alphabetic
+ <fo:inline font-size="150%" background-color="red">alphabetic</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ dominant-baseline="reset-size"
+ background-color="yellow">alphabetic
+ <fo:inline font-size="150%" background-color="red">alphabetic</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ alignment-baseline="hanging"
+ background-color="yellow">hanging
+ <fo:inline font-size="50%" background-color="red" alignment-baseline="middle">middle</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ dominant-baseline="reset-size"
+ alignment-baseline="hanging"
+ background-color="yellow">hanging
+ <fo:inline font-size="50%" background-color="red" alignment-baseline="middle">middle</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ alignment-baseline="text-before-edge"
+ background-color="yellow">text-before-edge
+ <fo:inline font-size="150%" background-color="red" alignment-baseline="after-edge">after-edge</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ dominant-baseline="reset-size"
+ alignment-baseline="text-before-edge"
+ background-color="yellow">text-before-edge
+ <fo:inline font-size="150%" background-color="red" alignment-baseline="after-edge">after-edge</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="25%"
+ alignment-baseline="central"
+ background-color="yellow">central
+ <fo:inline font-size="150%"
+ alignment-baseline="text-before-edge"
+ background-color="red">text-before-edge
+ <fo:inline font-size="200%" background-color="green">alphabetic</fo:inline>
+ </fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="25%"
+ dominant-baseline="reset-size"
+ alignment-baseline="central"
+ background-color="yellow">central
+ <fo:inline font-size="150%"
+ alignment-baseline="text-before-edge"
+ background-color="red">text-before-edge
+ <fo:inline font-size="200%" background-color="green">alphabetic</fo:inline>
+ </fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="25%"
+ dominant-baseline="reset-size"
+ alignment-baseline="central"
+ background-color="yellow">central
+ <fo:inline font-size="150%"
+ dominant-baseline="reset-size"
+ alignment-baseline="text-before-edge"
+ background-color="red">text-before-edge
+ <fo:inline font-size="200%" background-color="green">alphabetic</fo:inline>
+ </fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">Baseline table changed twice</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="24pt">Big
+ <fo:inline font-size="50%"
+ dominant-baseline="reset-size"
+ alignment-baseline="before-edge"
+ background-color="yellow">before-edge
+ <fo:inline font-size="150%" background-color="red" alignment-baseline="after-edge">after-edge</fo:inline>
+ </fo:inline>
+ Big <fo:inline font-size="8pt">This is over constraint</fo:inline>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="22200" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-4308" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22200" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-4308" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22200" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1723" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="6494" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22200" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1723" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="2739" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22200" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="5550" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="27750" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="5550" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5550" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-5550" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="5550" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22200" xpath="//flow/block[20]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="8325" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-8325" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="4308" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22491" xpath="//flow/block[23]/lineArea[1]/@bpd"/>
+ <eval expected="291" xpath="//flow/block[23]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="8616" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="-8616" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/text[2]/@offset"/>
+ <eval expected="291" xpath="//flow/block[23]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22200" xpath="//flow/block[26]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="8325" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="-6462" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="27750" xpath="//flow/block[29]/lineArea[1]/@bpd"/>
+ <eval expected="5550" xpath="//flow/block[29]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-5550" xpath="//flow/block[29]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="5550" xpath="//flow/block[29]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:inline with background-color properties.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ To <fo:inline background-color="yellow">emphasize a phrase</fo:inline> highlight it.
+ </fo:block>
+ <fo:block background-color="silver" text-align="end" margin="1pt 0pt 1pt 0pt">
+ To <fo:inline background-color="yellow">emphasize a phrase</fo:inline> highlight it with text-align="end".
+ </fo:block>
+ <fo:block background-color="silver" text-align="justify" margin="1pt 0pt 1pt 0pt">
+ To <fo:inline background-color="yellow">emphasize a phrase</fo:inline> highlight it with text-align="justify".
+ </fo:block>
+ <fo:block background-color="silver" text-align="center" margin="1pt 0pt 1pt 0pt">
+ To <fo:inline background-color="yellow">emphasize a phrase</fo:inline> highlight it with text-align="center".
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt">
+ This demonstrates a long inline
+ <fo:inline background-color="yellow">which stretches over multiple lines to
+ show how the highlight extends from line to line while
+ correctly honouring the text-align (not specified) property</fo:inline>
+ back to normal
+ </fo:block>
+ <fo:block background-color="silver" text-align="end" margin="1pt 0pt 1pt 0pt">
+ This demonstrates a long inline
+ <fo:inline background-color="yellow">which stretches over multiple lines to
+ show how the highlight extends from line to line while
+ correctly honouring the text-align="end" property</fo:inline>
+ back to normal
+ </fo:block>
+ <fo:block background-color="silver" text-align="justify" margin="1pt 0pt 1pt 0pt">
+ This demonstrates a long inline
+ <fo:inline background-color="yellow">which stretches over multiple lines to
+ show how the highlight extends from line to line while
+ correctly honouring the text-align="justify" property</fo:inline>
+ back to normal
+ </fo:block>
+ <fo:block background-color="silver" text-align="center" margin="1pt 0pt 1pt 0pt">
+ This demonstrates a long inline
+ <fo:inline background-color="yellow">which stretches over multiple lines to
+ show how the highlight extends from line to line while
+ correctly honouring the text-align="center" property</fo:inline>
+ back to normal
+ </fo:block>
+ <fo:block background-color="silver" text-align="center" margin="1pt 0pt 1pt 0pt">
+ Nested inline highlights
+ <fo:inline background-color="yellow" font-size="10pt">this is 10pt text
+ <fo:inline font-size="14pt">nested within is 14pt text</fo:inline>
+ followed by 10pt text</fo:inline>
+ back to normal
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="90040" xpath="//flow/block[2]/lineArea/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[2]/lineArea/inlineparent/@background"/>
+
+ <eval expected="90040" xpath="//flow/block[5]/lineArea/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[5]/lineArea/inlineparent/@background"/>
+
+ <eval expected="90040" xpath="//flow/block[8]/lineArea/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[8]/lineArea/inlineparent/@background"/>
+
+ <eval expected="90040" xpath="//flow/block[11]/lineArea/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[11]/lineArea/inlineparent/@background"/>
+
+ <eval expected="188950" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[14]/lineArea[1]/inlineparent/@background"/>
+ <eval expected="313470" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[14]/lineArea[2]/inlineparent/@background"/>
+ <eval expected="145610" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[14]/lineArea[3]/inlineparent/@background"/>
+
+ <eval expected="188950" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[17]/lineArea[1]/inlineparent/@background"/>
+ <eval expected="313470" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[17]/lineArea[2]/inlineparent/@background"/>
+ <eval expected="109650" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[17]/lineArea[3]/inlineparent/@background"/>
+
+ <eval expected="199793" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[20]/lineArea[1]/inlineparent/@background"/>
+ <eval expected="350000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[20]/lineArea[2]/inlineparent/@background"/>
+ <eval expected="118530" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[20]/lineArea[3]/inlineparent/@background"/>
+
+ <eval expected="128370" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[23]/lineArea[1]/inlineparent/@background"/>
+ <eval expected="269560" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[23]/lineArea[2]/inlineparent/@background"/>
+ <eval expected="225250" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[23]/lineArea[3]/inlineparent/@background"/>
+
+ <eval expected="151184" xpath="//flow/block[26]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[26]/lineArea[1]/inlineparent/@background"/>
+ <eval expected="81704" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/@ipd"/>
+ <eval expected="161644" xpath="//flow/block[26]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[26]/lineArea[2]/inlineparent/@background"/>
+ <eval expected="67704" xpath="//flow/block[26]/lineArea[2]/inlineparent/inlineparent/@ipd"/>
+ </checks>
+</testcase>
</fo>
<checks>
<eval expected="197376" xpath="//flow/block/lineArea/inlineparent/@ipd"/>
- <eval expected="92100" xpath="//flow/block/lineArea/inlineparent/@bpd"/>
- <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=75648,vertical=23010" xpath="//flow/block/lineArea/inlineparent/@background"/>
+ <eval expected="88800" xpath="//flow/block/lineArea/inlineparent/@bpd"/>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=75648,vertical=21360" xpath="//flow/block/lineArea/inlineparent/@background"/>
</checks>
</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level baseline-shift.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="baseline"
+ background-color="yellow">baseline-shift="baseline"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="sub"
+ background-color="yellow">baseline-shift="sub"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="super"
+ background-color="yellow">baseline-shift="super"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="0pt"
+ background-color="yellow">baseline-shift="0pt"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="0%"
+ background-color="yellow">baseline-shift="0%"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="3pt"
+ background-color="yellow">baseline-shift="3pt"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="-3pt"
+ background-color="yellow">baseline-shift="-3pt"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="30%"
+ background-color="yellow">baseline-shift="30%"</fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="-30%"
+ background-color="yellow">baseline-shift="-30%"</fo:inline>
+ After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[2]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[2]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="14737" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[5]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[5]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5487" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="17400" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[8]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[8]/lineArea[1]/@space-after"/>
+ <eval expected="4450" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="4450" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[11]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[11]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[14]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[14]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="13078" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[17]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[17]/lineArea[1]/@space-after"/>
+ <eval expected="128" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="128" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="15122" xpath="//flow/block[20]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[20]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[20]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5872" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="15118" xpath="//flow/block[23]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[23]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[23]/lineArea[1]/@space-after"/>
+ <eval expected="2168" xpath="//flow/block[23]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2168" xpath="//flow/block[23]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="17162" xpath="//flow/block[26]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[26]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[26]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="7912" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level baseline-shift.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="sub"
+ background-color="yellow">sub
+ <fo:inline font-size="8pt"
+ baseline-shift="sub"
+ background-color="red">sub
+ </fo:inline>sub
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="sub"
+ background-color="yellow">sub
+ <fo:inline font-size="8pt"
+ baseline-shift="super"
+ background-color="red">super
+ </fo:inline>sub
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="super"
+ background-color="yellow">super
+ <fo:inline font-size="8pt"
+ baseline-shift="super"
+ background-color="red">super
+ </fo:inline>super
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="super"
+ background-color="yellow">super
+ <fo:inline font-size="8pt"
+ baseline-shift="sub"
+ background-color="red">sub
+ </fo:inline>super
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ baseline-shift="30%"
+ background-color="yellow">30%
+ <fo:inline font-size="8pt"
+ baseline-shift="-50%"
+ background-color="red">-50%
+ </fo:inline>30%
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="18pt"
+ baseline-shift="super"
+ background-color="yellow">super
+ <fo:inline font-size="24pt"
+ baseline-shift="sub"
+ background-color="red">sub
+ <fo:inline font-size="30pt"
+ baseline-shift="super"
+ background-color="green">super
+ </fo:inline>sub
+ </fo:inline>super
+ </fo:inline>
+ After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="16415" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5487" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="3528" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="14737" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5487" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-3794" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="21194" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="8244" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3794" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-3794" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="8244" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="17400" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="4450" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="3528" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="4450" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="15118" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="2168" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="7436" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="2168" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="39060" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="25086" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="14892" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="1968" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="-16860" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="25086" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level baseline-shift.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="middle"
+ dominant-baseline="middle"
+ background-color="yellow">middle
+ <fo:inline font-size="8pt"
+ baseline-shift="sub"
+ background-color="red">sub
+ </fo:inline>middle
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="middle"
+ dominant-baseline="middle"
+ background-color="yellow">middle
+ <fo:inline font-size="8pt"
+ baseline-shift="super"
+ background-color="red">super
+ </fo:inline>middle
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="text-after-edge"
+ dominant-baseline="text-after-edge"
+ background-color="yellow">text-after-edge
+ <fo:inline font-size="8pt"
+ baseline-shift="30%"
+ background-color="red">30%
+ </fo:inline>text-after-edge
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="text-before-edge"
+ dominant-baseline="text-before-edge"
+ background-color="yellow">text-before-edge
+ <fo:inline font-size="8pt"
+ baseline-shift="-50%"
+ background-color="red">-50%
+ </fo:inline>text-before-edge
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table changed</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="middle"
+ background-color="yellow">middle
+ <fo:inline font-size="8pt"
+ baseline-shift="sub"
+ background-color="red">sub
+ </fo:inline>middle
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="middle"
+ background-color="yellow">middle
+ <fo:inline font-size="8pt"
+ baseline-shift="super"
+ background-color="red">super
+ </fo:inline>middle
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="text-after-edge"
+ background-color="yellow">text-after-edge
+ <fo:inline font-size="8pt"
+ baseline-shift="30%"
+ background-color="red">30%
+ </fo:inline>text-after-edge
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ Before
+ <fo:inline font-size="10pt"
+ alignment-baseline="text-before-edge"
+ background-color="yellow">text-before-edge
+ <fo:inline font-size="8pt"
+ baseline-shift="-50%"
+ background-color="red">-50%
+ </fo:inline>text-before-edge
+ </fo:inline>
+ After <fo:inline font-size="8pt">Baseline table unchanged</fo:inline>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="14846" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1826" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="5620" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1826" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-1702" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-1750" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="13400" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="6000" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="1826" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="3528" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="14918" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="1968" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3794" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-3794" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="1968" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[20]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-2992" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="17708" xpath="//flow/block[23]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="10308" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level baseline-shift.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ baseline-shift="6pt"
+ background-color="yellow">6pt central
+ </fo:inline>
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ background-color="orange">central
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ baseline-shift="-6pt"
+ background-color="yellow">-6pt central
+ </fo:inline>
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ background-color="orange">central
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ baseline-shift="sub"
+ background-color="yellow">sub
+ <fo:inline font-size="150%"
+ alignment-baseline="text-before-edge"
+ background-color="red">text-before-edge
+ <fo:inline font-size="6pt"
+ background-color="green">Baseline unchanged</fo:inline>
+ </fo:inline>central
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ baseline-shift="super"
+ background-color="yellow">super
+ <fo:inline font-size="150%"
+ alignment-baseline="text-after-edge"
+ background-color="red">text-after-edge
+ <fo:inline font-size="6pt"
+ background-color="green">Baseline unchanged</fo:inline>
+ </fo:inline>central
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ baseline-shift="sub"
+ background-color="yellow">sub
+ <fo:inline font-size="150%"
+ dominant-baseline="text-before-edge"
+ background-color="red">text-before-edge
+ <fo:inline font-size="6pt"
+ background-color="green">Baseline changed</fo:inline>
+ </fo:inline>central
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ alignment-baseline="central"
+ baseline-shift="super"
+ background-color="yellow">super
+ <fo:inline font-size="150%"
+ dominant-baseline="text-after-edge"
+ background-color="red">text-after-edge
+ <fo:inline font-size="6pt"
+ background-color="green">Baseline changed</fo:inline>
+ </fo:inline>central
+ </fo:inline>
+ After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="17100" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="2300" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent[1]/text[1]/@offset"/>
+ <eval expected="6000" xpath="//flow/block[2]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent[2]/text[1]/@offset"/>
+ <eval expected="2300" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="17100" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="9700" xpath="//flow/block[5]/lineArea[1]/inlineparent[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[5]/lineArea[1]/inlineparent[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent[2]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="16892" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5792" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="1436" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="23168" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="8368" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="3700" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-3700" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="5136" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="8368" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="14800" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5792" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-2872" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="22340" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="7540" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="2872" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-2872" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="5550" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/inlineparent/text/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/text[2]/@offset"/>
+ <eval expected="7540" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
<fo>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
- <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
- <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
<fo:flow flow-name="xsl-region-body" font-size="10pt">
- <fo:block background-color="yellow" margin="0pt">
- Start of file
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
+ To <fo:inline border="solid 1pt red" background-color="yellow">emphasize</fo:inline> a word we give it a 1pt border and a background.
</fo:block>
- <fo:block background-color="silver" margin="0pt">
- Normal text <fo:inline border="solid 5pt red" padding="5pt" background-color="white">inline with border="solid 5pt red" padding="5pt"</fo:inline> normal finish
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
+ Demonstrates a big border <fo:inline border="solid 5pt red" padding="5pt" background-color="yellow">inline with border="solid 5pt red" padding="5pt"</fo:inline> extending over the small allocation rectangle to the top and bottom.
</fo:block>
- <fo:block background-color="yellow" margin="0pt">
- End of file
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
+ Demonstrates <fo:inline border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt" background-color="yellow">unsymmetric borders and padding</fo:inline> but the baselines should align.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt" font-size="20pt">
+ Big border <fo:inline border="solid 5pt red" padding="5pt" background-color="yellow" font-size="8pt">with a smaller font</fo:inline> but the baselines should align.
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ This demonstrates correct line breaking of a fo:inline because it does fit nicely..
+ This demonstrates correct line breaking of a fo:inline because it does fit <fo:inline border="solid 1pt red" padding-start="2pt" padding-end="2pt" background-color="yellow">nicely..
+ Not really as we started a fo:inline with border/padding just before the word "nicely" which forces it to the next line.</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Demonstrates nested
+ <fo:inline border="solid 2pt red" padding-start="2pt" padding-end="2pt" background-color="yellow">inlines
+ <fo:inline border="solid 1pt green" padding-start="2pt" padding-end="2pt" background-color="orange">finishing together
+ </fo:inline>
+ </fo:inline>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</fo>
<checks>
+ <eval expected="48350" xpath="//flow/block[2]/lineArea/inlineparent/@ipd"/>
+ <eval expected="50350" xpath="//flow/block[2]/lineArea/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/inlineparent/@border-start"/>
+
+ <eval expected="208190" xpath="//flow/block[5]/lineArea/inlineparent/@ipd"/>
+ <eval expected="228190" xpath="//flow/block[5]/lineArea/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/inlineparent/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/inlineparent/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/inlineparent/@padding-start"/>
+
+ <eval expected="151170" xpath="//flow/block[8]/lineArea/inlineparent/@ipd"/>
+ <eval expected="163170" xpath="//flow/block[8]/lineArea/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[8]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[8]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[8]/lineArea/inlineparent/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea/inlineparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea/inlineparent/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[8]/lineArea/inlineparent/@padding-start"/>
+
+ <eval expected="64464" xpath="//flow/block[11]/lineArea/inlineparent/@ipd"/>
+ <eval expected="84464" xpath="//flow/block[11]/lineArea/inlineparent/@ipda"/>
+ <eval expected="8616" xpath="//flow/block[11]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/inlineparent/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/inlineparent/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/inlineparent/@padding-start"/>
+
+ <eval expected="340710" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="343710" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="2000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-start"/>
+ <eval expected="193840" xpath="//flow/block[14]/lineArea[4]/inlineparent/@ipd"/>
+ <eval expected="196840" xpath="//flow/block[14]/lineArea[4]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[4]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[4]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[4]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[4]/inlineparent/@border-end"/>
+ <eval expected="2000" xpath="//flow/block[14]/lineArea[4]/inlineparent/@padding-end"/>
+
+ <eval expected="118830" xpath="//flow/block[17]/lineArea/inlineparent/@ipd"/>
+ <eval expected="126830" xpath="//flow/block[17]/lineArea/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[17]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[17]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[17]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[17]/lineArea/inlineparent/@border-start"/>
+ <eval expected="2000" xpath="//flow/block[17]/lineArea/inlineparent/@padding-end"/>
+ <eval expected="2000" xpath="//flow/block[17]/lineArea/inlineparent/@padding-start"/>
+ <eval expected="78930" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@ipd"/>
+ <eval expected="84930" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@offset"/>
+ <eval expected="(solid,#008000,1000)" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@border-after"/>
+ <eval expected="(solid,#008000,1000)" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@border-before"/>
+ <eval expected="(solid,#008000,1000)" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@border-end"/>
+ <eval expected="(solid,#008000,1000)" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@border-start"/>
+ <eval expected="2000" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@padding-end"/>
+ <eval expected="2000" xpath="//flow/block[17]/lineArea/inlineparent/inlineparent/@padding-start"/>
</checks>
</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:inlines with border and padding properties and nested inner blocks.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Before inline
+ <fo:inline border="solid 1pt red" padding="2pt" background-color="yellow"><fo:block>starting with a block</fo:block>
+ after block</fo:inline>
+ After inline
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Before inline
+ <fo:inline border="solid 1pt red" padding="2pt" background-color="yellow">before block
+ <fo:block>having a block at the end of an inline</fo:block></fo:inline>
+ After inline
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Before inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="2pt"
+ padding-end.length="2pt"
+ background-color="yellow">before block
+ <fo:block>As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:block>
+ after block</fo:inline>
+ After inline
+ </fo:block>
+ <!-- This test currently fails with a ClassCastException on this commented out block
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Before inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="2pt"
+ padding-start.conditionality="retain"
+ padding-end.length="2pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">before block
+ <fo:block>As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:block>
+ after block</fo:inline>
+ After inline with conditionality="retain"
+ </fo:block>
+ -->
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="347000" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@ipda"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@border-start"/>
+ <eval expected="2000" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@padding-after"/>
+ <eval expected="2000" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@padding-start"/>
+ <eval expected="48910" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="51910" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="1375" xpath="//flow/block[2]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="2000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="2000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-end"/>
+
+ <eval expected="54470" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="57470" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="1375" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="2000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="2000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="347000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-end"/>
+ <eval expected="2000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@padding-after"/>
+ <eval expected="2000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@padding-end"/>
+
+ <eval expected="54470" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="57470" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="1375" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@padding-before"/>
+ <eval expected="46130" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="49130" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="1375" xpath="//flow/block[8]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-end"/>
+
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:inlines with border and padding properties and conditionality.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align not set .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="end" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="justify" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align not set .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="end" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="justify" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" .conditionality="discard".
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="255100" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="265100" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="345720" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="45570" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="255100" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="265100" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="345720" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="45570" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="259229" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="269229" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="340000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="45570" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="216190" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="226190" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="299050" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="309050" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="111150" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="121150" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="255100" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="261100" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="335720" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="35570" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="39570" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="255100" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="261100" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="335720" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="35570" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="39570" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="262613" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="268613" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="350000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="35570" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="39570" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="216190" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="222190" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="310170" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="310170" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="100030" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="104030" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-end"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:inlines with border and padding properties and conditionality retain.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align not set padding .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="end" padding .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="justify" padding .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" padding .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center">
+ Multi-line fo:inline
+ <fo:inline border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow"
+ linefeed-treatment="preserve">As far as the laws of mathematics refer to reality,
+ they are not certain, and as far as they are certain,
+ they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" .conditionality="retain" linefeed-treatment="preserve".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow"
+ linefeed-treatment="preserve">As far as the laws of mathematics refer to reality,
+ they are not certain, and as far as they are certain,
+ they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" .conditionality="discard" linefeed-treatment="preserve".
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="255100" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="264100" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="343720" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="44570" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="255100" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="264100" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="343720" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="44570" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="260075" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="269075" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="342000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="44570" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="237870" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="246870" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="317940" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="325940" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="70580" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="79580" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="183960" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="193960" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="255680" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="265680" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="186750" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="196750" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="172840" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="178840" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="266800" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="266800" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="186750" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="190750" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-end"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:inlines with border and padding properties and hyphenation.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="start" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="start" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="end" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="justify" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" .conditionality="discard".
+ </fo:block>
+
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="start" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="start" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="end" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="justify" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">As far as the laws of mathematics refer to reality, they are not certain,
+ and as far as they are certain, they do not refer to reality - Albert Einstein</fo:inline>
+ text-align="center" .conditionality="retain".
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="255100" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="261100" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="335720" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="35570" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="39570" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="255100" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="261100" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="335720" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="35570" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="39570" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="262613" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="268613" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="35570" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="39570" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="216190" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="222190" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="310170" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="310170" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="100030" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="104030" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="255100" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="265100" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="345720" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="45570" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="255100" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="265100" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="335720" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="345720" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="45570" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="259229" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="269229" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="340000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="35570" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="45570" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="216190" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="226190" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="299050" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="309050" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="111150" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="121150" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-start"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inlines with border and padding properties and hyphenation.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="de">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="start" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="start" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="end" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="justify" .conditionality="discard".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-end-width.length="1pt"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-end.length="3pt"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="center" .conditionality="discard".
+ </fo:block>
+
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="start" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="start" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="end" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="end" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="justify" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="justify" .conditionality="retain".
+ </fo:block>
+ <fo:block background-color="silver" margin="3pt 0pt 3pt 0pt" text-align="center" hyphenate="true">
+ Multi-line fo:inline
+ <fo:inline
+ border="solid 1pt red"
+ border-start-width.length="1pt"
+ border-start-width.conditionality="retain"
+ border-end-width.length="1pt"
+ border-end-width.conditionality="retain"
+ padding="1pt"
+ padding-start.length="5pt"
+ padding-start.conditionality="retain"
+ padding-end.length="3pt"
+ padding-end.conditionality="retain"
+ background-color="yellow">Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
+ Donaudampfschiffahrtselektrizitaetenhauptbetriebswerkbauunterbeamtengesellschaft</fo:inline>
+ text-align="center" .conditionality="retain".
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="250110" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="256110" xpath="//flow/block[2]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[2]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="348490" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="348490" xpath="//flow/block[2]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="91710" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="95710" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="250110" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="256110" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="348490" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="348490" xpath="//flow/block[5]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="91710" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="95710" xpath="//flow/block[5]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="250110" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="256110" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="349999" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="349999" xpath="//flow/block[8]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="91710" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="95710" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="238440" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="244440" xpath="//flow/block[11]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="320690" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="320690" xpath="//flow/block[11]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="131180" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="135180" xpath="//flow/block[11]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[11]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[11]/lineArea[3]/inlineparent/@padding-end"/>
+
+ <eval expected="250110" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="260110" xpath="//flow/block[14]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="336820" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="346820" xpath="//flow/block[14]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="103380" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="113380" xpath="//flow/block[14]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[14]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[14]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="250110" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="260110" xpath="//flow/block[17]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="336820" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="346820" xpath="//flow/block[17]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="103380" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="113380" xpath="//flow/block[17]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[17]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[17]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="250110" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="260110" xpath="//flow/block[20]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="340000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="350000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="103380" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="113380" xpath="//flow/block[20]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[20]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[20]/lineArea[3]/inlineparent/@padding-start"/>
+
+ <eval expected="238440" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipd"/>
+ <eval expected="248440" xpath="//flow/block[23]/lineArea[1]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[1]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[1]/inlineparent/@padding-start"/>
+ <eval expected="320690" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipd"/>
+ <eval expected="330690" xpath="//flow/block[23]/lineArea[2]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[2]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[2]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[2]/inlineparent/@padding-start"/>
+ <eval expected="131180" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipd"/>
+ <eval expected="141180" xpath="//flow/block[23]/lineArea[3]/inlineparent/@ipda"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[3]/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[23]/lineArea[3]/inlineparent/@border-start"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-before"/>
+ <eval expected="3000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[23]/lineArea[3]/inlineparent/@padding-start"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level dominant-baseline.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="auto">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="auto"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="no-change">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="no-change"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="ideographic">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="ideographic"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="alphabetic">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="alphabetic"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="hanging">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="hanging"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="mathematical">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="mathematical"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="central">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="central"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="middle">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="middle"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="text-after-edge">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="text-after-edge"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="14pt">
+ <fo:inline dominant-baseline="text-before-edge">Before <fo:inline font-size="10pt" background-color="yellow">dominant-baseline="text-before-edge"</fo:inline> After</fo:inline>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[2]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[2]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[5]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[5]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[8]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[8]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[11]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[11]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="2872" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[14]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[14]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="574" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[17]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[17]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="1436" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[20]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[20]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[20]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="1850" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[23]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[23]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[23]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="1826" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[26]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[26]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[26]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3700" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[29]/lineArea[1]/@bpd"/>
+ <eval expected="1925" xpath="//flow/block[29]/lineArea[1]/@space-before"/>
+ <eval expected="1925" xpath="//flow/block[29]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level dominant-baseline.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="auto">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="auto"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="no-change">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="no-change"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="ideographic">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="ideographic"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="alphabetic">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="alphabetic"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="hanging">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="hanging"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="mathematical">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="mathematical"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="central">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="central"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="middle">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="middle"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="text-after-edge">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="text-after-edge"</fo:inline> After</fo:inline>
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="10pt">
+ <fo:inline dominant-baseline="text-before-edge">Before <fo:inline font-size="14pt" background-color="yellow">dominant-baseline="text-before-edge"</fo:inline> After</fo:inline>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="12950" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[2]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[2]/lineArea[1]/@space-after"/>
+ <eval expected="2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-2872" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[5]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[5]/lineArea[1]/@space-after"/>
+ <eval expected="2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-2872" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[8]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[8]/lineArea[1]/@space-after"/>
+ <eval expected="3700" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-3700" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[11]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[11]/lineArea[1]/@space-after"/>
+ <eval expected="2872" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-2872" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[14]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[14]/lineArea[1]/@space-after"/>
+ <eval expected="574" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-574" xpath="//flow/block[14]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[17]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[17]/lineArea[1]/@space-after"/>
+ <eval expected="1436" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-1436" xpath="//flow/block[17]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[20]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[20]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[20]/lineArea[1]/@space-after"/>
+ <eval expected="1850" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-1850" xpath="//flow/block[20]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[23]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[23]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[23]/lineArea[1]/@space-after"/>
+ <eval expected="1826" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-1826" xpath="//flow/block[23]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[26]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[26]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[26]/lineArea[1]/@space-after"/>
+ <eval expected="3700" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="-3700" xpath="//flow/block[26]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+
+ <eval expected="12950" xpath="//flow/block[29]/lineArea[1]/@bpd"/>
+ <eval expected="1375" xpath="//flow/block[29]/lineArea[1]/@space-before"/>
+ <eval expected="1375" xpath="//flow/block[29]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level dominant-baseline.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ dominant-baseline="central"
+ background-color="yellow">central
+ <fo:inline font-size="50%"
+ background-color="red">Baseline changed</fo:inline>
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ dominant-baseline="text-before-edge"
+ background-color="yellow">text-before-edge
+ <fo:inline font-size="50%"
+ background-color="red">Baseline changed</fo:inline>
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ dominant-baseline="text-after-edge"
+ background-color="yellow">text-after-edge
+ <fo:inline font-size="150%"
+ background-color="red">Baseline changed</fo:inline>
+ </fo:inline>
+ After
+ </fo:block>
+ <fo:block background-color="silver" margin="1pt 0pt 1pt 0pt" font-size="16pt">
+ Before
+ <fo:inline font-size="50%"
+ dominant-baseline="middle"
+ background-color="yellow">middle
+ <fo:inline font-size="150%"
+ dominant-baseline="hanging"
+ background-color="red">hanging
+ <fo:inline font-size="75%"
+ background-color="green">Baseline changed
+ </fo:inline>
+ </fo:inline>
+ </fo:inline>
+ After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="14800" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5744" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="1850" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="14800" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5744" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="14800" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5744" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-3700" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="15018" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5744" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/text[1]/@offset"/>
+ <eval expected="-1826" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/inlineparent/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level vertical align.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" background-color="yellow">vertical-align not specified</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="baseline" background-color="yellow">vertical-align="baseline"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="top" background-color="yellow">vertical-align="top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="text-top" background-color="yellow">vertical-align="text-top"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="middle" background-color="yellow">vertical-align="middle"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="text-bottom" background-color="yellow">vertical-align="text-bottom"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="bottom" background-color="yellow">vertical-align="bottom"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="super" background-color="yellow">vertical-align="super"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline font-size="10pt" vertical-align="sub" background-color="yellow">vertical-align="sub"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline vertical-align="super" background-color="yellow">vertical-align="super"</fo:inline> After
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Before <fo:inline vertical-align="sub" background-color="yellow">vertical-align="sub"</fo:inline> After
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="18500" xpath="//flow/block[2]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[2]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[2]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="18500" xpath="//flow/block[5]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[5]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[5]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="7180" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="18500" xpath="//flow/block[8]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[8]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[8]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="18500" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[11]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[11]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="18500" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[14]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[14]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="4565" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="18500" xpath="//flow/block[17]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[17]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[17]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="9250" xpath="//flow/block[17]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[17]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="18500" xpath="//flow/block[20]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[20]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[20]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="9250" xpath="//flow/block[20]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[20]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="21780" xpath="//flow/block[23]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[23]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[23]/lineArea[1]/@space-after"/>
+ <eval expected="3280" xpath="//flow/block[23]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[23]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="3280" xpath="//flow/block[23]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="19045" xpath="//flow/block[26]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[26]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[26]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="9795" xpath="//flow/block[26]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[26]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="28960" xpath="//flow/block[29]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[29]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[29]/lineArea[1]/@space-after"/>
+ <eval expected="10460" xpath="//flow/block[29]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[29]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="10460" xpath="//flow/block[29]/lineArea[1]/text[2]/@offset"/>
+
+ <eval expected="23730" xpath="//flow/block[32]/lineArea[1]/@bpd"/>
+ <eval expected="2750" xpath="//flow/block[32]/lineArea[1]/@space-before"/>
+ <eval expected="2750" xpath="//flow/block[32]/lineArea[1]/@space-after"/>
+ <eval expected="0" xpath="//flow/block[32]/lineArea[1]/text[1]/@offset"/>
+ <eval expected="5230" xpath="//flow/block[32]/lineArea[1]/inlineparent/@offset"/>
+ <eval expected="0" xpath="//flow/block[32]/lineArea[1]/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks inline level vertical align.
+ This example is taken from the spec section 7.13.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5.5in" page-height="7.5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="yellow" margin="2pt 0pt 2pt 0pt" font-size="10pt">
+ This is a longer line that provides a context for the line with images aligned on it.
+ Before edge <fo:external-graphic src="url(../../resources/images/arrow_down_small.png)" vertical-align="top" /><fo:external-graphic src="url(../../resources/images/arrow_down_large.png)" vertical-align="top" />,
+ after edge <fo:external-graphic src="url(../../resources/images/arrow_up_small.png)" vertical-align="bottom" /><fo:external-graphic src="url(../../resources/images/arrow_up_medium.png)" vertical-align="bottom" />,
+ middle <fo:external-graphic src="url(../../resources/images/arrow_up_down_small.png)" vertical-align="middle" />,
+ none <fo:external-graphic src="url(../../resources/images/line_medium.png)" />.
+ And this is a line of text that follows the line with the objects aligned on it.
+ </fo:block>
+ <fo:block background-color="yellow" margin="2pt 0pt 2pt 0pt" font-size="10pt">
+ This is a longer line that provides a context for the line with images aligned on it.
+ Before edge <fo:external-graphic src="url(../../resources/images/arrow_down_small.png)" vertical-align="top" /><fo:external-graphic src="url(../../resources/images/arrow_down_large.png)" vertical-align="top" />,
+ after edge <fo:external-graphic src="url(../../resources/images/arrow_up_small.png)" vertical-align="bottom" /><fo:external-graphic src="url(../../resources/images/arrow_up_medium.png)" vertical-align="bottom" />,
+ middle <fo:external-graphic src="url(../../resources/images/arrow_up_down_small.png)" vertical-align="middle" />.
+ And this is a line of text that follows the line with the objects aligned on it.
+ </fo:block>
+ <fo:block background-color="yellow" margin="2pt 0pt 2pt 0pt" font-size="10pt">
+ This is a longer line that provides a context for the line with images aligned on it.
+ Before edge <fo:external-graphic src="url(../../resources/images/arrow_down_small.png)" vertical-align="top" /><fo:external-graphic src="url(../../resources/images/arrow_down_large.png)" vertical-align="top" />,
+ after edge <fo:external-graphic src="url(../../resources/images/arrow_up_small.png)" vertical-align="bottom" /><fo:external-graphic src="url(../../resources/images/arrow_up_medium.png)" vertical-align="bottom" />.
+ And this is a line of text that follows the line with the objects aligned on it.
+ </fo:block>
+ <fo:block background-color="yellow" margin="2pt 0pt 2pt 0pt" font-size="10pt">
+ This is a longer line that provides a context for the line with images aligned on it.
+ Before edge <fo:external-graphic src="url(../../resources/images/arrow_down_small.png)" vertical-align="top" /><fo:external-graphic src="url(../../resources/images/arrow_down_medium.png)" vertical-align="top" />,
+ after edge <fo:external-graphic src="url(../../resources/images/arrow_up_small.png)" vertical-align="bottom" /><fo:external-graphic src="url(../../resources/images/arrow_up_large.png)" vertical-align="bottom" />.
+ And this is a line of text that follows the line with the objects aligned on it.
+ </fo:block>
+ <fo:block background-color="yellow" margin="2pt 0pt 2pt 0pt" font-size="10pt">
+ This is a longer line that provides a context for the line with images aligned on it.
+ Before edge <fo:external-graphic src="url(../../resources/images/arrow_down_small.png)" vertical-align="top" /><fo:external-graphic src="url(../../resources/images/arrow_down_medium.png)" vertical-align="top" />,
+ after edge <fo:external-graphic src="url(../../resources/images/arrow_up_small.png)" vertical-align="bottom" /><fo:external-graphic src="url(../../resources/images/arrow_up_large.png)" vertical-align="bottom" />,
+ middle <fo:external-graphic src="url(../../resources/images/arrow_up_down_small.png)" vertical-align="middle" />.
+ And this is a line of text that follows the line with the objects aligned on it.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="48812" xpath="//flow/block[2]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/viewport[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/viewport[2]/@offset"/>
+ <eval expected="48812" xpath="//flow/block[2]/lineArea[2]/text[2]/@offset"/>
+ <eval expected="35995" xpath="//flow/block[2]/lineArea[2]/viewport[3]/@offset"/>
+ <eval expected="17998" xpath="//flow/block[2]/lineArea[2]/viewport[4]/@offset"/>
+ <eval expected="48812" xpath="//flow/block[2]/lineArea[2]/text[3]/@offset"/>
+ <eval expected="34379" xpath="//flow/block[2]/lineArea[2]/viewport[5]/@offset"/>
+ <eval expected="48812" xpath="//flow/block[2]/lineArea[2]/text[4]/@offset"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea[2]/viewport[6]/@offset"/>
+ <eval expected="48812" xpath="//flow/block[2]/lineArea[2]/text[5]/@offset"/>
+
+ <eval expected="14433" xpath="//flow/block[5]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/viewport[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/viewport[2]/@offset"/>
+ <eval expected="14433" xpath="//flow/block[5]/lineArea[2]/text[2]/@offset"/>
+ <eval expected="35995" xpath="//flow/block[5]/lineArea[2]/viewport[3]/@offset"/>
+ <eval expected="17998" xpath="//flow/block[5]/lineArea[2]/viewport[4]/@offset"/>
+ <eval expected="14433" xpath="//flow/block[5]/lineArea[2]/text[3]/@offset"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea[2]/viewport[5]/@offset"/>
+ <eval expected="14433" xpath="//flow/block[5]/lineArea[2]/text[4]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/viewport[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/viewport[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/text[2]/@offset"/>
+ <eval expected="35995" xpath="//flow/block[8]/lineArea[2]/viewport[3]/@offset"/>
+ <eval expected="17998" xpath="//flow/block[8]/lineArea[2]/viewport[4]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea[2]/text[3]/@offset"/>
+
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/viewport[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/viewport[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/text[2]/@offset"/>
+ <eval expected="35995" xpath="//flow/block[11]/lineArea[2]/viewport[3]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/viewport[4]/@offset"/>
+ <eval expected="0" xpath="//flow/block[11]/lineArea[2]/text[3]/@offset"/>
+
+ <eval expected="14433" xpath="//flow/block[14]/lineArea[2]/text[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/viewport[1]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/viewport[2]/@offset"/>
+ <eval expected="14433" xpath="//flow/block[14]/lineArea[2]/text[2]/@offset"/>
+ <eval expected="35995" xpath="//flow/block[14]/lineArea[2]/viewport[3]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/viewport[4]/@offset"/>
+ <eval expected="14433" xpath="//flow/block[14]/lineArea[2]/text[3]/@offset"/>
+ <eval expected="0" xpath="//flow/block[14]/lineArea[2]/viewport[5]/@offset"/>
+ <eval expected="14433" xpath="//flow/block[14]/lineArea[2]/text[4]/@offset"/>
+ </checks>
+</testcase>
<eval expected="20000" xpath="//flow/block[1]/lineArea/viewport/@ipd"/>
<eval expected="20000" xpath="//flow/block[1]/lineArea/viewport/@bpd"/>
<eval expected="70000" xpath="//flow/block[1]/lineArea/viewport/@bpda"/>
- <eval expected="1650" xpath="//flow/block[1]/lineArea/viewport/@offset"/>
+ <eval expected="0" xpath="//flow/block[1]/lineArea/viewport/@offset"/>
<eval expected="20000 30000 20000 30000" xpath="//flow/block[1]/lineArea/viewport/@bap"/>
<eval expected="color=#ffffff" xpath="//flow/block[1]/lineArea/viewport/@background"/>
<eval expected="(solid,#000000,5000)" xpath="//flow/block[1]/lineArea/viewport/@border-before"/>
<eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@ipd"/>
<eval expected="20000" xpath="//flow/block[2]/lineArea/viewport/@bpd"/>
<eval expected="70000" xpath="//flow/block[2]/lineArea/viewport/@bpda"/>
- <eval expected="15550" xpath="//flow/block[2]/lineArea/viewport/@offset"/>
+ <eval expected="1800" xpath="//flow/block[2]/lineArea/viewport/@offset"/>
<eval expected="20000 30000 20000 30000" xpath="//flow/block[2]/lineArea/viewport/@bap"/>
<eval expected="color=#ffffff" xpath="//flow/block[2]/lineArea/viewport/@background"/>
<eval expected="(solid,#000000,5000)" xpath="//flow/block[2]/lineArea/viewport/@border-before"/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:leader with different alignment-baseline values.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="dots" alignment-baseline="baseline" background-color="yellow"/>
+ dots baseline
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" alignment-baseline="baseline" background-color="yellow"/>
+ rule solid baseline
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" alignment-baseline="baseline" background-color="yellow"/>
+ rule double baseline
+ </fo:block>
+ <fo:block>
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" alignment-baseline="baseline" background-color="yellow">x</fo:leader>
+ use-content x baseline
+ -->
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="dots" alignment-baseline="before-edge" background-color="yellow"/>
+ dots before-edge
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" alignment-baseline="before-edge" background-color="yellow"/>
+ rule solid before-edge
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" alignment-baseline="before-edge" background-color="yellow"/>
+ rule double before-edge
+ </fo:block>
+ <fo:block>
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" alignment-baseline="before-edge" background-color="yellow">x</fo:leader>
+ use-content x before-edge
+ -->
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="dots" alignment-baseline="middle" background-color="yellow"/>
+ dots middle
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" alignment-baseline="middle" background-color="yellow"/>
+ rule solid middle
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" alignment-baseline="middle" background-color="yellow"/>
+ rule double middle
+ </fo:block>
+ <fo:block>
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" alignment-baseline="middle" background-color="yellow">x</fo:leader>
+ use-content x middle
+ -->
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="dots" alignment-baseline="after-edge" background-color="yellow"/>
+ dots after-edge
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" alignment-baseline="after-edge" background-color="yellow"/>
+ rule solid after-edge
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" alignment-baseline="after-edge" background-color="yellow"/>
+ rule double after-edge
+ </fo:block>
+ <fo:block>
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" alignment-baseline="after-edge" background-color="yellow">x</fo:leader>
+ use-content x after-edge
+ -->
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[1]/lineArea/inlineparent/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[2]/lineArea/leader/@ipd"/>
+ <eval expected="7616" xpath="//flow/block[2]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[3]/lineArea/leader/@ipd"/>
+ <eval expected="7616" xpath="//flow/block[3]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[5]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[5]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[5]/lineArea/inlineparent/@ipd"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea/inlineparent/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[6]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[6]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[6]/lineArea/leader/@ipd"/>
+ <eval expected="0" xpath="//flow/block[6]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[7]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[7]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[7]/lineArea/leader/@ipd"/>
+ <eval expected="0" xpath="//flow/block[7]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[9]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[9]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[9]/lineArea/inlineparent/@ipd"/>
+ <eval expected="3810" xpath="//flow/block[9]/lineArea/inlineparent/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[10]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[10]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[10]/lineArea/leader/@ipd"/>
+ <eval expected="4978" xpath="//flow/block[10]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[11]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[11]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[11]/lineArea/leader/@ipd"/>
+ <eval expected="4978" xpath="//flow/block[11]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[13]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[13]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[13]/lineArea/inlineparent/@ipd"/>
+ <eval expected="7764" xpath="//flow/block[13]/lineArea/inlineparent/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[14]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[14]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[14]/lineArea/leader/@ipd"/>
+ <eval expected="10100" xpath="//flow/block[14]/lineArea/leader/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[15]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[15]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[15]/lineArea/leader/@ipd"/>
+ <eval expected="10100" xpath="//flow/block[15]/lineArea/leader/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:leader with background-color
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="dots" background-color="yellow"/>
+ dots yellow background
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" background-color="yellow"/>
+ rule solid yellow background
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" background-color="yellow"/>
+ rule double yellow background
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="space" background-color="yellow"/>
+ space yellow background
+ </fo:block>
+ <fo:block>
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" background-color="yellow">x</fo:leader>
+ use-content x yellow background
+ -->
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[1]/lineArea/inlineparent/@background"/>
+
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[2]/lineArea/leader/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[2]/lineArea/leader/@background"/>
+
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[3]/lineArea/leader/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[3]/lineArea/leader/@background"/>
+
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[4]/lineArea/space/@ipd"/>
+ <eval expected="color=#ffff00" xpath="//flow/block[4]/lineArea/space/@background"/>
+
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:leader with border and padding
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="dots" border="solid 1pt red"/>
+ dots solid 1pt red border
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" border="solid 1pt red"/>
+ rule solid solid 1pt red border
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" border="solid 1pt red"/>
+ rule double solid 1pt red border
+ </fo:block>
+ <fo:block>
+ <fo:leader leader-length="36pt" leader-pattern="space" border="solid 1pt red"/>
+ space solid 1pt red border
+ </fo:block>
+ <fo:block>
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" border="solid 1pt red">x</fo:leader>
+ use-content x solid 1pt red border
+ -->
+ </fo:block>
+ <fo:block margin="10pt 0pt 10pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="dots" border="solid 5pt red" padding="5pt"/>
+ dots solid 5pt red border 5pt padding
+ </fo:block>
+ <fo:block margin="10pt 0pt 10pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" border="solid 5pt red" padding="5pt"/>
+ rule solid solid 5pt red border 5pt padding
+ </fo:block>
+ <fo:block margin="10pt 0pt 10pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" border="solid 5pt red" padding="5pt"/>
+ rule double solid 5pt red border 5pt padding
+ </fo:block>
+ <fo:block margin="10pt 0pt 10pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="space" border="solid 5pt red" padding="5pt"/>
+ space solid 5pt red border 5pt padding
+ </fo:block>
+ <fo:block margin="10pt 0pt 10pt 0pt">
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" border="solid 5pt red" padding="5pt">x</fo:leader>
+ use-content x solid 5pt red border 5pt padding
+ -->
+ </fo:block>
+ <fo:block margin="2pt 0pt 2pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="dots" border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt"/>
+ dots uneven border and padding
+ </fo:block>
+ <fo:block margin="2pt 0pt 2pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt"/>
+ rule solid uneven border and padding
+ </fo:block>
+ <fo:block margin="2pt 0pt 2pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt"/>
+ rule double uneven border and padding
+ </fo:block>
+ <fo:block margin="2pt 0pt 2pt 0pt">
+ <fo:leader leader-length="36pt" leader-pattern="space" border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt"/>
+ space uneven border and padding
+ </fo:block>
+ <fo:block margin="2pt 0pt 2pt 0pt">
+ <!-- use content currently causes a ClassCastException
+ <fo:leader leader-length="36pt" leader-pattern="use-content" border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt">x</fo:leader>
+ use-content x uneven border and padding
+ -->
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
+ <eval expected="34000" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[1]/lineArea/inlineparent/@ipda"/>
+ <eval expected="5280" xpath="//flow/block[1]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-start"/>
+
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
+ <eval expected="34000" xpath="//flow/block[2]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[2]/lineArea/leader/@ipda"/>
+ <eval expected="7616" xpath="//flow/block[2]/lineArea/leader/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/leader/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/leader/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/leader/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/leader/@border-start"/>
+
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
+ <eval expected="34000" xpath="//flow/block[3]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[3]/lineArea/leader/@ipda"/>
+ <eval expected="7616" xpath="//flow/block[3]/lineArea/leader/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[3]/lineArea/leader/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[3]/lineArea/leader/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[3]/lineArea/leader/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[3]/lineArea/leader/@border-start"/>
+
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/>
+ <eval expected="34000" xpath="//flow/block[4]/lineArea/space/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[4]/lineArea/space/@ipda"/>
+ <eval expected="8615" xpath="//flow/block[4]/lineArea/space/@offset"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[4]/lineArea/space/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[4]/lineArea/space/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[4]/lineArea/space/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[4]/lineArea/space/@border-start"/>
+
+ <eval expected="11100" xpath="//flow/block[7]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[7]/lineArea/@ipd"/>
+ <eval expected="16000" xpath="//flow/block[7]/lineArea/inlineparent/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[7]/lineArea/inlineparent/@ipda"/>
+ <eval expected="5280" xpath="//flow/block[7]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[7]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[7]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[7]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[7]/lineArea/inlineparent/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[7]/lineArea/inlineparent/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[7]/lineArea/inlineparent/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[7]/lineArea/inlineparent/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[7]/lineArea/inlineparent/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[10]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[10]/lineArea/@ipd"/>
+ <eval expected="16000" xpath="//flow/block[10]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[10]/lineArea/leader/@ipda"/>
+ <eval expected="7616" xpath="//flow/block[10]/lineArea/leader/@offset"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[10]/lineArea/leader/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[10]/lineArea/leader/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[10]/lineArea/leader/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[10]/lineArea/leader/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[10]/lineArea/leader/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[10]/lineArea/leader/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[10]/lineArea/leader/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[10]/lineArea/leader/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[13]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[13]/lineArea/@ipd"/>
+ <eval expected="16000" xpath="//flow/block[13]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[13]/lineArea/leader/@ipda"/>
+ <eval expected="7616" xpath="//flow/block[13]/lineArea/leader/@offset"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[13]/lineArea/leader/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[13]/lineArea/leader/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[13]/lineArea/leader/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[13]/lineArea/leader/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[13]/lineArea/leader/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[13]/lineArea/leader/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[13]/lineArea/leader/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[13]/lineArea/leader/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[16]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[16]/lineArea/@ipd"/>
+ <eval expected="16000" xpath="//flow/block[16]/lineArea/space/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[16]/lineArea/space/@ipda"/>
+ <eval expected="8615" xpath="//flow/block[16]/lineArea/space/@offset"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[16]/lineArea/space/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[16]/lineArea/space/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[16]/lineArea/space/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[16]/lineArea/space/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[16]/lineArea/space/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[16]/lineArea/space/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[16]/lineArea/space/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[16]/lineArea/space/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[22]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[22]/lineArea/@ipd"/>
+ <eval expected="24000" xpath="//flow/block[22]/lineArea/inlineparent/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[22]/lineArea/inlineparent/@ipda"/>
+ <eval expected="5280" xpath="//flow/block[22]/lineArea/inlineparent/@offset"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[22]/lineArea/inlineparent/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[22]/lineArea/inlineparent/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[22]/lineArea/inlineparent/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[22]/lineArea/inlineparent/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[22]/lineArea/inlineparent/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[22]/lineArea/inlineparent/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[22]/lineArea/inlineparent/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[22]/lineArea/inlineparent/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[25]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[25]/lineArea/@ipd"/>
+ <eval expected="24000" xpath="//flow/block[25]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[25]/lineArea/leader/@ipda"/>
+ <eval expected="7616" xpath="//flow/block[25]/lineArea/leader/@offset"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[25]/lineArea/leader/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[25]/lineArea/leader/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[25]/lineArea/leader/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[25]/lineArea/leader/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[25]/lineArea/leader/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[25]/lineArea/leader/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[25]/lineArea/leader/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[25]/lineArea/leader/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[28]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[28]/lineArea/@ipd"/>
+ <eval expected="24000" xpath="//flow/block[28]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[28]/lineArea/leader/@ipda"/>
+ <eval expected="7616" xpath="//flow/block[28]/lineArea/leader/@offset"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[28]/lineArea/leader/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[28]/lineArea/leader/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[28]/lineArea/leader/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[28]/lineArea/leader/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[28]/lineArea/leader/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[28]/lineArea/leader/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[28]/lineArea/leader/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[28]/lineArea/leader/@padding-start"/>
+
+ <eval expected="11100" xpath="//flow/block[31]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[31]/lineArea/@ipd"/>
+ <eval expected="24000" xpath="//flow/block[31]/lineArea/space/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[31]/lineArea/space/@ipda"/>
+ <eval expected="8615" xpath="//flow/block[31]/lineArea/space/@offset"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[31]/lineArea/space/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[31]/lineArea/space/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[31]/lineArea/space/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[31]/lineArea/space/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[31]/lineArea/space/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[31]/lineArea/space/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[31]/lineArea/space/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[31]/lineArea/space/@padding-start"/>
+ </checks>
+</testcase>
Default dots pattern
</fo:block>
<fo:block>
- <fo:leader leader-pattern="dots" leader-pattern-width="use-font-metrics"/>
+ <fo:leader leader-pattern="dots" leader-pattern-width="use-font-metrics" background-color="yellow"/>
leader-pattern-width="use-font-metrics"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="dots" leader-length="20mm" leader-pattern-width="5mm"/>
+ <fo:leader leader-pattern="dots" leader-length="20mm" leader-pattern-width="5mm" background-color="yellow"/>
leader-length="20mm" leader-pattern-width="5mm"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="dots" leader-length="20%" leader-pattern-width="5mm"/>
+ <fo:leader leader-pattern="dots" leader-length="20%" leader-pattern-width="5mm" background-color="yellow"/>
leader-length="20%" leader-pattern-width="5mm"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="dots" leader-pattern-width="1pt"/>
+ <fo:leader leader-pattern="dots" leader-pattern-width="1pt" background-color="yellow"/>
leader-pattern-width="1pt"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="dots" leader-length="20%" leader-pattern-width="5%"/>
+ <fo:leader leader-pattern="dots" leader-length="20%" leader-pattern-width="5%" background-color="yellow"/>
leader-length="20%" leader-pattern-width="5%"
</fo:block>
</fo:flow>
</fo:root>
</fo>
<checks>
- <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
<eval expected="12000" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/>
<eval expected="3" xpath="count(//flow/block[1]/lineArea/inlineparent/text)"/>
- <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
<eval expected="12000" xpath="//flow/block[2]/lineArea/inlineparent/@ipd"/>
<eval expected="3" xpath="count(//flow/block[2]/lineArea/inlineparent/text)"/>
- <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
<eval expected="56692" xpath="//flow/block[3]/lineArea/inlineparent/@ipd"/>
<eval expected="4" xpath="count(//flow/block[3]/lineArea/inlineparent/text)"/>
<eval expected="4" xpath="count(//flow/block[3]/lineArea/inlineparent/space)"/>
- <eval expected="14400" xpath="//flow/block[4]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/>
<eval expected="72000" xpath="//flow/block[4]/lineArea/inlineparent/@ipd"/>
<eval expected="5" xpath="count(//flow/block[4]/lineArea/inlineparent/text)"/>
<eval expected="5" xpath="count(//flow/block[4]/lineArea/inlineparent/space)"/>
- <eval expected="14400" xpath="//flow/block[5]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[5]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[5]/lineArea/@ipd"/>
<eval expected="12000" xpath="//flow/block[5]/lineArea/inlineparent/@ipd"/>
<eval expected="3" xpath="count(//flow/block[5]/lineArea/inlineparent/text)"/>
- <eval expected="14400" xpath="//flow/block[6]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[6]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[6]/lineArea/@ipd"/>
<eval expected="72000" xpath="//flow/block[6]/lineArea/inlineparent/@ipd"/>
<eval expected="4" xpath="count(//flow/block[6]/lineArea/inlineparent/text)"/>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
<fo:block>
- <fo:leader leader-pattern="rule"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" background-color="yellow"/>
No rule-style given
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="none"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="none" background-color="yellow"/>
rule-style="none"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="dotted"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="dotted" background-color="yellow"/>
rule-style="dotted"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="dashed"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="dashed" background-color="yellow"/>
rule-style="dashed"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="solid"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" background-color="yellow"/>
rule-style="solid"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="double"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" background-color="yellow"/>
rule-style="double"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="groove"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="groove" background-color="yellow"/>
rule-style="groove"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="ridge"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="ridge" background-color="yellow"/>
rule-style="ridge"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="dotted" rule-thickness="3pt"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="dotted" rule-thickness="3pt" background-color="yellow"/>
rule-style="dotted" rule-thickness="3pt"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="dashed" rule-thickness="3pt"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="dashed" rule-thickness="3pt" background-color="yellow"/>
rule-style="dashed" rule-thickness="3pt"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="solid" rule-thickness="3pt"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="solid" rule-thickness="3pt" background-color="yellow"/>
rule-style="solid" rule-thickness="3pt"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="double" rule-thickness="3pt"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="double" rule-thickness="3pt" background-color="yellow"/>
rule-style="double" rule-thickness="3pt"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="groove" rule-thickness="3pt"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="groove" rule-thickness="3pt" background-color="yellow"/>
rule-style="groove" rule-thickness="3pt"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="rule" rule-style="ridge" rule-thickness="3pt"/>
+ <fo:leader leader-length="36pt" leader-pattern="rule" rule-style="ridge" rule-thickness="3pt" background-color="yellow"/>
rule-style="ridge" rule-thickness="3pt"
</fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" alignment-baseline="middle"/>
- No rule-style given alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="none" alignment-baseline="middle"/>
- rule-style="none" alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="dotted" alignment-baseline="middle"/>
- rule-style="dotted" alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="dashed" alignment-baseline="middle"/>
- rule-style="dashed" alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="solid" alignment-baseline="middle"/>
- rule-style="solid" alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="double" alignment-baseline="middle"/>
- rule-style="double" alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="groove" alignment-baseline="middle"/>
- rule-style="groove" alignment-baseline="middle"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="rule" rule-style="ridge" alignment-baseline="middle"/>
- rule-style="ridge" alignment-baseline="middle"
- </fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</fo>
<checks>
- <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[1]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[1]/lineArea/leader/@ipd"/>
<eval expected="solid" xpath="//flow/block[1]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[1]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[2]/lineArea/leader/@ipd"/>
- <eval expected="--NYI--" xpath="//flow/block[2]/lineArea/leader/@ruleStyle"/>
- <eval expected="1000" xpath="//flow/block[2]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="36000" xpath="//flow/block[2]/lineArea/space/@ipd"/>
+
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[3]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[3]/lineArea/leader/@ipd"/>
<eval expected="dotted" xpath="//flow/block[3]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[3]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[4]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[4]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[4]/lineArea/leader/@ipd"/>
<eval expected="dashed" xpath="//flow/block[4]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[4]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[5]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[5]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[5]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[5]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[5]/lineArea/leader/@ipd"/>
<eval expected="solid" xpath="//flow/block[5]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[5]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[6]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[6]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[6]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[6]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[6]/lineArea/leader/@ipd"/>
<eval expected="double" xpath="//flow/block[6]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[6]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[7]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[7]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[7]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[7]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[7]/lineArea/leader/@ipd"/>
<eval expected="groove" xpath="//flow/block[7]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[7]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[8]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[8]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[8]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[8]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[8]/lineArea/leader/@ipd"/>
<eval expected="ridge" xpath="//flow/block[8]/lineArea/leader/@ruleStyle"/>
<eval expected="1000" xpath="//flow/block[8]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[9]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[9]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[9]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[9]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[9]/lineArea/leader/@ipd"/>
<eval expected="dotted" xpath="//flow/block[9]/lineArea/leader/@ruleStyle"/>
<eval expected="3000" xpath="//flow/block[9]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[10]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[10]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[10]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[10]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[10]/lineArea/leader/@ipd"/>
<eval expected="dashed" xpath="//flow/block[10]/lineArea/leader/@ruleStyle"/>
<eval expected="3000" xpath="//flow/block[10]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[11]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[11]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[11]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[11]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[11]/lineArea/leader/@ipd"/>
<eval expected="solid" xpath="//flow/block[11]/lineArea/leader/@ruleStyle"/>
<eval expected="3000" xpath="//flow/block[11]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[12]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[12]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[12]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[12]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[12]/lineArea/leader/@ipd"/>
<eval expected="double" xpath="//flow/block[12]/lineArea/leader/@ruleStyle"/>
<eval expected="3000" xpath="//flow/block[12]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[13]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[13]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[13]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[13]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[13]/lineArea/leader/@ipd"/>
<eval expected="groove" xpath="//flow/block[13]/lineArea/leader/@ruleStyle"/>
<eval expected="3000" xpath="//flow/block[13]/lineArea/leader/@ruleThickness"/>
- <eval expected="14400" xpath="//flow/block[14]/lineArea/@bpd"/>
+
+ <eval expected="11100" xpath="//flow/block[14]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[14]/lineArea/@ipd"/>
- <eval expected="12000" xpath="//flow/block[14]/lineArea/leader/@ipd"/>
+ <eval expected="36000" xpath="//flow/block[14]/lineArea/leader/@ipd"/>
<eval expected="ridge" xpath="//flow/block[14]/lineArea/leader/@ruleStyle"/>
<eval expected="3000" xpath="//flow/block[14]/lineArea/leader/@ruleThickness"/>
- <!-- No checks for the "alignment-baseline=..." section as this property is currently
- not supported -->
</checks>
</testcase>
</fo:root>
</fo>
<checks>
- <eval expected="14400" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
<eval expected="12000" xpath="//flow/block[1]/lineArea/space/@ipd"/>
- <eval expected="14400" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[2]/lineArea/@ipd"/>
<eval expected="36000" xpath="//flow/block[2]/lineArea/space/@ipd"/>
- <eval expected="14400" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
<eval expected="360000" xpath="//flow/block[3]/lineArea/@ipd"/>
<eval expected="18000" xpath="//flow/block[3]/lineArea/space/@ipd"/>
</checks>
<fo:page-sequence master-reference="normal" white-space-collapse="true">
<fo:flow flow-name="xsl-region-body">
<fo:block>
- <fo:leader leader-pattern="use-content"/>
- Default dots pattern
+ <fo:leader leader-length="36pt" leader-pattern="use-content">x</fo:leader>
+ Content is "x"
</fo:block>
<fo:block>
- <fo:leader leader-pattern="use-content" leader-pattern-width="use-font-metrics"/>
- leader-pattern-width="use-font-metrics"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="use-content" leader-length="20mm" leader-pattern-width="5mm"/>
- leader-length="20mm" leader-pattern-width="5mm"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="use-content" leader-pattern-width="1pt"/>
- leader-pattern-width="1pt"
- </fo:block>
- <fo:block>
- <fo:leader leader-pattern="use-content" leader-pattern-width="5%"/>
- leader-pattern-width="5%"
+ <fo:leader leader-length="36pt" leader-pattern="use-content"><fo:inline background-color="yellow">=></fo:inline></fo:leader>
+ Content is "=>" with background
</fo:block>
</fo:flow>
</fo:page-sequence>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:leader in a typical table of content scenario.
+ This example is taken from the spec section 6.6.1.1.4
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block text-align-last="justify">
+ <fo:basic-link internal-destination="N4">1. Chapter</fo:basic-link>
+ <fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
+ leader-length.maximum="100%" leader-pattern="dots">
+ </fo:leader>
+ <fo:page-number-citation ref-id="N4">
+ </fo:page-number-citation>
+ </fo:block>
+ <fo:block start-indent="10mm" text-align-last="justify">
+ <fo:basic-link internal-destination="N11">1.1 Section</fo:basic-link>
+ <fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
+ leader-length.maximum="100%" leader-pattern="dots">
+ </fo:leader>
+ <fo:page-number-citation ref-id="N11">
+ </fo:page-number-citation>
+ </fo:block>
+ <fo:block start-indent="10mm" text-align-last="justify">
+ <fo:basic-link internal-destination="N19">1.2 Section</fo:basic-link>
+ <fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
+ leader-length.maximum="100%" leader-pattern="dots">
+ </fo:leader>
+ <fo:page-number-citation ref-id="N19">
+ </fo:page-number-citation>
+ </fo:block>
+ <fo:block text-align-last="justify">
+ <fo:basic-link internal-destination="N28">2. Chapter</fo:basic-link>
+ <fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
+ leader-length.maximum="100%" leader-pattern="dots">
+ </fo:leader>
+ <fo:page-number-citation ref-id="N28">
+ </fo:page-number-citation>
+ </fo:block>
+ <fo:block start-indent="10mm" text-align-last="justify">
+ <fo:basic-link internal-destination="N35">2.1 Section</fo:basic-link>
+ <fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
+ leader-length.maximum="100%" leader-pattern="dots">
+ </fo:leader>
+ <fo:page-number-citation ref-id="N35">
+ </fo:page-number-citation>
+ </fo:block>
+ <fo:block start-indent="10mm" text-align-last="justify">
+ <fo:basic-link internal-destination="N43">2.2 Section</fo:basic-link>
+ <fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
+ leader-length.maximum="100%" leader-pattern="dots">
+ </fo:leader>
+ <fo:page-number-citation ref-id="N43">
+ </fo:page-number-citation>
+ </fo:block>
+
+ <fo:block id="N4">1. Chapter
+ </fo:block>
+
+ <fo:block>Text
+ </fo:block>
+
+ <fo:block id="N11">1.1 Section
+ </fo:block>
+
+ <fo:block>Text
+ </fo:block>
+
+ <fo:block id="N19">1.2 Section
+ </fo:block>
+
+ <fo:block>Text
+ </fo:block>
+
+ <fo:block id="N28">2. Chapter
+ </fo:block>
+
+ <fo:block>Text
+ </fo:block>
+
+ <fo:block id="N35">2.1 Section
+ </fo:block>
+
+ <fo:block>Text
+ </fo:block>
+
+ <fo:block id="N43">2.2 Section
+ </fo:block>
+
+ <fo:block>Text
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="11100" xpath="//flow/block[1]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/>
+ <eval expected="268268" xpath="//flow/block[1]/lineArea/inlineparent[2]/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[1]/lineArea/inlineparent[2]/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[2]/lineArea/@bpd"/>
+ <eval expected="331654" xpath="//flow/block[2]/lineArea/@ipd"/>
+ <eval expected="236051" xpath="//flow/block[2]/lineArea/inlineparent[2]/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[2]/lineArea/inlineparent[2]/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[3]/lineArea/@bpd"/>
+ <eval expected="331654" xpath="//flow/block[3]/lineArea/@ipd"/>
+ <eval expected="236051" xpath="//flow/block[3]/lineArea/inlineparent[2]/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[3]/lineArea/inlineparent[2]/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[4]/lineArea/@bpd"/>
+ <eval expected="360000" xpath="//flow/block[4]/lineArea/@ipd"/>
+ <eval expected="268268" xpath="//flow/block[4]/lineArea/inlineparent[2]/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[4]/lineArea/inlineparent[2]/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[5]/lineArea/@bpd"/>
+ <eval expected="331654" xpath="//flow/block[5]/lineArea/@ipd"/>
+ <eval expected="236051" xpath="//flow/block[5]/lineArea/inlineparent[2]/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[5]/lineArea/inlineparent[2]/@offset"/>
+
+ <eval expected="11100" xpath="//flow/block[6]/lineArea/@bpd"/>
+ <eval expected="331654" xpath="//flow/block[6]/lineArea/@ipd"/>
+ <eval expected="236051" xpath="//flow/block[6]/lineArea/inlineparent[2]/@ipd"/>
+ <eval expected="5280" xpath="//flow/block[6]/lineArea/inlineparent[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number-citation with background-color property.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt" id="ref">
+ <fo:block background-color="silver" id="ref">
+ To emphasize a page number citation <fo:page-number-citation ref-id="ref" background-color="yellow" /> highlight it.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="color=#ffff00" xpath="//flow/block[1]/lineArea/text[2]/@background"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number-citation with background-image property.
+ </p>
+ </info>
+ <variables>
+ <img>../../resources/images/bgimg300dpi.jpg</img>
+ </variables>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block font-size="24pt" id="ref">
+ Page number citation <fo:page-number-citation font-size="96pt" ref-id="ref" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
+ Page number citation <fo:page-number-citation font-size="48pt" ref-id="ref" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- currently not working because of late ipd adjustment after the image is positioned -->
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=3648,vertical=21360" xpath="//flow/block[1]/lineArea/text[2]/@background"/>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=-9696,vertical=-840" xpath="//flow/block[1]/lineArea/text[4]/@background"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number-citation with border and padding properties.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" id="ref">
+ Page number citation <fo:page-number-citation ref-id="ref" border="solid 1pt red" background-color="yellow" /> with a 1pt border.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
+ Page number citation <fo:page-number-citation ref-id="ref" border="solid 5pt red" padding="5pt" background-color="yellow" /> with 5pt border and padding.
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
+ Page number citation <fo:page-number-citation ref-id="ref" border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt" background-color="yellow" character="c"/> with unsymmetric borders and padding.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt" font-size="20pt">
+ Page number citation <fo:page-number-citation ref-id="ref" border="solid 5pt red" padding="5pt" background-color="yellow" font-size="8pt" character="b"/> with border and padding in a smaller font.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea/text[2]/@baseline"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea/text[2]/@offset"/>
+ <eval expected="5560" xpath="//flow/block[2]/lineArea/text[2]/@ipd"/>
+ <eval expected="7560" xpath="//flow/block[2]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-start"/>
+
+ <eval expected="7180" xpath="//flow/block[5]/lineArea/text[2]/@baseline"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea/text[2]/@offset"/>
+ <eval expected="5560" xpath="//flow/block[5]/lineArea/text[2]/@ipd"/>
+ <eval expected="25560" xpath="//flow/block[5]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-start"/>
+
+ <eval expected="7180" xpath="//flow/block[8]/lineArea/text[2]/@baseline"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/text[2]/@offset"/>
+ <eval expected="5560" xpath="//flow/block[8]/lineArea/text[2]/@ipd"/>
+ <eval expected="17560" xpath="//flow/block[8]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[8]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[8]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[8]/lineArea/text[2]/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea/text[2]/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea/text[2]/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea/text[2]/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[8]/lineArea/text[2]/@padding-start"/>
+
+ <eval expected="5744" xpath="//flow/block[11]/lineArea/text[2]/@baseline"/>
+ <eval expected="8616" xpath="//flow/block[11]/lineArea/text[2]/@offset"/>
+ <eval expected="4448" xpath="//flow/block[11]/lineArea/text[2]/@ipd"/>
+ <eval expected="24448" xpath="//flow/block[11]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-start"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number-citation with vertical-align property.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt" id="ref">
+ Page citation <fo:page-number-citation ref-id="ref" font-size="10pt" background-color="yellow" /> vertical-align not specified
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page citation <fo:page-number-citation ref-id="ref" font-size="10pt" vertical-align="baseline" background-color="yellow" /> vertical-align="baseline"
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page citation <fo:page-number-citation ref-id="ref" font-size="10pt" vertical-align="top" background-color="yellow" /> vertical-align="top"
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page citation <fo:page-number-citation ref-id="ref" font-size="10pt" vertical-align="middle" background-color="yellow" /> vertical-align="middle"
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page citation <fo:page-number-citation ref-id="ref" font-size="10pt" vertical-align="bottom" background-color="yellow" /> vertical-align="bottom"
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea/text[2]/@offset"/>
+ <eval expected="7180" xpath="//flow/block[5]/lineArea/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/text[2]/@offset"/>
+ <eval expected="4565" xpath="//flow/block[11]/lineArea/text[2]/@offset"/>
+ <eval expected="9250" xpath="//flow/block[14]/lineArea/text[2]/@offset"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number with background-color property.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver">
+ To emphasize a page number <fo:page-number background-color="yellow" /> highlight it.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="color=#ffff00" xpath="//flow/block[1]/lineArea/text[2]/@background"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number with background-image property.
+ </p>
+ </info>
+ <variables>
+ <img>../../resources/images/bgimg300dpi.jpg</img>
+ </variables>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block font-size="24pt">
+ Page <fo:page-number font-size="96pt" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
+ Page <fo:page-number font-size="48pt" background-color="yellow" background-repeat="no-repeat" background-position-horizontal="center" background-position-vertical="center" background-image="##img" />
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=3648,vertical=21360" xpath="//flow/block[1]/lineArea/text[2]/@background"/>
+ <eval expected="color=#ffff00,url=../../resources/images/bgimg300dpi.jpg,repeat=no-repeat,horiz=-9696,vertical=-840" xpath="//flow/block[1]/lineArea/text[4]/@background"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number with border and padding properties.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="5pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true" language="en">
+ <fo:flow flow-name="xsl-region-body" font-size="10pt">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
+ Page number <fo:page-number border="solid 1pt red" background-color="yellow" /> with a 1pt border.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt">
+ Page number <fo:page-number border="solid 5pt red" padding="5pt" background-color="yellow" /> with 5pt border and padding.
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt">
+ Page number <fo:page-number border-style="solid" border-width="1pt 2pt 3pt 4pt" border-color="red" padding="1pt 2pt 3pt 4pt" background-color="yellow" character="c"/> with unsymmetric borders and padding.
+ </fo:block>
+ <fo:block background-color="silver" margin="10pt 0pt 10pt 0pt" font-size="20pt">
+ Page number <fo:page-number border="solid 5pt red" padding="5pt" background-color="yellow" font-size="8pt" character="b"/> with border and padding in a smaller font.
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea/text[2]/@baseline"/>
+ <eval expected="0" xpath="//flow/block[2]/lineArea/text[2]/@offset"/>
+ <eval expected="5560" xpath="//flow/block[2]/lineArea/text[2]/@ipd"/>
+ <eval expected="7560" xpath="//flow/block[2]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea/text[2]/@border-start"/>
+
+ <eval expected="7180" xpath="//flow/block[5]/lineArea/text[2]/@baseline"/>
+ <eval expected="0" xpath="//flow/block[5]/lineArea/text[2]/@offset"/>
+ <eval expected="5560" xpath="//flow/block[5]/lineArea/text[2]/@ipd"/>
+ <eval expected="25560" xpath="//flow/block[5]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[5]/lineArea/text[2]/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[5]/lineArea/text[2]/@padding-start"/>
+
+ <eval expected="7180" xpath="//flow/block[8]/lineArea/text[2]/@baseline"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/text[2]/@offset"/>
+ <eval expected="5560" xpath="//flow/block[8]/lineArea/text[2]/@ipd"/>
+ <eval expected="17560" xpath="//flow/block[8]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,3000)" xpath="//flow/block[8]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,2000)" xpath="//flow/block[8]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,4000)" xpath="//flow/block[8]/lineArea/text[2]/@border-start"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea/text[2]/@padding-after"/>
+ <eval expected="1000" xpath="//flow/block[8]/lineArea/text[2]/@padding-before"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea/text[2]/@padding-end"/>
+ <eval expected="4000" xpath="//flow/block[8]/lineArea/text[2]/@padding-start"/>
+
+ <eval expected="5744" xpath="//flow/block[11]/lineArea/text[2]/@baseline"/>
+ <eval expected="8616" xpath="//flow/block[11]/lineArea/text[2]/@offset"/>
+ <eval expected="4448" xpath="//flow/block[11]/lineArea/text[2]/@ipd"/>
+ <eval expected="24448" xpath="//flow/block[11]/lineArea/text[2]/@ipda"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-after"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-before"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-end"/>
+ <eval expected="(solid,#ff0000,5000)" xpath="//flow/block[11]/lineArea/text[2]/@border-start"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-after"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-before"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-end"/>
+ <eval expected="5000" xpath="//flow/block[11]/lineArea/text[2]/@padding-start"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks fo:page-number with vertical-align property.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page <fo:page-number font-size="10pt" background-color="yellow" /> vertical-align not specified
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page <fo:page-number font-size="10pt" vertical-align="baseline" background-color="yellow" /> vertical-align="baseline"
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page <fo:page-number font-size="10pt" vertical-align="top" background-color="yellow" /> vertical-align="top"
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page <fo:page-number font-size="10pt" vertical-align="middle" background-color="yellow" /> vertical-align="middle"
+ </fo:block>
+ <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+ Page <fo:page-number font-size="10pt" vertical-align="bottom" background-color="yellow" /> vertical-align="bottom"
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="7180" xpath="//flow/block[2]/lineArea/text[2]/@offset"/>
+ <eval expected="7180" xpath="//flow/block[5]/lineArea/text[2]/@offset"/>
+ <eval expected="0" xpath="//flow/block[8]/lineArea/text[2]/@offset"/>
+ <eval expected="4565" xpath="//flow/block[11]/lineArea/text[2]/@offset"/>
+ <eval expected="9250" xpath="//flow/block[14]/lineArea/text[2]/@offset"/>
+ </checks>
+</testcase>
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
- Copyright 2005 The Apache Software Foundation\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
--->\r
-<!-- $Id$ -->\r
-<testcase>\r
- <info>\r
- <p>\r
- This test checks relative positioned background images on a fo:table-cell.\r
- </p>\r
- </info>\r
- <variables>\r
- <img>../../resources/images/box1.png</img>\r
- </variables>\r
- <fo>\r
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">\r
- <fo:layout-master-set>\r
- <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="15pt">\r
- <fo:region-body/>\r
- </fo:simple-page-master>\r
- </fo:layout-master-set>\r
- <fo:page-sequence master-reference="normal" white-space-collapse="true">\r
- <fo:flow flow-name="xsl-region-body">\r
- <fo:table border-collapse="separate">\r
- <fo:table-column />\r
- <fo:table-column />\r
- <fo:table-column />\r
- <fo:table-body>\r
- <fo:table-row>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue" \r
- background-image="##img"\r
- background-position-horizontal="right" \r
- background-repeat="no-repeat">\r
- <fo:block>image in top right corner</fo:block>\r
- </fo:table-cell>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green" \r
- background-image="##img"\r
- background-position-horizontal="right" \r
- background-position-vertical="center" \r
- background-repeat="no-repeat">\r
- <fo:block>image in center right</fo:block>\r
- </fo:table-cell>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow" \r
- background-image="##img"\r
- background-position-horizontal="right" \r
- background-position-vertical="bottom" \r
- background-repeat="no-repeat">\r
- <fo:block>image in bottom right corner</fo:block>\r
- </fo:table-cell>\r
- </fo:table-row>\r
- <fo:table-row>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow" \r
- background-image="##img"\r
- background-position-horizontal="center" \r
- background-repeat="no-repeat">\r
- <fo:block>image in top center</fo:block>\r
- </fo:table-cell>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue" \r
- background-image="##img"\r
- background-position-horizontal="center" \r
- background-position-vertical="center" \r
- background-repeat="no-repeat">\r
- <fo:block>image in center</fo:block>\r
- </fo:table-cell>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green" \r
- background-image="##img"\r
- background-position-horizontal="center" \r
- background-position-vertical="bottom" \r
- background-repeat="no-repeat">\r
- <fo:block>image in bottom center</fo:block>\r
- </fo:table-cell>\r
- </fo:table-row>\r
- <fo:table-row>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green" \r
- background-image="##img"\r
- background-repeat="no-repeat">\r
- <fo:block>image in top left</fo:block>\r
- </fo:table-cell>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow" \r
- background-image="##img"\r
- background-position-vertical="center" \r
- background-repeat="no-repeat">\r
- <fo:block>image in center left</fo:block>\r
- </fo:table-cell>\r
- <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue" \r
- background-image="##img"\r
- background-position-vertical="bottom" \r
- background-repeat="no-repeat">\r
- <fo:block>image in bottom left</fo:block>\r
- </fo:table-cell>\r
- </fo:table-row>\r
- </fo:table-body>\r
- </fo:table>\r
- </fo:flow>\r
- </fo:page-sequence>\r
- </fo:root>\r
- </fo>\r
- <checks>\r
- <!-- first cell in row 1 -->\r
- <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=0" xpath="//flow/block/block[1]/@background"/>\r
- <!-- second cell in row 1 -->\r
- <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=28495" xpath="//flow/block/block[2]/@background"/>\r
- <!-- third cell in row 1 -->\r
- <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=56991" xpath="//flow/block/block[3]/@background"/>\r
- <!-- first cell in row 2 -->\r
- <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=0" xpath="//flow/block/block[4]/@background"/>\r
- <!-- second cell in row 2 -->\r
- <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=28495" xpath="//flow/block/block[5]/@background"/>\r
- <!-- third cell in row 2 -->\r
- <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=56991" xpath="//flow/block/block[6]/@background"/>\r
- <!-- first cell in row 3 -->\r
- <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=0" xpath="//flow/block/block[7]/@background"/>\r
- <!-- second cell in row 3 -->\r
- <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=28495" xpath="//flow/block/block[8]/@background"/>\r
- <!-- third cell in row 3 -->\r
- <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=56991" xpath="//flow/block/block[9]/@background"/>\r
- </checks>\r
-</testcase>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks relative positioned background images on a fo:table-cell.
+ </p>
+ </info>
+ <variables>
+ <img>../../resources/images/box1.png</img>
+ </variables>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="15pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="normal" white-space-collapse="true">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:table border-collapse="separate">
+ <fo:table-column />
+ <fo:table-column />
+ <fo:table-column />
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue"
+ background-image="##img"
+ background-position-horizontal="right"
+ background-repeat="no-repeat">
+ <fo:block>image in top right corner</fo:block>
+ </fo:table-cell>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green"
+ background-image="##img"
+ background-position-horizontal="right"
+ background-position-vertical="center"
+ background-repeat="no-repeat">
+ <fo:block>image in center right</fo:block>
+ </fo:table-cell>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow"
+ background-image="##img"
+ background-position-horizontal="right"
+ background-position-vertical="bottom"
+ background-repeat="no-repeat">
+ <fo:block>image in bottom right corner</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow"
+ background-image="##img"
+ background-position-horizontal="center"
+ background-repeat="no-repeat">
+ <fo:block>image in top center</fo:block>
+ </fo:table-cell>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue"
+ background-image="##img"
+ background-position-horizontal="center"
+ background-position-vertical="center"
+ background-repeat="no-repeat">
+ <fo:block>image in center</fo:block>
+ </fo:table-cell>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green"
+ background-image="##img"
+ background-position-horizontal="center"
+ background-position-vertical="bottom"
+ background-repeat="no-repeat">
+ <fo:block>image in bottom center</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="green"
+ background-image="##img"
+ background-repeat="no-repeat">
+ <fo:block>image in top left</fo:block>
+ </fo:table-cell>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="yellow"
+ background-image="##img"
+ background-position-vertical="center"
+ background-repeat="no-repeat">
+ <fo:block>image in center left</fo:block>
+ </fo:table-cell>
+ <fo:table-cell margin="0pt" padding="5pt 10pt 20pt 15pt" height="1in" background-color="blue"
+ background-image="##img"
+ background-position-vertical="bottom"
+ background-repeat="no-repeat">
+ <fo:block>image in bottom left</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <!-- first cell in row 1 -->
+ <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=0" xpath="//flow/block/block[1]/@background"/>
+ <!-- second cell in row 1 -->
+ <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=28495" xpath="//flow/block/block[2]/@background"/>
+ <!-- third cell in row 1 -->
+ <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=69991,vertical=56991" xpath="//flow/block/block[3]/@background"/>
+ <!-- first cell in row 2 -->
+ <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=0" xpath="//flow/block/block[4]/@background"/>
+ <!-- second cell in row 2 -->
+ <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=28495" xpath="//flow/block/block[5]/@background"/>
+ <!-- third cell in row 2 -->
+ <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=34995,vertical=56991" xpath="//flow/block/block[6]/@background"/>
+ <!-- first cell in row 3 -->
+ <eval expected="color=#008000,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=0" xpath="//flow/block/block[7]/@background"/>
+ <!-- second cell in row 3 -->
+ <eval expected="color=#ffff00,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=28495" xpath="//flow/block/block[8]/@background"/>
+ <!-- third cell in row 3 -->
+ <eval expected="color=#0000ff,url=../../resources/images/box1.png,repeat=no-repeat,horiz=0,vertical=56991" xpath="//flow/block/block[9]/@background"/>
+ </checks>
+</testcase>