Table of Contents

Class TextAnalyzer

Namespace
SharpDX.DirectWrite
Assembly
SharpDX.Direct2D1.dll
[Guid("b7e6163e-7f46-43b4-84b3-e4e6249c365d")]
public class TextAnalyzer : ComObject
Inheritance
TextAnalyzer
Derived

Constructors

TextAnalyzer(Factory)

Returns an interface for performing text analysis.

public TextAnalyzer(Factory factory)

Parameters

factory Factory

A reference to a DirectWrite factory Factory

TextAnalyzer(nint)

public TextAnalyzer(nint nativePtr)

Parameters

nativePtr nint

Methods

AnalyzeBidi(TextAnalysisSource, int, int, TextAnalysisSink)

Analyzes a text range for script directionality, reading attributes from the source and reporting levels to the sink callback SetBidiLevel.

public void AnalyzeBidi(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)

Parameters

analysisSource TextAnalysisSource

No documentation.

textPosition int

No documentation.

textLength int

No documentation.

analysisSink TextAnalysisSink

No documentation.

Remarks

While the function can handle multiple paragraphs, the text range should not arbitrarily split the middle of paragraphs. Otherwise, the returned levels may be wrong, because the Bidi algorithm is meant to apply to the paragraph as a whole.

AnalyzeLineBreakpoints(TextAnalysisSource, int, int, TextAnalysisSink)

Analyzes a text range for potential breakpoint opportunities, reading attributes from the source and reporting breakpoint opportunities to the sink callback SetLineBreakpoints.

public void AnalyzeLineBreakpoints(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)

Parameters

analysisSource TextAnalysisSource

No documentation.

textPosition int

No documentation.

textLength int

No documentation.

analysisSink TextAnalysisSink

No documentation.

Remarks

Although the function can handle multiple paragraphs, the text range should not arbitrarily split the middle of paragraphs, unless the specified text span is considered a whole unit. Otherwise, the returned properties for the first and last characters will inappropriately allow breaks.

AnalyzeNumberSubstitution(TextAnalysisSource, int, int, TextAnalysisSink)

Analyzes a text range for spans where number substitution is applicable, reading attributes from the source and reporting substitutable ranges to the sink callback SetNumberSubstitution.

public void AnalyzeNumberSubstitution(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)

Parameters

analysisSource TextAnalysisSource

No documentation.

textPosition int

No documentation.

textLength int

No documentation.

analysisSink TextAnalysisSink

No documentation.

Remarks

Although the function can handle multiple ranges of differing number substitutions, the text ranges should not arbitrarily split the middle of numbers. Otherwise, it will treat the numbers separately and will not translate any intervening punctuation.

AnalyzeScript(TextAnalysisSource, int, int, TextAnalysisSink)

Analyzes a text range for script boundaries, reading text attributes from the source and reporting the Unicode script ID to the sink callback SetScript.

public void AnalyzeScript(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)

Parameters

analysisSource TextAnalysisSource

No documentation.

textPosition int

No documentation.

textLength int

No documentation.

analysisSink TextAnalysisSink

No documentation.

GetGdiCompatibleGlyphPlacements(string, short[], ShapingTextProperties[], int, short[], ShapingGlyphProperties[], int, FontFace, float, float, RawMatrix3x2?, bool, bool, bool, ScriptAnalysis, string, FontFeature[][], int[], float[], GlyphOffset[])

Gets the GDI compatible glyph placements.

public void GetGdiCompatibleGlyphPlacements(string textString, short[] clusterMap, ShapingTextProperties[] textProps, int textLength, short[] glyphIndices, ShapingGlyphProperties[] glyphProps, int glyphCount, FontFace fontFace, float fontEmSize, float pixelsPerDip, RawMatrix3x2? transform, bool useGdiNatural, bool isSideways, bool isRightToLeft, ScriptAnalysis scriptAnalysis, string localeName, FontFeature[][] features, int[] featureRangeLengths, float[] glyphAdvances, GlyphOffset[] glyphOffsets)

Parameters

textString string

The text string.

clusterMap short[]

The cluster map.

textProps ShapingTextProperties[]

The text props.

textLength int

Length of the text.

glyphIndices short[]

The glyph indices.

glyphProps ShapingGlyphProperties[]

The glyph props.

glyphCount int

The glyph count.

fontFace FontFace

The font face.

fontEmSize float

Size of the font em.

pixelsPerDip float

The pixels per dip.

transform RawMatrix3x2?

The transform.

useGdiNatural bool

if set to true [use GDI natural].

isSideways bool

if set to true [is sideways].

isRightToLeft bool

if set to true [is right to left].

scriptAnalysis ScriptAnalysis

The script analysis.

localeName string

Name of the locale.

features FontFeature[][]

The features.

featureRangeLengths int[]

The feature range lengths.

glyphAdvances float[]

The glyph advances.

glyphOffsets GlyphOffset[]

The glyph offsets.

GetGlyphPlacements(string, short[], ShapingTextProperties[], int, short[], ShapingGlyphProperties[], int, FontFace, float, bool, bool, ScriptAnalysis, string, FontFeature[][], int[], float[], GlyphOffset[])

Gets the glyph placements.

public void GetGlyphPlacements(string textString, short[] clusterMap, ShapingTextProperties[] textProps, int textLength, short[] glyphIndices, ShapingGlyphProperties[] glyphProps, int glyphCount, FontFace fontFace, float fontEmSize, bool isSideways, bool isRightToLeft, ScriptAnalysis scriptAnalysis, string localeName, FontFeature[][] features, int[] featureRangeLengths, float[] glyphAdvances, GlyphOffset[] glyphOffsets)

Parameters

textString string

The text string.

clusterMap short[]

The cluster map.

textProps ShapingTextProperties[]

The text props.

textLength int

Length of the text.

glyphIndices short[]

The glyph indices.

glyphProps ShapingGlyphProperties[]

The glyph props.

glyphCount int

The glyph count.

fontFace FontFace

The font face.

fontEmSize float

Size of the font in ems.

isSideways bool

if set to true [is sideways].

isRightToLeft bool

if set to true [is right to left].

scriptAnalysis ScriptAnalysis

The script analysis.

localeName string

Name of the locale.

features FontFeature[][]

The features.

featureRangeLengths int[]

The feature range lengths.

glyphAdvances float[]

The glyph advances.

glyphOffsets GlyphOffset[]

The glyph offsets.

GetGlyphs(string, int, FontFace, bool, bool, ScriptAnalysis, string, NumberSubstitution, FontFeature[][], int[], int, short[], ShapingTextProperties[], short[], ShapingGlyphProperties[], out int)

Gets the glyphs (TODO doc)

public void GetGlyphs(string textString, int textLength, FontFace fontFace, bool isSideways, bool isRightToLeft, ScriptAnalysis scriptAnalysis, string localeName, NumberSubstitution numberSubstitution, FontFeature[][] features, int[] featureRangeLengths, int maxGlyphCount, short[] clusterMap, ShapingTextProperties[] textProps, short[] glyphIndices, ShapingGlyphProperties[] glyphProps, out int actualGlyphCount)

Parameters

textString string

The text string.

textLength int

Length of the text.

fontFace FontFace

The font face.

isSideways bool

if set to true [is sideways].

isRightToLeft bool

if set to true [is right to left].

scriptAnalysis ScriptAnalysis

The script analysis.

localeName string

Name of the locale.

numberSubstitution NumberSubstitution

The number substitution.

features FontFeature[][]

The features.

featureRangeLengths int[]

The feature range lengths.

maxGlyphCount int

The max glyph count.

clusterMap short[]

The cluster map.

textProps ShapingTextProperties[]

The text props.

glyphIndices short[]

The glyph indices.

glyphProps ShapingGlyphProperties[]

The glyph props.

actualGlyphCount int

The actual glyph count.

Operators

explicit operator TextAnalyzer(nint)

public static explicit operator TextAnalyzer(nint nativePtr)

Parameters

nativePtr nint

Returns

TextAnalyzer