示例#1
0
 public LinkedRectangle(Rectangle link, LineArea lineArea,
                        InlineArea inlineArea)
 {
     this.link       = link;
     this.lineArea   = lineArea;
     this.inlineArea = inlineArea;
 }
示例#2
0
 public LinkedRectangle(Rectangle link, LineArea lineArea,
                        InlineArea inlineArea)
 {
     this.link = link;
     this.lineArea = lineArea;
     this.inlineArea = inlineArea;
 }
示例#3
0
 public override void start()
 {
     currentLineArea = new LineArea(fontState, lineHeight, halfLeading,
                                    allocationWidth,
                                    startIndent + textIndent, endIndent,
                                    null);
 }
示例#4
0
文件: LinkSet.cs 项目: nholik/Fo.Net
 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);
 }
示例#5
0
        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);
        }
示例#6
0
 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);
 }
示例#7
0
 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;
     }
 }
示例#8
0
 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;
     }
 }
示例#9
0
 public override void start()
 {
     currentLineArea = new LineArea(fontState, lineHeight, halfLeading,
                                    allocationWidth,
                                    startIndent + textIndent, endIndent,
                                    null);
 }
示例#10
0
 public LinkedRectangle(LinkedRectangle lr)
 {
     this.link = lr.getRectangle();
     this.lineArea = lr.getLineArea();
     this.inlineArea = lr.getInlineArea();
 }
示例#11
0
 public void setLineArea(LineArea lineArea)
 {
     this.lineArea = lineArea;
 }
示例#12
0
        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;
            }
        }
示例#13
0
文件: LineArea.cs 项目: nholik/Fo.Net
        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;
            }
        }
示例#14
0
 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;
 }
示例#15
0
 public LinkedRectangle(LinkedRectangle lr)
 {
     this.link       = lr.getRectangle();
     this.lineArea   = lr.getLineArea();
     this.inlineArea = lr.getInlineArea();
 }
示例#16
0
        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;
        }
示例#17
0
 public void setLineArea(LineArea lineArea)
 {
     this.lineArea = lineArea;
 }