[]
        
(Showing Draft Content)

GrapeCity.Documents.Text.TextLayout.Truncate

Truncate Method

Truncate(TrimmingGranularity)

If a portion of the text content does not fit into the current layout bounds, removes that portion so that the remaining text fits.

If the text is truncated and lastLineTrimming is not None, ellipsis (specified by EllipsisCharCode) is appended to the last line to indicate that it was trimmed.

Declaration
public bool Truncate(TrimmingGranularity lastLineTrimming = TrimmingGranularity.None)
Public Function Truncate(Optional lastLineTrimming As TrimmingGranularity = TrimmingGranularity.None) As Boolean
Parameters
Type Name Description
TrimmingGranularity lastLineTrimming

The text granularity used when trimming the last line of text.

Returns
Type Description
bool

true if at least some text remains that fits into the current layout bounds, false if the current layout did not contain any text or all text had to be removed.

Remarks

Note that if there is only one line, and it does not fit into the available height, it is not removed, and this method returns true.