renderBlocks(bv, children);
currentIPPosition = saveIP;
- currentBPPosition = saveBP + bv.getHeight();
+ currentBPPosition = saveBP + bv.getAllocBPD();
}
}
currentBlockIPPosition =
currentIPPosition + line.getStartIndent();
renderLineArea(line);
- currentBPPosition += line.getHeight();
+ currentBPPosition += line.getAllocBPD();
}
}
}
if (children == null) {
handleBlockTraits(block);
// simply move position
- currentBPPosition += block.getHeight();
+ currentBPPosition += block.getAllocBPD();
} else if (block instanceof BlockViewport) {
renderBlockViewport((BlockViewport) block, children);
} else {
renderBlocks(block, children);
// stacked and relative blocks effect stacking
- currentBPPosition = saveBP + block.getHeight();
+ currentBPPosition = saveBP + block.getAllocBPD();
}
currentIPPosition = saveIP;
}
/** @see org.apache.fop.render.Renderer */
protected void renderCharacter(Character ch) {
- currentBlockIPPosition += ch.getWidth();
+ currentBlockIPPosition += ch.getAllocIPD();
}
/** @see org.apache.fop.render.Renderer */
// for the current block by the width or height of the space
// it may also have styling (only on this object) that needs
// handling
- currentBlockIPPosition += space.getWidth();
+ currentBlockIPPosition += space.getAllocIPD();
}
/** @see org.apache.fop.render.Renderer */
protected void renderLeader(Leader area) {
- currentBlockIPPosition += area.getWidth();
+ currentBlockIPPosition += area.getAllocIPD();
}
/** @see org.apache.fop.render.Renderer */
protected void renderText(TextArea text) {
- currentBlockIPPosition += text.getWidth();
+ currentBlockIPPosition += text.getAllocIPD();
}
/** @see org.apache.fop.render.Renderer */
while (iter.hasNext()) {
renderInlineArea((InlineArea) iter.next());
}
- currentBlockIPPosition = saveIP + ip.getWidth();
+ currentBlockIPPosition = saveIP + ip.getAllocIPD();
}
/** @see org.apache.fop.render.Renderer */
} else if (content instanceof ForeignObject) {
renderForeignObject((ForeignObject) content, contpos);
}
- currentBlockIPPosition += viewport.getWidth();
+ currentBlockIPPosition += viewport.getAllocIPD();
currentBPPosition = saveBP;
}
graphics.drawString(s, 220, 200);
// TODO: render text decorations
- currentBlockIPPosition += text.getWidth();
+ currentBlockIPPosition += text.getAllocIPD();
}
/** @see org.apache.fop.render.AbstractRenderer */
float startx = (currentIPPosition + ipMarginOffset) / 1000f;
float starty = (currentBPPosition + bpMarginOffset) / 1000f;
- float width = block.getWidth() / 1000f;
+ float width = block.getIPD() / 1000f;
+ float height = block.getBPD() / 1000f;
Integer spaceStart = (Integer) block.getTrait(Trait.SPACE_START);
if (spaceStart != null) {
startx += spaceStart.floatValue() / 1000;
- width -= spaceStart.floatValue() / 1000;
}
- Integer spaceEnd = (Integer) block.getTrait(Trait.SPACE_END);
- if (spaceEnd != null) {
- width -= spaceEnd.floatValue() / 1000;
+ BorderProps borderStart = (BorderProps) block.getTrait(Trait.BORDER_START);
+ if (borderStart != null) {
+ width += borderStart.width / 1000f;
+ }
+ Integer paddingStart = (Integer) block.getTrait(Trait.PADDING_START);
+ if (paddingStart != null) {
+ width += paddingStart.intValue() / 1000f;
+ }
+ BorderProps borderEnd = (BorderProps) block.getTrait(Trait.BORDER_END);
+ if (borderEnd != null) {
+ width += borderEnd.width / 1000f;
+ }
+ Integer paddingEnd = (Integer) block.getTrait(Trait.PADDING_END);
+ if (paddingEnd != null) {
+ width += paddingEnd.intValue() / 1000f;
+ }
+
+ BorderProps borderBefore = (BorderProps) block.getTrait(Trait.BORDER_BEFORE);
+ if (borderBefore != null) {
+ height += borderBefore.width / 1000f;
+ }
+ Integer paddingBefore = (Integer) block.getTrait(Trait.PADDING_BEFORE);
+ if (paddingBefore != null) {
+ height += paddingBefore.intValue() / 1000f;
+ }
+ BorderProps borderAfter = (BorderProps) block.getTrait(Trait.BORDER_AFTER);
+ if (borderAfter != null) {
+ height += borderAfter.width / 1000f;
+ }
+ Integer paddingAfter = (Integer) block.getTrait(Trait.PADDING_AFTER);
+ if (paddingAfter != null) {
+ height += paddingAfter.intValue() / 1000f;
}
drawBackAndBorders(block, startx, starty,
- width, block.getHeight() / 1000f);
+ width, height);
}
/**
float x = (float)(bv.getXOffset() + containingIPPosition) / 1000f;
float y = (float)(bv.getYOffset() + containingBPPosition) / 1000f;
- float width = (float)bv.getWidth() / 1000f;
- float height = (float)bv.getHeight() / 1000f;
+ float width = (float)bv.getIPD() / 1000f;
+ float height = (float)bv.getBPD() / 1000f;
drawBackAndBorders(bv, x, y, width, height);
double[] vals = ctm.toArray();
//boolean aclock = vals[2] == 1.0;
if (vals[2] == 1.0) {
- ctm = ctm.translate(-saveBP - bv.getHeight(), -saveIP);
+ ctm = ctm.translate(-saveBP - bv.getBPD(), -saveIP);
} else if (vals[0] == -1.0) {
- ctm = ctm.translate(-saveIP - bv.getWidth(), -saveBP - bv.getHeight());
+ ctm = ctm.translate(-saveIP - bv.getIPD(), -saveBP - bv.getBPD());
} else {
- ctm = ctm.translate(saveBP, saveIP - bv.getWidth());
+ ctm = ctm.translate(saveBP, saveIP - bv.getIPD());
}
}
saveGraphicsState();
float x = (float)bv.getXOffset() / 1000f;
float y = (float)bv.getYOffset() / 1000f;
- float width = (float)bv.getWidth() / 1000f;
- float height = (float)bv.getHeight() / 1000f;
+ float width = (float)bv.getIPD() / 1000f;
+ float height = (float)bv.getBPD() / 1000f;
clip(x, y, width, height);
}
currentIPPosition = saveIP;
currentBPPosition = saveBP;
- currentBPPosition += (int)(bv.getHeight());
+ currentBPPosition += (int)(bv.getAllocBPD());
}
currentFontName = saveFontName;
}
public void renderInlineParent(InlineParent ip) {
float start = (currentBlockIPPosition + ipMarginOffset) / 1000f;
float top = (ip.getOffset() + currentBPPosition + bpMarginOffset) / 1000f;
- float width = ip.getWidth() / 1000f;
- float height = ip.getHeight() / 1000f;
+ float width = ip.getIPD() / 1000f;
+ float height = ip.getBPD() / 1000f;
drawBackAndBorders(ip, start, top, width, height);
// render contents
+ (ch.getTextWordSpaceAdjust() / 1000f) + " Tw [" + startText);
textOpen = true;
}
- prevWordWidth = ch.getWidth();
+ prevWordWidth = ch.getIPD();
prevWordX = rx;
String s = ch.getChar();
+ (text.getTextWordSpaceAdjust() / 1000f) + " Tw [" + startText);
textOpen = true;
}
- prevWordWidth = text.getWidth();
+ prevWordWidth = text.getIPD();
prevWordX = rx;
String s = text.getTextArea();
float x = currentBlockIPPosition / 1000f;
float y = (currentBPPosition + viewport.getOffset()) / 1000f;
- float width = viewport.getWidth() / 1000f;
- float height = viewport.getHeight() / 1000f;
+ float width = viewport.getIPD() / 1000f;
+ float height = viewport.getBPD() / 1000f;
drawBackAndBorders(viewport, x, y, width, height);
endTextObject();
}
float startx = ((float) currentBlockIPPosition) / 1000f;
float starty = ((currentBPPosition + area.getOffset()) / 1000f);
- float endx = (currentBlockIPPosition + area.getWidth()) / 1000f;
+ float endx = (currentBlockIPPosition + area.getIPD()) / 1000f;
if (!alt) {
currentStream.add(area.getRuleThickness() / 1000f + " w\n");
drawLine(startx, starty, endx, starty);
saveGraphicsState();
int x = bv.getXOffset() + containingIPPosition;
int y = bv.getYOffset() + containingBPPosition;
- int width = bv.getWidth();
- int height = bv.getHeight();
+ int width = bv.getIPD();
+ int height = bv.getBPD();
clip(x, y, width, height);
}
double[] vals = ctm.toArray();
//boolean aclock = vals[2] == 1.0;
if (vals[2] == 1.0) {
- ctm = ctm.translate(-saveBP - bv.getHeight(), -saveIP);
+ ctm = ctm.translate(-saveBP - bv.getBPD(), -saveIP);
} else if (vals[0] == -1.0) {
- ctm = ctm.translate(-saveIP - bv.getWidth(), -saveBP - bv.getHeight());
+ ctm = ctm.translate(-saveIP - bv.getIPD(), -saveBP - bv.getBPD());
} else {
- ctm = ctm.translate(saveBP, saveIP - bv.getWidth());
+ ctm = ctm.translate(saveBP, saveIP - bv.getIPD());
}
}
saveGraphicsState();
int x = bv.getXOffset();
int y = bv.getYOffset();
- int width = bv.getWidth();
- int height = bv.getHeight();
+ int width = bv.getIPD();
+ int height = bv.getBPD();
clip(x, y, width, height);
}
currentIPPosition = saveIP;
currentBPPosition = saveBP;
- currentBPPosition += (int)(bv.getHeight());
+ currentBPPosition += (int)(bv.getAllocBPD());
}
currentFontName = saveFontName;
}
float startx = currentIPPosition;
float starty = currentBPPosition;
drawBackAndBorders(block, startx, starty,
- block.getWidth(), block.getHeight());
+ block.getIPD(), block.getBPD());
}
/**
currentBlockIPPosition / 1000,
(currentBPPosition + area.getOffset()
- area.getRuleThickness() / 2) / 1000,
- (currentBlockIPPosition + area.getWidth()) / 1000,
+ (currentBlockIPPosition + area.getIPD()) / 1000,
(currentBPPosition + area.getOffset()
- area.getRuleThickness() / 2) / 1000);
line.setAttributeNS(null, "style", style);
* @see org.apache.fop.render.AbstractRenderer#renderBlock(Block)
*/
protected void renderBlock(Block block) {
- String prop = " width=\"" + block.getWidth() +
- "\" ipd=\"" + block.getIPD() +
- "\" height=\"" + block.getHeight() + "\"";
+ String prop = " ipd=\"" + block.getIPD() +
+ "\" bpd=\"" + block.getBPD() + "\"";
Map map = block.getTraits();
if (map != null) {
prop = prop + " props=\"" + getPropString(map) + "\"";
if (map != null) {
prop = " props=\"" + getPropString(map) + "\"";
}
- writeStartTag("<lineArea height=\"" + line.getHeight() + "\""
+ writeStartTag("<lineArea bpd=\"" + line.getBPD() + "\""
+ prop + ">");
super.renderLineArea(line);
writeEndTag("</lineArea>");
* @see org.apache.fop.render.Renderer#renderInlineSpace(Space)
*/
protected void renderInlineSpace(Space space) {
- writeElement("<space width=\"" + space.getWidth() + "\"/>");
+ writeElement("<space ipd=\"" + space.getIPD() + "\"/>");
}
/**
style = "ridge";
break;
}
- writeElement("<leader width=\"" + area.getWidth()
+ writeElement("<leader ipd=\"" + area.getIPD()
+ "\" ruleStyle=\"" + style
+ "\" ruleThickness=\"" + area.getRuleThickness()
+ "\"/>");