public LinkedRectangle(Rectangle link, LineArea lineArea, InlineArea inlineArea) { this.link = link; this.lineArea = lineArea; this.inlineArea = inlineArea; }
public override void start() { currentLineArea = new LineArea(fontState, lineHeight, halfLeading, allocationWidth, startIndent + textIndent, endIndent, null); }
public void addRect(Rectangle r, LineArea lineArea, InlineArea inlineArea) { LinkedRectangle linkedRectangle = new LinkedRectangle(r, lineArea, inlineArea); linkedRectangle.setY(this.yoffset); if (this.yoffset > maxY) { maxY = this.yoffset; } rects.Add(linkedRectangle); }
public LineArea createNextLineArea() { if (this.hasLines) { this.currentLineArea.align(this.align); this.addLineArea(this.currentLineArea); } this.currentLineArea = new LineArea(fontState, lineHeight, halfLeading, allocationWidth, startIndent, endIndent, currentLineArea); this.currentLineArea.changeHyphenation(hyphProps); if (currentHeight + lineHeight > maxHeight) { return(null); } return(this.currentLineArea); }
protected void addLineArea(LineArea la) { if (!la.isEmpty()) { la.verticalAlign(); this.addDisplaySpace(this.halfLeading); int size = la.GetHeight(); this.addChild(la); this.increaseHeight(size); this.addDisplaySpace(this.halfLeading); } if (pendingFootnotes != null) { foreach (FootnoteBody fb in pendingFootnotes) { Page page = getPage(); if (!Footnote.LayoutFootnote(page, fb, this)) { page.addPendingFootnote(fb); } } pendingFootnotes = null; } }
public LinkedRectangle(LinkedRectangle lr) { this.link = lr.getRectangle(); this.lineArea = lr.getLineArea(); this.inlineArea = lr.getInlineArea(); }
public void setLineArea(LineArea lineArea) { this.lineArea = lineArea; }
public LineArea(FontState fontState, int lineHeight, int halfLeading, int allocationWidth, int startIndent, int endIndent, LineArea prevLineArea) : base(fontState) { this.currentFontState = fontState; this.lineHeight = lineHeight; this.nominalFontSize = fontState.FontSize; this.nominalGlyphHeight = fontState.Ascender - fontState.Descender; this.placementOffset = fontState.Ascender; this.contentRectangleWidth = allocationWidth - startIndent - endIndent; this.fontState = fontState; this.allocationHeight = this.nominalGlyphHeight; this.halfLeading = this.lineHeight - this.allocationHeight; this.startIndent = startIndent; this.endIndent = endIndent; if (prevLineArea != null) { IEnumerator e = prevLineArea.pendingAreas.GetEnumerator(); Box b = null; bool eatMoreSpace = true; int eatenWidth = 0; while (eatMoreSpace) { if (e.MoveNext()) { b = (Box)e.Current; if (b is InlineSpace) { InlineSpace isp = (InlineSpace)b; if (isp.isEatable()) { eatenWidth += isp.getSize(); } else { eatMoreSpace = false; } } else { eatMoreSpace = false; } } else { eatMoreSpace = false; b = null; } } while (b != null) { pendingAreas.Add(b); if (e.MoveNext()) { b = (Box)e.Current; } else { b = null; } } pendingWidth = prevLineArea.getPendingWidth() - eatenWidth; } }
public LineArea createNextLineArea() { if (this.hasLines) { this.currentLineArea.align(this.align); this.addLineArea(this.currentLineArea); } this.currentLineArea = new LineArea(fontState, lineHeight, halfLeading, allocationWidth, startIndent, endIndent, currentLineArea); this.currentLineArea.changeHyphenation(hyphProps); if (currentHeight + lineHeight > maxHeight) { return null; } return this.currentLineArea; }
public void RenderLineArea(LineArea area) { int rx = this.currentAreaContainerXPosition + area.getStartIndent(); int ry = this.currentYPosition; int w = area.getContentWidth(); int h = area.GetHeight(); this.currentYPosition -= area.getPlacementOffset(); this.currentXPosition = rx; int bl = this.currentYPosition; foreach (Box b in area.getChildren()) { if (b is InlineArea) { InlineArea ia = (InlineArea) b; this.currentYPosition = ry - ia.getYOffset(); } else { this.currentYPosition = ry - area.getPlacementOffset(); } b.render(this); } this.currentYPosition = ry - h; this.currentXPosition = rx; }