Document Solutions for Imaging
GrapeCity.Documents.Imaging Assembly / GrapeCity.Documents.Text Namespace / TextLayout Class
Properties Methods

In This Topic
    TextLayout Class Members
    In This Topic

    The following tables list the members exposed by TextLayout.

    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public PropertyGets or sets a value indicating whether the line spacing should be added after the last line of text. The default is false.  
    Public PropertyGets or sets a value indicating whether to delay full text alignment till when any of the Split* methods is called.

    Do not use this property unless you are calling any of the Split* methods to render the text.

     
    Public PropertyGets or sets a value indicating whether long words can overhang beyond the layout box bounds. The default is false.  
    Public PropertyGets the list of anchored objects.  
    Public PropertyGets the array with bidi levels of the code points.  
    Public PropertyGets or sets whether the whole first line of a paragraph with indentation can be skipped. The default is true.  
    Public PropertyGets the array mapping code points to glyphs.  
    Public PropertyGets the number of code points.  
    Public PropertyGets the array of CodePointFlags, one for each code point.  
    Public PropertyGets the array of UTF-32 characters (code points). Only the first CodePointCount elements should be taken into account.  
    Public PropertyGets or sets the width of the layout box measured from the left margin (for positive values) or from the right margin (for negative values), in graphic units.  
    Public PropertyGets the height of the formatted text, in graphic units.  
    Public PropertyGets a value indicating whether the height of the formatted text fits in the specified MaxHeight.  
    Public PropertyGets the height of the formatted text, taking into account the trailing whitespace at the end of each line, in graphic units.  
    Public PropertyGets the rectangle containing the formatted text, in graphic units.  
    Public PropertyGets the width of the formatted text, in graphic units.  
    Public PropertyGets a value indicating whether the width of the formatted text fits in the specified MaxWidth.  
    Public PropertyGets the width of the formatted text, taking into account the trailing whitespace at the end of each line, in graphic units.  
    Public PropertyGet the rectangle of the formatted text, taking into account the trailing whitespace at the end of each line.  
    Public PropertyGets the X coordinate of the rectangle containing the formatted text, in graphic units.  
    Public PropertyGets the Y coordinate of the rectangle containing the formatted text, in graphic units.  
    Public PropertyGets the default text format for the current text layout.  
    Public PropertyGets or sets the spacing between the default tab stops, in graphic units.  
    Public PropertyGets or sets a UTF-32 character code used as a delimiter that signals the beginning of the portion of text to be preserved (for text trimming).  
    Public PropertyGets or sets the delimiter count, counting from the end of the text, to preserve text from (for text trimming).  
    Public PropertyGets or sets a UTF-32 code of the omission sign (ellipsis character) for text trimming.

    Setting this property to 0 prevents the ellipsis character from showing.

     
    Public PropertyGets or sets the indent of the first line after paragraph separator, in graphic units.  
    Public PropertyGets or sets a value indicating whether the first line of text is the start of paragraph. The default is true.  
    Public PropertyGets or sets the flow direction (how lines of text are placed relative to one another).  
    Public PropertyGets or sets the custom font collection used for searching fonts and font fallbacks.  
    Public PropertyGets or sets a value specifying the scope for searching fallback fonts for the glyphs missing in the font defined in TextFormat.  
    Public PropertyGets or sets the uniform scale factor for all fonts used in the current text layout.

    Valid values are from 0.001 to 1000. The default is 1.

     
    Public PropertyGets the array of TextFormat objects, one for each code point.  
    Public PropertyGets the array with general classification of the code points.  
    Public PropertyGets the number of resulting glyphs.  
    Public PropertyGets the linked list with each glyph info.  
    Public PropertyGets the array mapping code points to glyph runs.  
    Public PropertyGets or sets a value indicating whether the ideographic baseline should be used instead of the Roman baseline for hieroglyph characters. The default is false.  
    Public PropertyGets or sets a value indicating whether line spacing for the last line is considered a part of the layout content. The default is false.  
    Public PropertyGets or sets a value indicating whether the trailing line break causes a blank line to be added to the output text layout. The default is false.  
    Public PropertyGets the list of inline objects.  
    Public PropertyGets the list of inline elements derived from Inline, such as TextRun and LineBreak.  
    Public PropertyGets or sets the maximum white space extension factor before applying extension to other characters when text is justified.

    Valid values are from 0 to 10000. The default is 2.5.

     
    Public PropertyGets or sets the white space shrinking factor when text is justified.

    Valid values are from 0.0 to 1.0. The default is 0.2.

     
    Public PropertyGets or sets the maximum text extension factor when text is justified.

    Valid values are from 0 to 10000. The default is 0.3.

     
    Public PropertyGets or sets a value indicating whether for paragraphs that have TextAlignment set to TextAlignment.Distributed, the last line will be justified (typical in East Asian typography).

    This property has effect only for horizontal text, and only if TextExtensionStrategy is set to TextExtensionStrategy.EastAsianExcel or TextExtensionStrategy.Excel.

    The default is false.

     
    Public PropertyGets or sets a value indicating whether the last line of text is the end of paragraph. The default is true.  
    Public PropertyGets a value indicating if PerformLayout method was executed at least once.  
    Public PropertyGets or sets a value specifying the line breaking algorithm.

    The default is LineBreakingRules.Unicode.

     
    Public PropertyGets or sets a value indicating whether the typographic line gap should be added before the first line of text. The default is false.  
    Public PropertyGets the list of text lines after executing the PerformLayout method.  
    Public PropertyGets or sets the minimum number of lines not using hyphens after breaking a word across lines and displaying a visible hyphen at the position of soft hyphen.

    The default is zero.

     
    Public PropertyGets or sets the scaling factor to be applied to the computed line height.

    Valid values are from 0 to 1000. The default is 1.

     
    Public PropertyGets or sets all margins of the layout box, in graphic units.

    Returns null if the margins have different values.

     
    Public PropertyGets or sets the bottom margin of the layout box, in graphic units.  
    Public PropertyGets or sets the left margin of the layout box, in graphic units.  
    Public PropertyGets or sets the right margin of the layout box, in graphic units.  
    Public PropertyGets or sets the top margin of the layout box, in graphic units.  
    Public PropertyGets or sets the height of the layout box, in graphic units.  
    Public PropertyGets or sets the maximum fraction of the last line's height overflowing beyond the layout bounds for that line not to be truncated. The default is 0 (last line must completely fit within the layout bounds). Valid values are from 0 to 1. This property does not affect values returned by ContentHeightFitsInBounds or ContentWidthFitsInBounds. This property is ignored if ObjectRects is not null.  
    Public PropertyGets or sets the width of the layout box, in graphic units.  
    Public PropertyGets or sets the explicit minimal distance between lines, in graphic units.  
    Public PropertyGets or sets a value indicating whether justified or distributed text alignment should be applied as if the SimplifiedWordBreak is always false. In other words, when this property is set to true the value of SimplifiedWordBreak does not affect the text alignment rules, it affects only the line breaking behavior.

    The default is false.

     
    Public PropertyGets or sets the list of areas occupied by embedded objects.  
    Public PropertyGets or sets the alignment of paragraphs along the flow direction axis.  
    Public PropertyGets or sets the additional spacing between paragraphs, in graphic units.  
    Public PropertyGets or sets the resolution (graphic units per inch) used by the current text layout.  
    Public PropertyGets or sets a value indicating whether the fonts should be searched in the custom collection only, if any specified. The default is false.  
    Public PropertyGets or sets the base direction for horizontal and sideways text. The default is false.  
    Public PropertyGets or sets a value indicating whether sideways text should be rotated counterclockwise. The default is false.  
    Public PropertyGets or sets the height of the layout box measured from the top margin (for positive values) or from the bottom margin (for negative values), in graphic units.  
    Public PropertyGets the array of ScriptCode's, one for each code point.  
    Public PropertyGets the array of ScriptTag's, one for each code point.  
    Public PropertyGets or sets a value indicating whether to use simplified text alignment rules. In particular, the same rules will be applied to narrow and wide (East Asian) characters.

    This property has effect only for horizontal text, and only if SimplifiedWordBreak is true and NoExcelAlignment is false.

    The default is false.

     
    Public PropertyGets or sets a value indicating whether to use simplified rules when determining word boundaries and line breaks.

    Setting this property to true prevents word breaking on certain non-whitespace characters to make word breaking behavior similar to that of MS Excel.

    The default is false.

     
    Public PropertyGets or sets a UTF-32 character code used as replacement for soft hyphen characters (0x00AD) at ends of lines when breaking words across lines.

    The default is 0x002D (the Unicode hyphen-minus character).

    Setting this to 0 breaks words without showing any visible hyphen character.

    Setting this to -1 prevents breaking words at soft hyphens.

    Note that if this property is changed, either RecalculateGlyphs or PerformLayout with true as the parameter must be called for the changes to be processed correctly.  
    Public PropertyGets the first code point index of the current split rest, if this TextLayout contains the rest lines after calling the Split or SplitAndBalance methods.  
    Public PropertyGets or sets a value indicating if shaping and positioning of graphemes should be skipped for the sake of speed. The default is false.  
    Public PropertyGets or sets the list of tab stops.  
    Public PropertyGets or sets the alignment of text along the reading direction axis.  
    Public PropertyGets or sets a value specifying the rules for text extension when text is justified.

    The default is Default.

     
    Public PropertyGets or sets the text granularity used to trim text overflowing the layout box.  
    Public PropertyGets or sets the explicit distance between lines, in graphic units.  
    Public PropertyGets or sets a value indicating if the linked and fallback fonts have to be embeddable. The default is false.  
    Public PropertyGets or sets a value indicating whether the following scripts should use their old tags: Bengali, Devanagari, Gujarati, Gurmukhi, Kannada, Malayalam, Myanmar, Odia, Tamil, Telugu. The default is false.  
    Public PropertyGets a value indicating whether the FlowDirection was vertical when RecalculateGlyphs was last called.  
    Public PropertyGets or sets a value specifying the word breaking algorithm.

    The default is WordBoundaryRules.Unicode.

     
    Public PropertyGets or sets a value specifying how text lines are broken to avoid text overflowing the layout box.  
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded. Adds a text run with default formatting to the end of the Inlines collection.  
    Public MethodAdds an anchored object with specified dimensions to the end of the Inlines collection.  
    Public MethodOverloaded. Adds an inline object with specified dimensions to the end of the Inlines collection.  
    Public MethodOverloaded. Adds a line break element to the end of the Inlines collection.  
    Public MethodOverloaded. Adds a special character (0x2029) that causes a paragraph break but prevents a page break between paragraphs (GrapeCity specifics).  
    Public MethodOverloaded. Appends a form feed character ('\f', character code 0x000C) to the text. This causes any text added after it to "not fit" - if the text layout is drawn, that text will not be rendered. If the Split() method is called, the text will be split at this point.  
    Public MethodOverloaded. Adds a line separator character (0x2028) that causes a line break without ending the paragraph.  
    Public MethodAdjusts the positions of content rectangle, inline and anchored objects by a specified amount.  
    Public MethodClears the current text layout, removing all text and formatting associated with individual text runs.  
    Public MethodCreates a copy of the current TextLayout instance.  
    Public MethodGets the InlineObject at the specified code point index.  
    Public MethodReturns the list of TextRect objects for the specified range of code points.  
    Public MethodMaps a character range to the corresponding code point range.  
    Public MethodMaps a code point range to the corresponding character range.  
    Public MethodDetermines the coordinates for all lines and glyph runs. Optionally calls RecalculateGlyphs prior to performing the layout.  
    Public MethodConverts characters in the current TextLayout to glyphs, and performs text shaping.

    In order to layout the text (e.g. when rendering it on a graphics), a call to this method must precede the call(s) to PerformLayout, or alternatively the PerformLayout method should be called with true as the parameter.

     
    Public MethodFits all or the first portion of the current text layout into the current layout bounds. If the whole text did not fit into the bounds, the rest is moved into a new TextLayout instance specified by the output parameter rest.  
    Public MethodFits all or the first portion of the current text layout into one or more layout areas (such as page columns). If the whole text did not fit into the provided areas, the rest is moved into a new TextLayout instance specified by the output parameter rest.

    If the whole text fits in the specified areas (i.e. rest is empty), the content is equally distributed between all areas, which in the case of page columns results in columns of equal height (balanced).

     
    Public MethodFits all or the first portion of the current text layout into one or more layout areas (such as page columns). If the whole text did not fit into the provided areas, the rest is moved into a new TextLayout instance specified by the output parameter rest.

    If the whole text fits in the specified areas (i.e. rest is empty), the content is equally distributed between all areas, which in the case of page columns results in columns of equal height (balanced).

    For details on why providing a reference to an existing TextLayout may be beneficial, see the remarks on the SplitRef method.  
    Public MethodFits all or the first portion of the current text layout into the current layout bounds. If the whole text did not fit into the bounds, the rest is moved into the TextLayout instance specified by the reference parameter rest. If it is null, a new TextLayout instance is created.  
    Public MethodIf 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 TrimmingGranularity.None, ellipsis (specified by EllipsisCharCode) is appended to the last line to indicate that it was trimmed.

     
    Top
    See Also