[]
IDWriteTextAnalysisSource
[Guid("688e1a58-5094-47c8-adc8-fbcea60ae92b")]
[Shadow(typeof(TextAnalysisSourceShadow))]
public interface ITextAnalysisSource : ICallbackable, IDisposable
Gets the paragraph reading direction.
ReadingDirection ReadingDirection { get; }
The reading direction of the current paragraph.
Gets the locale name on the range affected by the text analysis.
string GetLocaleName(int textPosition, out int textLength)
textPosition
intThe text position to examine.
textLength
intContains the length of the text being affected by the text analysis up to the next differing locale.
the locale name on the range affected by the text analysis
The localeName reference must remain valid until the next call or until the analysis returns.
Gets the number substitution from the text range affected by the text analysis.
NumberSubstitution GetNumberSubstitution(int textPosition, out int textLength)
textPosition
intThe starting position from which to report.
textLength
intContains the length of the text, in characters, remaining in the text range up to the next differing number substitution.
the number substitution from the text range affected by the text analysis.
Any implementation should return the number substitution with an incremented reference count, and the analysis will release when finished with it (either before the next call or before it returns). However, the sink callback may hold onto it after that.
Gets a block of text starting at the specified text position.
string GetTextAtPosition(int textPosition)
textPosition
intThe first position of the piece to obtain. All positions are in UTF16 code units, not whole characters, which matters when supplementary characters are used.
a block of text
Returning NULL indicates the end of text, which is the position after the last character. This function is called iteratively for each consecutive block, tying together several fragmented blocks in the backing store into a virtual contiguous string. Although applications can implement sparse textual content that maps only part of the backing store, the application must map any text that is in the range passed to any analysis functions.
Gets a block of text immediately preceding the specified position.
string GetTextBeforePosition(int textPosition)
textPosition
intThe position immediately after the last position of the block of text to obtain.
text immediately preceding the specified position
NULL indicates no chunk available at the specified position, either because textPosition equals 0, textPosition is greater than the entire text content length, or the queried position is not mapped into the application's backing store. Although applications can implement sparse textual content that maps only part of the backing store, the application must map any text that is in the range passed to any analysis functions.