This documentation is archived and is not being maintained.

TextLine Class

Provides an abstract class for supporting formatting services to a line of text.


Namespace:  System.Windows.Media.TextFormatting
Assembly:  PresentationCore (in PresentationCore.dll)

public abstract class TextLine : IDisposable

The TextLine type exposes the following members.

Protected methodTextLineInitializes a new instance of the TextLine class.

Public propertyBaselineGets the distance from the top to the baseline of the current TextLine object.
Public propertyDependentLengthGets the number of characters following the last character of the line that may trigger reformatting of the current line.
Public propertyExtentGets the distance from the top-most to bottom-most black pixel in a line.
Public propertyHasCollapsedGets a value that indicates whether the line is collapsed.
Public propertyHasOverflowedGets a value that indicates whether content of the line overflows the specified paragraph width.
Public propertyHeightGets the height of a line of text.
Public propertyIsTruncatedDetermines whether the text line is truncated in the middle of a word.
Public propertyLengthGets the total number of TextSource positions of the current line.
Public propertyMarkerBaselineGets the distance from the edge of the line's highest point to the baseline marker of the line.
Public propertyMarkerHeightGets the height of a marker for a list item.
Public propertyNewlineLengthGets the number of newline characters at the end of a line.
Public propertyOverhangAfterGets the distance that black pixels extend beyond the bottom alignment edge of a line.
Public propertyOverhangLeadingGets the distance that black pixels extend prior to the left leading alignment edge of the line.
Public propertyOverhangTrailingGets the distance that black pixels extend following the right trailing alignment edge of the line.
Public propertyStartGets the distance from the start of a paragraph to the starting point of a line.
Public propertyTextBaselineGets the distance from the top to the baseline of the line of text.
Public propertyTextHeightGets the height of the text and any other content in the line.
Public propertyTrailingWhitespaceLengthGets the number of whitespace code points beyond the last non-blank character in a line.
Public propertyWidthGets the width of a line of text, excluding trailing whitespace characters.
Public propertyWidthIncludingTrailingWhitespaceGets the width of a line of text, including trailing whitespace characters.

Public methodCollapseCreate a collapsed line based on collapsed text properties.
Public methodDisposeReleases all managed and unmanaged resources used by the TextFormatter object.
Public methodDrawRenders the TextLine object based upon the specified DrawingContext.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBackspaceCaretCharacterHitGets the previous character hit after backspacing.
Public methodGetCharacterHitFromDistanceGets the character hit corresponding to the specified distance from the beginning of the line.
Public methodGetDistanceFromCharacterHitGets the distance from the beginning of the line to the specified character hit.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetIndexedGlyphRunsGets an enumerator for enumerating IndexedGlyphRun objects in the TextLine.
Public methodGetNextCaretCharacterHitGets the next character hit for caret navigation.
Public methodGetPreviousCaretCharacterHitGets the previous character hit for caret navigation.
Public methodGetTextBoundsGets an array of bounding rectangles that represent the range of characters within a text line.
Public methodGetTextCollapsedRangesGets a collection of collapsed text ranges after a line has been collapsed.
Public methodGetTextLineBreakGets the state of the line when broken by line breaking process.
Public methodGetTextRunSpansGets a collection of TextRun objects in a text span that are contained within a line.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.