Table of Contents

Class TextLayoutResult

Namespace
iText.Layout.Layout
Assembly
itext.layout.dll

Represents the result of a text layout.

public class TextLayoutResult : MinMaxWidthLayoutResult
Inheritance
TextLayoutResult
Inherited Members

Constructors

TextLayoutResult(int, LayoutArea, IRenderer, IRenderer)

Creates the LayoutResult result of layouting }.

public TextLayoutResult(int status, LayoutArea occupiedArea, IRenderer splitRenderer, IRenderer overflowRenderer)

Parameters

status int

the status of Layout(LayoutContext)

occupiedArea LayoutArea

the area occupied by the content

splitRenderer IRenderer

the renderer to draw the split part of the content

overflowRenderer IRenderer

the renderer to draw the overflowed part of the content

Remarks

Creates the LayoutResult result of layouting }. The causeOfNothing will be set as null.

TextLayoutResult(int, LayoutArea, IRenderer, IRenderer, IRenderer)

Creates the LayoutResult result of layouting }.

public TextLayoutResult(int status, LayoutArea occupiedArea, IRenderer splitRenderer, IRenderer overflowRenderer, IRenderer cause)

Parameters

status int

the status of Layout(LayoutContext)

occupiedArea LayoutArea

the area occupied by the content

splitRenderer IRenderer

the renderer to draw the split part of the content

overflowRenderer IRenderer

the renderer to draw the overflowed part of the content

cause IRenderer

the first renderer to produce NOTHING

Fields

containsPossibleBreak

protected bool containsPossibleBreak

Field Value

bool

endsWithSplitCharacter

protected bool endsWithSplitCharacter

Field Value

bool

leftMinWidth

protected float leftMinWidth

Field Value

float

rightMinWidth

protected float rightMinWidth

Field Value

float

splitForcedByNewline

Indicates whether split was forced by new line symbol in text or not.

protected bool splitForcedByNewline

Field Value

bool

startsWithSplitCharacterWhiteSpace

protected bool startsWithSplitCharacterWhiteSpace

Field Value

bool

wordHasBeenSplit

Indicates whether some word was split during layout.

protected bool wordHasBeenSplit

Field Value

bool

Methods

GetLeftMinWidth()

Gets min width of the leftmost unbreakable part of the TextRenderer#line after layout.

public virtual float GetLeftMinWidth()

Returns

float

min width of the leftmost unbreakable part of the TextRenderer#line after layout.

Remarks

Gets min width of the leftmost unbreakable part of the TextRenderer#line after layout. This value leftMinWidth includes left-side additional width, i.e. left margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, leftMinWidth also includes right-side additional width.

GetRightMinWidth()

Gets min width of the rightmost unbreakable part of the TextRenderer#line after layout.

public virtual float GetRightMinWidth()

Returns

float

min width of the leftmost unbreakable part of the TextRenderer#line after layout.

Remarks

Gets min width of the rightmost unbreakable part of the TextRenderer#line after layout. This value includes right-side additional width, i.e. right margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, this value must be -1 and right-side additional width must be included in leftMinWidth.

IsContainsPossibleBreak()

Indicates whether split renderer contains possible break.

public virtual bool IsContainsPossibleBreak()

Returns

bool

true if there's a possible break within the split renderer.

Remarks

Indicates whether split renderer contains possible break. Possible breaks are either whitespaces or split characters.

See Also

IsEndsWithSplitCharacter()

Indicates whether TextRenderer#line ends with a splitCharacter.

public virtual bool IsEndsWithSplitCharacter()

Returns

bool

true if TextRenderer#line ends with a splitCharacter.

See Also

IsSplitForcedByNewline()

Indicates whether split was forced by new line symbol in rendered text.

public virtual bool IsSplitForcedByNewline()

Returns

bool

whether split was forced by new line or not.

Remarks

Indicates whether split was forced by new line symbol in rendered text. The value will be set as true if, for example, the rendered text contains '\n' symbol. This value can also be true even if the text was fully placed, but had line break at the end.

IsStartsWithSplitCharacterWhiteSpace()

Indicates whether TextRenderer#line starts with a whitespace.

public virtual bool IsStartsWithSplitCharacterWhiteSpace()

Returns

bool

true if TextRenderer#line starts with a whitespace.

IsWordHasBeenSplit()

Indicates whether some word in a rendered text was split during layout.

public virtual bool IsWordHasBeenSplit()

Returns

bool

whether some word was split or not.

Remarks

Indicates whether some word in a rendered text was split during layout. The value will be set as true if, for example, the rendered words width is bigger than the width of layout area.

SetContainsPossibleBreak(bool)

public virtual TextLayoutResult SetContainsPossibleBreak(bool containsPossibleBreak)

Parameters

containsPossibleBreak bool

indicates that split renderer contains possible break.

Returns

TextLayoutResult

this layout result the setting was applied on.

See Also

SetEndsWithSplitCharacter(bool)

public virtual TextLayoutResult SetEndsWithSplitCharacter(bool endsWithSplitCharacter)

Parameters

endsWithSplitCharacter bool

indicates if TextRenderer#line ends with a splitCharacter.

Returns

TextLayoutResult

this layout result the setting was applied on.

See Also

SetLeftMinWidth(float)

Sets min width of the leftmost unbreakable part of the TextRenderer#line after layout.

public virtual TextLayoutResult SetLeftMinWidth(float leftMinWidth)

Parameters

leftMinWidth float

min width of the leftmost unbreakable part of the TextRenderer#line after layout.

Returns

TextLayoutResult

this layout result the setting was applied on.

Remarks

Sets min width of the leftmost unbreakable part of the TextRenderer#line after layout. This value includes left-side additional width, i.e. left margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, leftMinWidth also includes right-side additional width.

SetRightMinWidth(float)

Sets min width of the rightmost unbreakable part of the TextRenderer#line after layout.

public virtual TextLayoutResult SetRightMinWidth(float rightMinWidth)

Parameters

rightMinWidth float

min width of the rightmost unbreakable part of the TextRenderer#line after layout.

Returns

TextLayoutResult

this layout result the setting was applied on.

Remarks

Sets min width of the rightmost unbreakable part of the TextRenderer#line after layout. This value includes right-side additional width, i.e. right margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, this value must be -1 and right-side additional width must be included in leftMinWidth.

SetSplitForcedByNewline(bool)

public virtual TextLayoutResult SetSplitForcedByNewline(bool isSplitForcedByNewline)

Parameters

isSplitForcedByNewline bool

indicates that split was forced by new line symbol in rendered text.

Returns

TextLayoutResult

this layout result the setting was applied on.

See Also

SetStartsWithSplitCharacterWhiteSpace(bool)

public virtual TextLayoutResult SetStartsWithSplitCharacterWhiteSpace(bool startsWithSplitCharacterWhiteSpace)

Parameters

startsWithSplitCharacterWhiteSpace bool

indicates if TextRenderer#line starts with a split character that is also a whitespace.

Returns

TextLayoutResult

this layout result the setting was applied on.

See Also

SetWordHasBeenSplit(bool)

public virtual TextLayoutResult SetWordHasBeenSplit(bool wordHasBeenSplit)

Parameters

wordHasBeenSplit bool

indicates that some word was split during layout.

Returns

TextLayoutResult

this layout result the setting was applied on

See Also