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
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
TextAnalysisSourceNo documentation.
textPosition
intNo documentation.
textLength
intNo documentation.
analysisSink
TextAnalysisSinkNo 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
TextAnalysisSourceNo documentation.
textPosition
intNo documentation.
textLength
intNo documentation.
analysisSink
TextAnalysisSinkNo 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
TextAnalysisSourceNo documentation.
textPosition
intNo documentation.
textLength
intNo documentation.
analysisSink
TextAnalysisSinkNo 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
TextAnalysisSourceNo documentation.
textPosition
intNo documentation.
textLength
intNo documentation.
analysisSink
TextAnalysisSinkNo 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
stringThe text string.
clusterMap
short[]The cluster map.
textProps
ShapingTextProperties[]The text props.
textLength
intLength of the text.
glyphIndices
short[]The glyph indices.
glyphProps
ShapingGlyphProperties[]The glyph props.
glyphCount
intThe glyph count.
fontFace
FontFaceThe font face.
fontEmSize
floatSize of the font em.
pixelsPerDip
floatThe pixels per dip.
transform
RawMatrix3x2?The transform.
useGdiNatural
boolif set to
true
[use GDI natural].isSideways
boolif set to
true
[is sideways].isRightToLeft
boolif set to
true
[is right to left].scriptAnalysis
ScriptAnalysisThe script analysis.
localeName
stringName 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
stringThe text string.
clusterMap
short[]The cluster map.
textProps
ShapingTextProperties[]The text props.
textLength
intLength of the text.
glyphIndices
short[]The glyph indices.
glyphProps
ShapingGlyphProperties[]The glyph props.
glyphCount
intThe glyph count.
fontFace
FontFaceThe font face.
fontEmSize
floatSize of the font in ems.
isSideways
boolif set to
true
[is sideways].isRightToLeft
boolif set to
true
[is right to left].scriptAnalysis
ScriptAnalysisThe script analysis.
localeName
stringName 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
stringThe text string.
textLength
intLength of the text.
fontFace
FontFaceThe font face.
isSideways
boolif set to
true
[is sideways].isRightToLeft
boolif set to
true
[is right to left].scriptAnalysis
ScriptAnalysisThe script analysis.
localeName
stringName of the locale.
numberSubstitution
NumberSubstitutionThe number substitution.
features
FontFeature[][]The features.
featureRangeLengths
int[]The feature range lengths.
maxGlyphCount
intThe max glyph count.
clusterMap
short[]The cluster map.
textProps
ShapingTextProperties[]The text props.
glyphIndices
short[]The glyph indices.
glyphProps
ShapingGlyphProperties[]The glyph props.
actualGlyphCount
intThe actual glyph count.
Operators
explicit operator TextAnalyzer(nint)
public static explicit operator TextAnalyzer(nint nativePtr)
Parameters
nativePtr
nint