Class TextFragment
Represents a text fragment that contains a string of characters with consistent formatting properties such as font, color, and positioning.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Fixed.Model.Text
Assembly: Telerik.Windows.Documents.Fixed.dll
Syntax
public class TextFragment : PositionContentElement, IFixedDocumentElement, IAlphaConstantProvider, IStrokeAlphaConstantProvider
  Constructors
TextFragment()
TextFragment(String)
Initializes a new instance of the TextFragment class with the specified text content.
Declaration
public TextFragment(string text)
  Parameters
| 
        System.String
        text
         The string content to be displayed in this text fragment.  | 
    
Properties
AlphaConstant
Gets or sets the alpha constant that specifies the constant shape or opacity value for non-stroking operations (fill operations).
Declaration
public double? AlphaConstant { get; set; }
  Property Value
| 
        System.Nullable<System.Double>
         The alpha constant value between 0.0 (fully transparent) and 1.0 (fully opaque) for fill operations.  | 
    
CharacterSpacing
Gets or sets the character spacing, which adjusts the spacing between all characters uniformly.
Declaration
public double? CharacterSpacing { get; set; }
  Property Value
| 
        System.Nullable<System.Double>
         The character spacing. A positive value increases spacing, negative decreases it.  | 
    
Fill
Gets or sets the fill color used for painting the interior of text characters.
Declaration
public ColorBase Fill { get; set; }
  Property Value
| 
        ColorBase
         The color used to fill the text characters.  | 
    
Font
Gets or sets the font used for displaying the text in this fragment.
Declaration
public FontBase Font { get; set; }
  Property Value
| 
        FontBase
         The font instance that defines the typeface, style, and other font characteristics.  | 
    
FontSize
Gets or sets the font size used for displaying the text.
Declaration
public double FontSize { get; set; }
  Property Value
| 
        System.Double
         The size of the font.  | 
    
HorizontalScaling
Gets or sets the horizontal scaling factor applied to the text, which stretches or compresses characters horizontally.
Declaration
public double? HorizontalScaling { get; set; }
  Property Value
| 
        System.Nullable<System.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
Gets or sets the miter limit, which controls the maximum length of sharp corners when stroke line join is set to miter.
Declaration
public double? MiterLimit { get; set; }
  Property Value
| 
        System.Nullable<System.Double>
         The miter limit ratio. When the miter length exceeds this limit, the corner is beveled instead of mitered.  | 
    
RenderingMode
Gets or sets the text rendering mode, which determines how the text is displayed (filled, stroked, or both).
Declaration
public RenderingMode RenderingMode { get; set; }
  Property Value
| 
        RenderingMode
         The rendering mode that specifies the appearance style of the text.  | 
    
Stroke
Gets or sets the stroke color used for drawing the outline of text characters.
Declaration
public ColorBase Stroke { get; set; }
  Property Value
| 
        ColorBase
         The color used to stroke the text character outlines.  | 
    
StrokeAlphaConstant
Gets or sets the stroke alpha constant that specifies the constant shape or opacity value for stroking operations (outline operations).
Declaration
public double? StrokeAlphaConstant { get; set; }
  Property Value
| 
        System.Nullable<System.Double>
         The stroke alpha constant value between 0.0 (fully transparent) and 1.0 (fully opaque) for stroke operations.  | 
    
StrokeDashArray
Gets or sets the dash pattern used for creating dashed strokes on text character outlines.
Declaration
public IEnumerable<double> StrokeDashArray { get; set; }
  Property Value
| 
        System.Collections.Generic.IEnumerable<System.Double>
         A collection of values that specify the lengths of alternating dashes and gaps in the stroke pattern.  | 
    
StrokeDashOffset
Gets or sets the distance offset where the dash pattern begins in the stroke outline.
Declaration
public double StrokeDashOffset { get; set; }
  Property Value
| 
        System.Double
         The dash offset value in user space units that shifts the starting point of the dash pattern.  | 
    
StrokeLineCap
Gets or sets the line cap style used at the ends of stroked text character outlines.
Declaration
public LineCap StrokeLineCap { get; set; }
  Property Value
| 
        LineCap
         The line cap style that determines how line ends are rendered.  | 
    
StrokeLineJoin
Gets or sets the line join style used at the corners where stroked text character outline segments meet.
Declaration
public LineJoin StrokeLineJoin { get; set; }
  Property Value
| 
        LineJoin
         The line join style that determines how line corners are rendered.  | 
    
StrokeThickness
Gets or sets the thickness of the stroke line used for outlining text characters.
Declaration
public double StrokeThickness { get; set; }
  Property Value
| 
        System.Double
         The stroke line thickness.  | 
    
Text
Gets or sets the text content displayed in this fragment.
Declaration
public string Text { get; set; }
  Property Value
| 
        System.String
         The string content that will be rendered with the formatting properties of this text fragment.  | 
    
TextRise
Gets or sets the text rise, which moves the text baseline up or down relative to its normal position.
Declaration
public double? TextRise { get; set; }
  Property Value
| 
        System.Nullable<System.Double>
         The text rise offset. Positive values raise the text, negative values lower it.  | 
    
WordSpacing
Gets or sets the word spacing, which adjusts the spacing between words by modifying the width of space characters.
Declaration
public double? WordSpacing { get; set; }
  Property Value
| 
        System.Nullable<System.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
public TextFragment Clone()
  Returns
| 
        TextFragment
         A new TextFragment instance that is an exact copy of this fragment.  | 
    
CreateClonedInstance<T>()
Creates the cloned instance.
Declaration
protected override T CreateClonedInstance<T>()
    where T : PositionContentElement
  Returns
| 
        T
         The cloned instance.  | 
    
Type Parameters
| 
        T
         
  | 
    
Overrides
ToString()
Returns a string representation of this text fragment.
Declaration
public override string ToString()
  Returns
| 
        System.String
         The text content of this fragment.  |