Class
TextFragment

Text run containing characters that share uniform font, color, spacing, and positioning; use to apply precise typographic styling within fixed content.

Definition

Namespace:Telerik.Windows.Documents.Fixed.Model.Text

Assembly:Telerik.Windows.Documents.Fixed.dll

Syntax:

cs-api-definition
public class TextFragment : PositionContentElement, IFixedDocumentElement

Inheritance: objectFixedDocumentElementBaseContentElementBasePositionContentElementTextFragment

Implements: IFixedDocumentElement

Inherited Members PositionContentElement.PositionContentElementBase.ClippingFixedDocumentElementBase.Parent

Constructors

TextFragment()

Initializes a new instance of the TextFragment class.

Declaration

cs-api-definition
public TextFragment()

TextFragment(string)

Initializes a new instance of the TextFragment class with the specified text content.

Declaration

cs-api-definition
public TextFragment(string text)

Parameters

text

string

The string content to be displayed in this text fragment.

Properties

AlphaConstant

Constant opacity applied to fill operations (non-stroking) when compositing.

Declaration

cs-api-definition
public double? AlphaConstant { get; set; }

Property Value

double?

The alpha constant value between 0.0 (fully transparent) and 1.0 (fully opaque) for fill operations.

CharacterSpacing

Uniform adjustment applied between consecutive characters to tighten or expand overall tracking.

Declaration

cs-api-definition
public double? CharacterSpacing { get; set; }

Property Value

double?

The character spacing. A positive value increases spacing, negative decreases it.

Fill

Non-stroking color applied to glyph interiors when fill is enabled.

Declaration

cs-api-definition
public ColorBase Fill { get; set; }

Property Value

ColorBase

The color used to fill the text characters.

Font

Font resource used to shape and render the fragment’s glyphs.

Declaration

cs-api-definition
public FontBase Font { get; set; }

Property Value

FontBase

The font instance that defines the typeface, style, and other font characteristics.

FontSize

Em size (in PDF text space units) used when positioning and scaling glyph outlines.

Declaration

cs-api-definition
public double FontSize { get; set; }

Property Value

double

The size of the font.

HorizontalScaling

Horizontal scale factor applied to glyph widths (1.0 = normal, less than 1 compresses, greater than 1 expands).

Declaration

cs-api-definition
public double? HorizontalScaling { get; set; }

Property Value

double?

The horizontal scaling factor as a percentage (e.g., 1.0 = 100%, 0.5 = 50%, 2.0 = 200%). Default is 1.0 (100%).

MiterLimit

Maximum miter length ratio before joints are beveled when using miter joins.

Declaration

cs-api-definition
public double? MiterLimit { get; set; }

Property Value

double?

The miter limit ratio. When the miter length exceeds this limit, the corner is beveled instead of mitered.

RenderingMode

Rendering style determining fill, stroke, both, clipping, or invisibility for the glyphs.

Declaration

cs-api-definition
public RenderingMode RenderingMode { get; set; }

Property Value

RenderingMode

The rendering mode that specifies the appearance style of the text.

Stroke

Stroking color used for glyph outlines when stroke rendering is active.

Declaration

cs-api-definition
public ColorBase Stroke { get; set; }

Property Value

ColorBase

The color used to stroke the text character outlines.

StrokeAlphaConstant

Constant opacity applied to stroke (outline) painting operations.

Declaration

cs-api-definition
public double? StrokeAlphaConstant { get; set; }

Property Value

double?

The stroke alpha constant value between 0.0 (fully transparent) and 1.0 (fully opaque) for stroke operations.

StrokeDashArray

Dash pattern sequence applied when stroking glyph outlines.

Declaration

cs-api-definition
public IEnumerable<double> StrokeDashArray { get; set; }

Property Value

IEnumerable<double>

A collection of values that specify the lengths of alternating dashes and gaps in the stroke pattern.

StrokeDashOffset

Offset into the dash pattern at which glyph outline stroking begins.

Declaration

cs-api-definition
public double StrokeDashOffset { get; set; }

Property Value

double

The dash offset value in user space units that shifts the starting point of the dash pattern.

StrokeLineCap

Style applied to the ends of stroked glyph segments (caps).

Declaration

cs-api-definition
public LineCap StrokeLineCap { get; set; }

Property Value

LineCap

The line cap style that determines how line ends are rendered.

StrokeLineJoin

Strategy for rendering corners where stroked glyph outline segments meet (joins).

Declaration

cs-api-definition
public LineJoin StrokeLineJoin { get; set; }

Property Value

LineJoin

The line join style that determines how line corners are rendered.

StrokeThickness

Line width in user units for glyph outline stroking.

Declaration

cs-api-definition
public double StrokeThickness { get; set; }

Property Value

double

The stroke line thickness.

Text

Unicode string rendered using the fragment’s current text properties.

Declaration

cs-api-definition
public string Text { get; set; }

Property Value

string

The string content that will be rendered with the formatting properties of this text fragment.

TextRise

Baseline shift offset applied to raise (positive) or lower (negative) glyphs relative to the current line.

Declaration

cs-api-definition
public double? TextRise { get; set; }

Property Value

double?

The text rise offset. Positive values raise the text, negative values lower it.

WordSpacing

Additional spacing applied to space characters, influencing distance between words.

Declaration

cs-api-definition
public double? WordSpacing { get; set; }

Property Value

double?

The word spacing. A positive value increases spacing between words, negative decreases it.

Methods

Clone()

Creates a deep copy of this text fragment, including all its formatting properties and text content.

Declaration

cs-api-definition
public TextFragment Clone()

Returns

TextFragment

A new TextFragment instance that is an exact copy of this fragment.

CreateClonedInstance<T>()

Creates the cloned instance.

Declaration

cs-api-definition
protected override T CreateClonedInstance<T>() where T : PositionContentElement

Returns

T

The cloned instance.

Overrides PositionContentElement.CreateClonedInstance<T>()

ToString()

Returns a string representation of this text fragment.

Declaration

cs-api-definition
public override string ToString()

Returns

string

The text content of this fragment.

Overrides object.ToString()