TextPrimitiveImpl
Renders and measures plain text using the WinForms text renderer or compatible GDI+ rendering.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
public class TextPrimitiveImpl : ITextPrimitive
Inheritance: objectTextPrimitiveImpl
Implements:
Constructors
public TextPrimitiveImpl()
Methods
Builds WinForms text-format flags from alignment, direction, mnemonic, keyboard-cue, ellipsis, and wrapping settings.
public TextFormatFlags CreateTextFormatFlags(TextParams textParams)
The text settings used to construct the flags.
Returns:The flags passed to WinForms text measurement and drawing.
Measures text with the legacy layout sizing option.
public SizeF GetTextSize(SizeF proposedSize, bool autoFitInProposedSize, TextParams textParams)
The proposed size used when autoFitInProposedSize is true.
true to measure within the proposed size; otherwise, measure without its width constraint.
textParamsTextParamsThe text content and formatting settings.
Returns:The measured size.
Measures text using the supplied proposed size as a constraint.
public SizeF GetTextSize(SizeF proposedSize, TextParams textParams)
The size available for measuring the text.
textParamsTextParamsThe text content and settings that affect measurement.
Returns:The measured size of the text.
Implements:
Retrieves the text size.
public SizeF GetTextSize(TextParams textParams)
Implements:
Measures element text through the Direct2D graphics service when available; otherwise uses this renderer's normal measurement path.
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams, ITextElement element)
The size available to the text.
textParamsTextParamsThe text settings used by the normal measurement path.
elementITextElementThe text element passed to the Direct2D measurement service.
Returns:The desired size of the text, adjusted for vertical orientation.
Measures the desired text size within the available layout size.
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams)
The maximum size available to the text.
textParamsTextParamsThe text content and settings that affect measurement.
Returns:The desired size of the rendered text.
Implements:
Ignores pointer movement because the plain-text renderer has no interactive text content.
public void OnMouseMove(object sender, MouseEventArgs e)
The object associated with the pointer event.
eMouseEventArgsThe mouse-event data.
Implements:
Paints text using the supplied graphics context and parameters. The built-in backends do not apply the supplied angle and scale.
public void PaintPrimitive(IGraphics graphics, float angle, SizeF scale, TextParams textParams)
The graphics context used to draw the text.
anglefloatThe rotation angle supplied for the paint operation.
scaleSizeFThe scale supplied for the paint operation.
textParamsTextParamsThe text content, layout, and rendering settings.
Implements:
Paints text using the supplied text parameters without an explicit transform.
public void PaintPrimitive(IGraphics graphics, TextParams textParams)
The graphics context used to draw the text.
textParamsTextParamsThe text content, layout, and rendering settings.
Implements:
Mirrors the horizontal component of a text alignment when right-to-left layout is enabled.
public ContentAlignment RtlContentAlignment(TextParams textParams)
The text settings containing alignment and direction.
Returns:The alignment to use for the current text direction.