[]
        
(Showing Draft Content)

GrapeCity.Documents.Text.TextLayout

Class TextLayout

Namespace
GrapeCity.Documents.Text
Assembly
GcDocs.Imaging.dll

Represents one or more paragraphs of multi-formatted text. Provides text analysis and layout functionality.

public class TextLayout
Inheritance
object
TextLayout
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Constructors

TextLayout()

Initializes a new instance of the TextLayout class with Resolution set to 72 graphic units per inch.

[Obsolete("Instead, use the constructor with explicit 'resolution' parameter, or the GcGraphics.CreateTextLayout() method.", false)]
public TextLayout()

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

TextLayout(float)

Initializes a new instance of the TextLayout class.

If a TextLayout is created to be used with a GrapeCity.Documents.Drawing.GcGraphics, it is recommended to use the GrapeCity.Documents.Drawing.GcGraphics.CreateTextLayout method instead, as it ensures that properties such as Resolution and FontCollection are set up properly to be used with the graphics.

public TextLayout(float resolution)

Parameters

resolution float

Specifies the resolution (graphic units per inch).

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Properties

AddSpacingAfterLastLine

Gets or sets a value indicating whether the line spacing should be added after the last line of text. The default is false.

public bool AddSpacingAfterLastLine { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AlignmentDelayToSplit

Gets 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.

[Obsolete("This property is not used anymore. It is always equal to true.")]
public bool AlignmentDelayToSplit { get; set; }

Property Value

bool

Remarks

By default this property is false, and the text is completely aligned by the PerformLayout(bool) method. Setting this property to true delays complete alignment (e.g. justification) till one of the Split* methods is called. This improves performance when dealing with large amounts of text that is split between pages or columns, as it avoids aligning portions of text that will need to be re-aligned later anyway.

See Also

AllowOverhangingWords

Gets or sets a value indicating whether long words can overhang beyond the layout box bounds. The default is false.

public bool AllowOverhangingWords { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AnchoredObjects

Gets the list of anchored objects.

public IReadOnlyList<AnchoredObject> AnchoredObjects { get; }

Property Value

System.Collections.Generic.IReadOnlyList<T><AnchoredObject>

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

BidiLevels

Gets the array with bidi levels of the code points.

public byte[] BidiLevels { get; }

Property Value

byte[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

CanSkipFirstLineWithIndentation

Gets or sets whether the whole first line of a paragraph with indentation can be skipped. The default is true.

public bool CanSkipFirstLineWithIndentation { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ClusterMap

Gets the array mapping code points to glyphs.

public GlyphInfo[] ClusterMap { get; }

Property Value

GlyphInfo[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

CodePointCount

Gets the number of code points.

public int CodePointCount { get; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

CodePointFlags

Gets the array of CodePointFlags, one for each code point.

public CodePointFlags[] CodePointFlags { get; }

Property Value

CodePointFlags[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

CodePoints

Gets the array of UTF-32 characters (code points). Only the first CodePointCount elements should be taken into account.

public int[] CodePoints { get; }

Property Value

int[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ColumnWidth

Gets 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 float? ColumnWidth { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentHeight

Gets the height of the formatted text, in graphic units.

public float ContentHeight { get; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentHeightFitsInBounds

Gets a value indicating whether the height of the formatted text fits in the specified MaxHeight.

public bool ContentHeightFitsInBounds { get; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentHeightIncludingTrailingWhitespace

Gets the height of the formatted text, taking into account the trailing whitespace at the end of each line, in graphic units.

public float ContentHeightIncludingTrailingWhitespace { get; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentRectangle

Gets the rectangle containing the formatted text, in graphic units.

public RectangleF ContentRectangle { get; }

Property Value

System.Drawing.RectangleF

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentWidth

Gets the width of the formatted text, in graphic units.

public float ContentWidth { get; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentWidthFitsInBounds

Gets a value indicating whether the width of the formatted text fits in the specified MaxWidth.

public bool ContentWidthFitsInBounds { get; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentWidthIncludingTrailingWhitespace

Gets the width of the formatted text, taking into account the trailing whitespace at the end of each line, in graphic units.

public float ContentWidthIncludingTrailingWhitespace { get; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentWithWhitespaceBounds

Get the rectangle of the formatted text, taking into account the trailing whitespace at the end of each line.

public RectangleF ContentWithWhitespaceBounds { get; }

Property Value

System.Drawing.RectangleF

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentX

Gets the X coordinate of the rectangle containing the formatted text, in graphic units.

public float ContentX { get; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ContentY

Gets the Y coordinate of the rectangle containing the formatted text, in graphic units.

public float ContentY { get; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

DefaultFormat

Gets the default text format for the current text layout.

public TextFormat DefaultFormat { get; }

Property Value

TextFormat

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

DefaultTabStops

Gets or sets the spacing between the default tab stops, in graphic units.

public float DefaultTabStops { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

DelimiterCharCode

Gets 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 int DelimiterCharCode { get; set; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

DelimiterCharCount

Gets or sets the delimiter count, counting from the end of the text, to preserve text from (for text trimming).

public int DelimiterCharCount { get; set; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

EllipsisCharCode

Gets 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 int EllipsisCharCode { get; set; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

FirstLineIndent

Gets or sets the indent of the first line after paragraph separator, in graphic units.

public float FirstLineIndent { get; set; }

Property Value

float

Remarks

Positive value applies indentation to the first line, negative value applies indentation to all lines except the first one.

FirstLineIsStartOfParagraph

Gets or sets a value indicating whether the first line of text is the start of paragraph. The default is true.

public bool FirstLineIsStartOfParagraph { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

FlowDirection

Gets or sets the flow direction (how lines of text are placed relative to one another).

public FlowDirection FlowDirection { get; set; }

Property Value

FlowDirection

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

FontCollection

Gets or sets the custom font collection used for searching fonts and font fallbacks.

public FontCollection FontCollection { get; set; }

Property Value

FontCollection

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

FontFallbackScope

Gets or sets a value specifying the scope for searching fallback fonts for the glyphs missing in the font defined in TextFormat.

public FontFallbackScope FontFallbackScope { get; set; }

Property Value

FontFallbackScope

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

FontScaleFactor

Gets 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 float FontScaleFactor { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Formats

Gets the array of TextFormat objects, one for each code point.

public TextFormat[] Formats { get; }

Property Value

TextFormat[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

GeneralCategories

Gets the array with general classification of the code points.

public GeneralCategory[] GeneralCategories { get; }

Property Value

GeneralCategory[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

GlyphCount

Gets the number of resulting glyphs.

public int GlyphCount { get; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

GlyphLinkedList

Gets the linked list with each glyph info.

public GlyphInfo GlyphLinkedList { get; }

Property Value

GlyphInfo

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

GlyphRunMap

Gets the array mapping code points to glyph runs.

public GlyphRun[] GlyphRunMap { get; }

Property Value

GlyphRun[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

HonorIdeographicBaseline

Gets 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 bool HonorIdeographicBaseline { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

HonorLastLineSpacing

Gets 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 bool HonorLastLineSpacing { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

HonorTrailingLineBreak

Gets 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 bool HonorTrailingLineBreak { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

InlineObjects

Gets the list of inline objects.

public IReadOnlyList<InlineObject> InlineObjects { get; }

Property Value

System.Collections.Generic.IReadOnlyList<T><InlineObject>

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Inlines

Gets the list of inline elements derived from Inline, such as TextRun and LineBreak.

public List<Inline> Inlines { get; }

Property Value

System.Collections.Generic.List<T><Inline>

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

JustifiedSpaceExtension

Gets 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 float JustifiedSpaceExtension { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

JustifiedSpaceShrinking

Gets 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 float JustifiedSpaceShrinking { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

JustifiedTextExtension

Gets or sets the maximum text extension factor when text is justified.

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

public float JustifiedTextExtension { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

JustifyLastLine

Gets or sets a value indicating whether for paragraphs that have TextAlignment set to 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 EastAsianExcel or Excel.

The default is false.

public bool JustifyLastLine { get; set; }

Property Value

bool

Remarks

Setting this property to true allows implementing text alignment that is similar to "Justify distributed" mode available in East Asian versions of MS Excel.

LastLineIsEndOfParagraph

Gets or sets a value indicating whether the last line of text is the end of paragraph. The default is true.

public bool LastLineIsEndOfParagraph { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

LayoutPerformed

Gets a value indicating if PerformLayout(bool) method was executed at least once.

public bool LayoutPerformed { get; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

LineBreakingRules

Gets or sets a value specifying the line breaking algorithm.

The default is Unicode.

public LineBreakingRules LineBreakingRules { get; set; }

Property Value

LineBreakingRules

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

LineGapBeforeFirstLine

Gets or sets a value indicating whether the typographic line gap should be added before the first line of text. The default is false.

public bool LineGapBeforeFirstLine { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Lines

Gets the list of text lines after executing the PerformLayout(bool) method.

public IReadOnlyList<TextLine> Lines { get; }

Property Value

System.Collections.Generic.IReadOnlyList<T><TextLine>

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

LinesBetweenConsecutiveHyphens

Gets 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 int LinesBetweenConsecutiveHyphens { get; set; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

LineSpacingScaleFactor

Gets 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 float LineSpacingScaleFactor { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MarginAll

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

Returns null if the margins have different values.

public float? MarginAll { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MarginBottom

Gets or sets the bottom margin of the layout box, in graphic units.

public float MarginBottom { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MarginLeft

Gets or sets the left margin of the layout box, in graphic units.

public float MarginLeft { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MarginRight

Gets or sets the right margin of the layout box, in graphic units.

public float MarginRight { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MarginTop

Gets or sets the top margin of the layout box, in graphic units.

public float MarginTop { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MaxHeight

Gets or sets the height of the layout box, in graphic units.

public float? MaxHeight { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MaxLastLineOverflowFactor

Gets 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 float MaxLastLineOverflowFactor { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MaxWidth

Gets or sets the width of the layout box, in graphic units.

public float? MaxWidth { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MinimalLineSpacing

Gets or sets the explicit minimal distance between lines, in graphic units.

public float? MinimalLineSpacing { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

NoExcelAlignment

Gets 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.

[Obsolete("Use the TextExtensionStrategy property instead.")]
public bool NoExcelAlignment { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ObjectRects

Gets or sets the list of areas occupied by embedded objects.

public List<ObjectRect> ObjectRects { get; set; }

Property Value

System.Collections.Generic.List<T><ObjectRect>

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ParagraphAlignment

Gets or sets the alignment of paragraphs along the flow direction axis.

public ParagraphAlignment ParagraphAlignment { get; set; }

Property Value

ParagraphAlignment

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ParagraphSpacing

Gets or sets the additional spacing between paragraphs, in graphic units.

public float ParagraphSpacing { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Resolution

Gets or sets the resolution (graphic units per inch) used by the current text layout.

public float Resolution { get; set; }

Property Value

float

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

RestrictedFontLookup

Gets or sets a value indicating whether the fonts should be searched in the custom collection only, if any specified. The default is false.

public bool RestrictedFontLookup { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

RightToLeft

Gets or sets the base direction for horizontal and sideways text. The default is false.

public bool RightToLeft { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

RotateSidewaysCounterclockwise

Gets or sets a value indicating whether sideways text should be rotated counterclockwise. The default is false.

public bool RotateSidewaysCounterclockwise { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

RowHeight

Gets 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 float? RowHeight { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ScriptCodes

Gets the array of ScriptCode's, one for each code point.

public ScriptCode[] ScriptCodes { get; }

Property Value

ScriptCode[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ScriptTags

Gets the array of ScriptTag's, one for each code point.

public ScriptTag[] ScriptTags { get; }

Property Value

ScriptTag[]

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

SimplifiedAlignment

Gets 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.

[Obsolete("Use the TextExtensionStrategy property instead.")]
public bool SimplifiedAlignment { get; set; }

Property Value

bool

Remarks

Setting this property to true allows implementing text alignments that are similar to "Justify" and "Distributed" modes available in English version of MS Excel.

SimplifiedWordBreak

Gets 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.

[Obsolete("Use the LineBreakingRules and WordBoundaryRules properties instead.")]
public bool SimplifiedWordBreak { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

SoftHyphenReplacementCharCode

Gets 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(bool) with true as the parameter must be called for the changes to be processed correctly.
public int SoftHyphenReplacementCharCode { get; set; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

SplitCodePointIndex

Gets the first code point index of the current split rest, if this TextLayout contains the rest lines after calling the Split(TextSplitOptions, out TextLayout) or SplitAndBalance(PageSplitArea[], TextSplitOptions, out TextLayout) methods.

public int SplitCodePointIndex { get; }

Property Value

int

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

SuppressShaping

Gets or sets a value indicating if shaping and positioning of graphemes should be skipped for the sake of speed. The default is false.

public bool SuppressShaping { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

TabStops

Gets or sets the list of tab stops.

public List<TabStop> TabStops { get; set; }

Property Value

System.Collections.Generic.List<T><TabStop>

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

TextAlignment

Gets or sets the alignment of text along the reading direction axis.

public TextAlignment TextAlignment { get; set; }

Property Value

TextAlignment

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

TextExtensionStrategy

Gets or sets a value specifying the rules used for justified text extension. If LineBreakingRules is Simplified, this property also affects the rules used for line breaking.

The default is Default.

public TextExtensionStrategy TextExtensionStrategy { get; set; }

Property Value

TextExtensionStrategy

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

TrimmingGranularity

Gets or sets the text granularity used to trim text overflowing the layout box.

public TrimmingGranularity TrimmingGranularity { get; set; }

Property Value

TrimmingGranularity

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

UniformLineSpacing

Gets or sets the explicit distance between lines, in graphic units.

public float? UniformLineSpacing { get; set; }

Property Value

float?

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

UseEmbeddableFonts

Gets or sets a value indicating if the linked and fallback fonts have to be embeddable. The default is false.

public bool UseEmbeddableFonts { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

UseOldScriptTags

Gets 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 bool UseOldScriptTags { get; set; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

VerticalDirection

Gets a value indicating whether the FlowDirection was vertical when RecalculateGlyphs() was last called.

public bool VerticalDirection { get; }

Property Value

bool

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

WordBoundaryRules

Gets or sets a value specifying the word breaking algorithm.

The default is Unicode.

public WordBoundaryRules WordBoundaryRules { get; set; }

Property Value

WordBoundaryRules

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

WrapMode

Gets or sets a value specifying how text lines are broken to avoid text overflowing the layout box.

public WrapMode WrapMode { get; set; }

Property Value

WrapMode

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Methods

Append(AnchoredObject, bool)

Adds an anchored object, or a copy of it, to the end of the Inlines collection.

If adding the same anchored object multiple times, make sure to pass true as the addCopy parameter.

public AnchoredObject Append(AnchoredObject anchoredObject, bool addCopy = true)

Parameters

anchoredObject AnchoredObject

The anchored object to add or copy.

addCopy bool

If true, a copy of the anchoredObject will be created and added. Otherwise, the passed object itself will be added.

Returns

AnchoredObject

The appended anchored object.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(InlineObject, bool)

Adds an inline object, or a copy of it, to the end of the Inlines collection.

If adding the same inline object multiple times, make sure to pass true as the addCopy parameter.

public InlineObject Append(InlineObject inlineObject, bool addCopy = true)

Parameters

inlineObject InlineObject

The inline object to add or copy.

addCopy bool

If true, a copy of the inlineObject will be created and added. Otherwise, the passed object itself will be added.

Returns

InlineObject

The appended inline object.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(int[], TextFormat, IGcTag)

Adds a text run with the specified format to the end of the Inlines collection.

public TextRun Append(int[] codePoints, TextFormat format, IGcTag gcTag)

Parameters

codePoints int[]

An array of UTF-32 characters (code points).

format TextFormat

The text format to use.

gcTag IGcTag

The tag associated with the text.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(int[], TextFormat)

Adds a text run with the specified format to the end of the Inlines collection.

public TextRun Append(int[] codePoints, TextFormat format)

Parameters

codePoints int[]

An array of UTF-32 characters (code points).

format TextFormat

The text format to use.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(int[], int, int, TextFormat, IGcTag)

Adds a text run with the specified format to the end of the Inlines collection.

public TextRun Append(int[] codePoints, int startIndex, int count, TextFormat format, IGcTag gcTag)

Parameters

codePoints int[]

An array of UTF-32 characters (code points).

startIndex int

Index of the first code point in the subrange.

count int

Number of code points in the subrange.

format TextFormat

The text format to use.

gcTag IGcTag

The tag associated with the text.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(int[], int, int, TextFormat)

Adds a text run with the specified format to the end of the Inlines collection.

public TextRun Append(int[] codePoints, int startIndex, int count, TextFormat format)

Parameters

codePoints int[]

An array of UTF-32 characters (code points).

startIndex int

Index of the first code point in the subrange.

count int

Number of code points in the subrange.

format TextFormat

The text format to use.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(int[], int, int)

Adds a text run with default formatting to the end of the Inlines collection.

public TextRun Append(int[] codePoints, int startIndex, int count)

Parameters

codePoints int[]

An array of UTF-32 characters (code points).

startIndex int

Index of the first code point in the subrange.

count int

Number of code points in the subrange.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(int[])

Adds a text run with default formatting to the end of the Inlines collection.

public TextRun Append(int[] codePoints)

Parameters

codePoints int[]

An array of UTF-32 characters (code points).

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(string, TextFormat)

Adds a text run with the specified format to the end of the Inlines collection.

public TextRun Append(string text, TextFormat format)

Parameters

text string

The text to append.

format TextFormat

The text format to use.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Append(string)

Adds a text run with default formatting to the end of the Inlines collection.

public TextRun Append(string text)

Parameters

text string

The text to append.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendAnchoredObject(float, float, bool)

Adds an anchored object with specified dimensions to the end of the Inlines collection.

public AnchoredObject AppendAnchoredObject(float width, float height, bool wrapWithText)

Parameters

width float

The object's width.

height float

The object's height.

wrapWithText bool

Indicates whether to wrap the object with text.

Returns

AnchoredObject

The created AnchoredObject.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendInlineObject(object, float, float, TextFormat)

Adds an inline object with specified dimensions and formatting to the end of the Inlines collection.

public InlineObject AppendInlineObject(object obj, float width, float height, TextFormat format)

Parameters

obj object

The object to add.

width float

The object's width.

height float

The object's height.

format TextFormat

Formatting associated with the object.

Returns

InlineObject

The created InlineObject.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendInlineObject(object, float, float)

Adds an inline object with specified dimensions to the end of the Inlines collection.

public InlineObject AppendInlineObject(object obj, float width, float height)

Parameters

obj object

The object to add.

width float

The object's width.

height float

The object's height.

Returns

InlineObject

The created InlineObject.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendLine()

Adds a line break element to the end of the Inlines collection.

public LineBreak AppendLine()

Returns

LineBreak

The appended LineBreak.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendLine(TextFormat)

Adds a line break element to the end of the Inlines collection.

public LineBreak AppendLine(TextFormat format)

Parameters

format TextFormat

The text format.

Returns

LineBreak

The appended LineBreak.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendLine(string, TextFormat)

Adds a text run with the specified format, followed by a line break, to the end of the Inlines collection.

public LineBreak AppendLine(string text, TextFormat format)

Parameters

text string

The text to append.

format TextFormat

The text format.

Returns

LineBreak

The appended LineBreak.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendLine(string)

Adds a text run with default formatting, followed by a line break, to the end of the Inlines collection.

public LineBreak AppendLine(string text)

Parameters

text string

The text to append.

Returns

LineBreak

The appended LineBreak.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendParagraphBreak()

Adds a special character (0x2029) that causes a paragraph break but prevents a page break between paragraphs (GrapeCity specifics).

public TextRun AppendParagraphBreak()

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendParagraphBreak(TextFormat)

Adds a special character (0x2029) that causes a paragraph break but prevents a page break between paragraphs (GrapeCity specifics).

public TextRun AppendParagraphBreak(TextFormat format)

Parameters

format TextFormat

The text format.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendSectionBreak()

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 TextRun AppendSectionBreak()

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendSectionBreak(TextFormat)

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 TextRun AppendSectionBreak(TextFormat format)

Parameters

format TextFormat

The text format.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendSoftBreak()

Adds a line separator character (0x2028) that causes a line break without ending the paragraph.

public TextRun AppendSoftBreak()

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

AppendSoftBreak(TextFormat)

Adds a line separator character (0x2028) that causes a line break without ending the paragraph.

public TextRun AppendSoftBreak(TextFormat format)

Parameters

format TextFormat

The text format.

Returns

TextRun

The created text run.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ApplyOffset(float, float)

Adjusts the positions of content rectangle, inline and anchored objects by a specified amount.

public void ApplyOffset(float dx, float dy)

Parameters

dx float

The offset along the horizontal direction.

dy float

The offset along the vertical direction.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Clear()

Clears the current text layout, removing all text and formatting associated with individual text runs.

public void Clear()

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Clone(bool, bool)

Creates a copy of the current TextLayout instance.

public TextLayout Clone(bool copyInlines = false, bool copyObjectRects = false)

Parameters

copyInlines bool

Indicates whether to copy Inline objects with text data to the new instance of TextLayout.

copyObjectRects bool

Indicates whether to copy ObjectRect embedded objects to the new instance of TextLayout.

Returns

TextLayout

The newly created instance of TextLayout.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

GetInlineObjectAt(int)

Gets the InlineObject at the specified code point index.

public InlineObject GetInlineObjectAt(int codePointIndex)

Parameters

codePointIndex int

Returns

InlineObject

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

GetTextRects(int, int, bool, bool)

Returns the list of TextRect objects for the specified range of code points.

public IReadOnlyList<TextRect> GetTextRects(int codePointIndex, int codePointCount, bool withLineGap = false, bool withLineSpacing = false)

Parameters

codePointIndex int

The code point index of the range start.

codePointCount int

The number of code points in the range.

withLineGap bool

Indicates if the additional spacing before text lines should be included.

withLineSpacing bool

Indicates if the additional spacing after text lines should be included.

Returns

System.Collections.Generic.IReadOnlyList<T><TextRect>

A read-only list of text rectangles.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MapCharRangeToCodePoints(ref int, ref int)

Maps a character range to the corresponding code point range.

public bool MapCharRangeToCodePoints(ref int index, ref int count)

Parameters

index int

Inputs the character index of the range start, outputs the code point index of the range start.

count int

Inputs the number of characters in the range, outputs the number of code points in the range.

Returns

bool

True if the resulting range contains at least one code point, false otherwise.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

MapCodePointsToCharRange(ref int, ref int)

Maps a code point range to the corresponding character range.

public bool MapCodePointsToCharRange(ref int index, ref int count)

Parameters

index int

Inputs the code point index of the range start, outputs the character index of the range start.

count int

Inputs the number of code points in the range, outputs the number of characters in the range.

Returns

bool

True if the resulting range contains at least one character, false otherwise.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

PerformLayout(bool)

Determines the coordinates for all lines and glyph runs. Optionally calls RecalculateGlyphs() prior to performing the layout.

public bool PerformLayout(bool recalculateGlyphsBeforeLayout = false)

Parameters

recalculateGlyphsBeforeLayout bool

If true, RecalculateGlyphs() will be called before performing the layout.

Returns

bool

true if the whole text fits in the bounds of TextLayout, false if some text doesn't fit in bounds and one of the Split* methods must be executed to move the rest of the text into another TextLayout instance.

Remarks

When all text and formatting have been specified on an instance of TextLayout, RecalculateGlyphs() must be called on it to convert characters to glyphs. After that, PerformLayout(false) can be called multiple times for different layout parameters (such as MaxWidth and MaxHeight to create different layouts of the same text.When only a single layout for each text is needed, the two calls can be shortened to just one PerformLayout(true) call for convenience.

See Also

RecalculateGlyphs()

Converts 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(bool), or alternatively the PerformLayout method should be called with true as the parameter.

public void RecalculateGlyphs()

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.
See Also

ResolveAmbiguousEastAsianWidths(CodePointFlags[], int)

Resolves characters with ambiguous East Asian width to either narrow or wide.

protected virtual void ResolveAmbiguousEastAsianWidths(CodePointFlags[] cpFlags, int length)

Parameters

cpFlags CodePointFlags[]

The source and destination array of CodePointFlags elements.

length int

Number of code points.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ResolveAmbiguousLineBreakingClasses(LineBreakingClass[], int)

Resolves the ambiguous AI, CJ, SA, SG, XX line-breaking classes.

protected virtual void ResolveAmbiguousLineBreakingClasses(LineBreakingClass[] lbClasses, int length)

Parameters

lbClasses LineBreakingClass[]

The source and destination array of LineBreakingClass elements.

length int

Number of code points.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

ResolveAmbiguousScriptCodes(ScriptCode[], int)

Resolves the Inherited, Common, and Unknown script codes, if possible.

protected virtual void ResolveAmbiguousScriptCodes(ScriptCode[] scCodes, int length)

Parameters

scCodes ScriptCode[]

The source and destination array of ScriptCode elements.

length int

Number of UTF-32 code points in the analyzed range.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.

Split(TextSplitOptions, out TextLayout)

Fits 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 SplitResult Split(TextSplitOptions splitOptions, out TextLayout rest)

Parameters

splitOptions TextSplitOptions

Options controlling how text is split.

rest TextLayout

Output: a new TextLayout instance containing the text that did not fit into the bounds specified by the current TextLayout.

Returns

SplitResult

A value indicating the result of splitting the current text layout.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.
See Also

SplitAndBalance(PageSplitArea[], TextSplitOptions, out TextLayout)

Fits 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 SplitResult SplitAndBalance(PageSplitArea[] pageAreas, TextSplitOptions splitOptions, out TextLayout rest)

Parameters

pageAreas PageSplitArea[]

The array of additional page areas that can be used to layout the text.

splitOptions TextSplitOptions

Options controlling how text is split.

rest TextLayout

Output: a new TextLayout instance containing the text that did not fit into the bounds specified by the current TextLayout.

Returns

SplitResult

A value indicating the result of splitting the current text layout.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.
See Also

SplitAndBalanceRef(PageSplitArea[], TextSplitOptions, ref TextLayout)

Fits 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(TextSplitOptions, ref TextLayout) method.
public SplitResult SplitAndBalanceRef(PageSplitArea[] pageAreas, TextSplitOptions splitOptions, ref TextLayout rest)

Parameters

pageAreas PageSplitArea[]

The array of additional page areas that can be used to layout the text.

splitOptions TextSplitOptions

Options controlling how text is split.

rest TextLayout

Recipient for the text that did not fit in the current bounds and additional areas. If null, a new instance will be created and assigned to this parameter. If non-null, that TextLayout instance will be filled with the text that did not fit. When rendering large blocks of text, this improves performance by avoiding the need to initialize a new instance of a TextLayout for each split.

Returns

SplitResult

A value indicating the result of splitting the current text layout.

Remarks

In the simplest scenario, these steps can be followed to render a text on a graphics object using TextLayout:

  1. Get a TextLayout objectCreate a new instance of the TextLayout class, or call Clear() on an existing instance to clear its content.
  2. Define the desired layoutSet the layout properties (such as MaxWidth, MaxHeight, MarginLeft etc.) to the desired values.
  3. Add content (text and formatting)Use Append(string) and its overloads to add text and formatting to the TextLayout instance. Use DefaultFormat to specify the default formatting for text fragments that are added without an explicitly associated format.
  4. Calculate and shape glyphsCall RecalculateGlyphs() to calculate the glyphs needed to render the text. This also performs the required shaping. (If the content is modified (e.g. new text added) after this step, it can/should be repeated to recalculate the glyphs.)
  5. Layout the textCall PerformLayout(bool) to layout the formatted paragraphs within the specified bounds. This step can be done multiple times to layout the text within different bounds.
See Also

SplitRef(TextSplitOptions, ref TextLayout)

Fits 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 SplitResult SplitRef(TextSplitOptions splitOptions, ref TextLayout rest)

Parameters

splitOptions TextSplitOptions

Options controlling how text is split.

rest TextLayout

Recipient for the text that did not fit in the current bounds. If null, a new instance will be created and assigned to this parameter. If non-null, that TextLayout instance will be filled with the text that did not fit. When rendering large blocks of text, this improves performance by avoiding the need to initialize a new instance of a TextLayout for each split.

Returns

SplitResult

A value indicating the result of splitting the current text layout.

Remarks

Because initializing a new instance of the TextLayout class takes a relatively long time, reusing an existing instance can improve performance when rendering large amounts of text. This is why this method exists, and may be preferred over the Split(TextSplitOptions, out TextLayout) method. The typical use of this method would be:

GcPdfDocument doc = new GcPdfDocument();
// ...
TextLayout tl = new TextLayout();
// set up the text layout, add text to it...
TextSplitOptions to = new TextSplitOptions();
// set up text split options...
TextLayout rest = null;
// a loop rendering a long text layout: 
while (true)
{
  var splitResult = tl.SplitRef(to, ref rest);
  doc.Pages.Add().Graphics.DrawTextLayout(tl, PointF.Empty);
  if (splitResult != SplitResult.Split)
    break;
  var temp = tl;
  tl = rest; // move on to the next portion of the text
  rest = temp; // avoid re-initializing a new text layout, by re-using the old one
}

Note that in this code, the ONLY point of swapping 'rest' and 'tl' is to provide an existing instance of a TextLayout class to the next SplitRef call so that a new instance does not need to be initialized. No actual data from the old text layout is (re)used, so functionally the last three lines can be replaced with 'tl = rest; rest = null;' assignments.

See Also

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.

public bool Truncate(TrimmingGranularity lastLineTrimming = TrimmingGranularity.None)

Parameters

lastLineTrimming TrimmingGranularity

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

Returns

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.