New to Telerik UI for WinForms? Start a free 30-day trial

IRadTextBlock

Interface

Provides a platform-neutral text block for positioning text and formatted inline runs in document UI layers.

Definition

Namespace:Telerik.WinForms.Documents.UI.TextBlocks

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public interface IRadTextBlock

Properties

Gets or sets the directional context used to lay out the block's text.

C#
FlowDirection FlowDirection { get; set; }

Gets or sets the base font family used for block text and inline runs without their own family.

C#
FontFamily FontFamily { get; set; }

Gets or sets the base font size. The Spreadsheet adapter assigns this size to inline runs during measurement.

C#
double FontSize { get; set; }

Gets or sets the font style applied to inline runs during Spreadsheet text-block measurement.

C#
FontStyle FontStyle { get; set; }

Gets or sets the base font weight used for block text.

C#
FontWeight FontWeight { get; set; }

Gets or sets the foreground color used for block text.

C#
Color ForegroundColor { get; set; }

Gets or sets the height allocated to this block by line layout.

C#
double Height { get; set; }

Gets or sets the block's horizontal position on its canvas.

C#
double Left { get; set; }

Gets or sets the baseline offset supplied by line layout; the Spreadsheet text-block renderer uses it to shift the text vertically when painting.

C#
double LineBaselineOffset { get; set; }

Gets or sets the paragraph line height supplied by line layout. The Spreadsheet text-block implementation stores this value but does not use it to calculate measured height.

C#
double LineHeight { get; set; }

Gets or sets unformatted block text. Use SetInlines(IEnumerable<IRadRun>) to supply separately formatted runs.

C#
string Text { get; set; }

Gets or sets whether text is wrapped within the block's assigned bounds. The Spreadsheet adapter does not account for wrapping when measuring the text block.

C#
TextWrapping TextWrapping { get; set; }

Gets or sets the block's vertical position on its canvas.

C#
double Top { get; set; }

Gets or sets the width allocated to this block by line layout.

C#
double Width { get; set; }

Methods

Removes all inline runs without returning their adapters to an object pool.

C#
void ClearInlines()

Returns the rendered text baseline's offset from the top of the block.

C#
double GetBaselineOffset()
Returns:

double

Calculates the vertical correction between the line-layout baseline and the rendered text baseline. The Spreadsheet implementation returns zero because it does not calculate an additional correction.

C#
double GetBaselineRenderingDifference(double lineBaselineOffset)
Parameters:lineBaselineOffsetdouble

The baseline offset calculated for the document line.

Returns:

double

The adjustment used to align the rendered block with the document line.

Gets the framework element that a UI layer should arrange and render for this block.

C#
FrameworkElement GetUIElement()
Returns:

FrameworkElement

Determines whether the block currently contains inline runs.

C#
bool HasInlines()
Returns:

bool

Removes inline runs, returns their adapters to the supplied pool, and resets the block's font defaults for reuse.

C#
void ReleaseAndClearInlines(ObjectPool pool)
Parameters:poolObjectPool

The pool that receives the released run adapters.

Applies rectangular clipping to the rendered text, or clears clipping when rect is null.

C#
void SetClip(Rect? rect)
Parameters:rectRect?

The clipping rectangle, or null to remove clipping.

Appends runs in enumeration order; existing inline runs are not removed.

C#
void SetInlines(IEnumerable<IRadRun> runs)
Parameters:runsIEnumerable<IRadRun>

The formatted runs to append to the block.

The Spreadsheet implementation currently accepts only the library's internal run adapters, despite the IRadRun parameter type.