[]
IDWriteTextAnalyzer
[Guid("b7e6163e-7f46-43b4-84b3-e4e6249c365d")]
public class TextAnalyzer : ComObject, IDisposable, IUnknown
Initializes a new instance of the TextAnalyzer class.
public TextAnalyzer(IntPtr nativePtr)
nativePtr System.IntPtrThe native pointer.
Analyzes a text range for script directionality, reading attributes from the source and reporting levels to the sink callback {{SetBidiLevel}}.
public void AnalyzeBidi(ITextAnalysisQuickSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisQuickSourceA reference to a source object to analyze.
textPosition intThe starting text position within the source object.
textLength intThe text length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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.
Analyzes a text range for script directionality, reading attributes from the source and reporting levels to the sink callback {{SetBidiLevel}}.
public void AnalyzeBidi(ITextAnalysisSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisSourceA reference to a source object to analyze.
textPosition intThe starting text position within the source object.
textLength intThe text length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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.
HRESULT IDWriteTextAnalyzer::AnalyzeBidi([In] IDWriteTextAnalysisSource* analysisSource,[In] unsigned int textPosition,[In] unsigned int textLength,[In] IDWriteTextAnalysisSink* analysisSink)
public void AnalyzeBidi(IntPtr analysisSource, int textPosition, int textLength, IntPtr analysisSink)
analysisSource System.IntPtrtextPosition inttextLength intanalysisSink System.IntPtrAnalyzes a text range for potential breakpoint opportunities, reading attributes from the source and reporting breakpoint opportunities to the sink callback {{SetLineBreakpoints}}.
public void AnalyzeLineBreakpoints(ITextAnalysisQuickSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisQuickSourceA reference to the source object to analyze.
textPosition intThe starting text position within the source object.
textLength intThe text length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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.
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(ITextAnalysisSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisSourceA reference to the source object to analyze.
textPosition intThe starting text position within the source object.
textLength intThe text length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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.
HRESULT IDWriteTextAnalyzer::AnalyzeLineBreakpoints([In] IDWriteTextAnalysisSource* analysisSource,[In] unsigned int textPosition,[In] unsigned int textLength,[In] IDWriteTextAnalysisSink* analysisSink)
public void AnalyzeLineBreakpoints(IntPtr analysisSource, int textPosition, int textLength, IntPtr analysisSink)
analysisSource System.IntPtrtextPosition inttextLength intanalysisSink System.IntPtrAnalyzes 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(ITextAnalysisQuickSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisQuickSourceThe source object to analyze.
textPosition intThe starting position within the source object.
textLength intThe length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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.
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(ITextAnalysisSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisSourceThe source object to analyze.
textPosition intThe starting position within the source object.
textLength intThe length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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.
HRESULT IDWriteTextAnalyzer::AnalyzeNumberSubstitution([In] IDWriteTextAnalysisSource* analysisSource,[In] unsigned int textPosition,[In] unsigned int textLength,[In] IDWriteTextAnalysisSink* analysisSink)
public void AnalyzeNumberSubstitution(IntPtr analysisSource, int textPosition, int textLength, IntPtr analysisSink)
analysisSource System.IntPtrtextPosition inttextLength intanalysisSink System.IntPtrAnalyzes 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(ITextAnalysisQuickSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisQuickSourceA reference to the source object to analyze.
textPosition intThe starting text position within the source object.
textLength intThe text length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
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(ITextAnalysisSource analysisSource, int textPosition, int textLength, ITextAnalysisSink analysisSink)
analysisSource ITextAnalysisSourceA reference to the source object to analyze.
textPosition intThe starting text position within the source object.
textLength intThe text length to analyze.
analysisSink ITextAnalysisSinkA reference to the sink callback object that receives the text analysis.
HRESULT IDWriteTextAnalyzer::AnalyzeScript([In] IDWriteTextAnalysisSource* analysisSource,[In] unsigned int textPosition,[In] unsigned int textLength,[In] IDWriteTextAnalysisSink* analysisSink)
public void AnalyzeScript(IntPtr analysisSource, int textPosition, int textLength, IntPtr analysisSink)
analysisSource System.IntPtrtextPosition inttextLength intanalysisSink System.IntPtrReturns an interface for performing text analysis.
public static TextAnalyzer Create(Factory factory)
HRESULT IDWriteTextAnalyzer::GetGdiCompatibleGlyphPlacements([In, Buffer] const wchar_t* textString,[In, Buffer] const unsigned short* clusterMap,[In, Buffer] DWRITE_SHAPING_TEXT_PROPERTIES* textProps,[In] unsigned int textLength,[In, Buffer] const unsigned short* glyphIndices,[In, Buffer] const DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,[In] unsigned int glyphCount,[In] IDWriteFontFace* fontFace,[In] float fontEmSize,[In] float pixelsPerDip,[In, Optional] const DWRITE_MATRIX* transform,[In] BOOL useGdiNatural,[In] BOOL isSideways,[In] BOOL isRightToLeft,[In] const DWRITE_SCRIPT_ANALYSIS* scriptAnalysis,[In, Optional] const wchar_t* localeName,[In, Optional] const void** features,[In, Buffer, Optional] const unsigned int* featureRangeLengths,[In] unsigned int featureRanges,[Out, Buffer] float* glyphAdvances,[Out, Buffer] DWRITE_GLYPH_OFFSET* glyphOffsets)
public void GetGdiCompatibleGlyphPlacements(IntPtr textString, IntPtr clusterMap, IntPtr textProps, int textLength, IntPtr glyphIndices, IntPtr glyphProps, int glyphCount, IntPtr fontFace, float fontEmSize, float pixelsPerDip, Matrix3x2? transform, Bool useGdiNatural, Bool isSideways, Bool isRightToLeft, ScriptAnalysis scriptAnalysis, IntPtr localeName, IntPtr features, IntPtr featureRangeLengths, int featureRanges, IntPtr glyphAdvances, IntPtr glyphOffsets)
textString System.IntPtrclusterMap System.IntPtrtextProps System.IntPtrtextLength intglyphIndices System.IntPtrglyphProps System.IntPtrglyphCount intfontFace System.IntPtrfontEmSize floatpixelsPerDip floattransform Matrix3x2?useGdiNatural BoolisSideways BoolisRightToLeft BoolscriptAnalysis ScriptAnalysislocaleName System.IntPtrfeatures System.IntPtrfeatureRangeLengths System.IntPtrfeatureRanges intglyphAdvances System.IntPtrglyphOffsets System.IntPtrHRESULT IDWriteTextAnalyzer::GetGdiCompatibleGlyphPlacements([In, Buffer] const wchar_t* textString,[In, Buffer] const unsigned short* clusterMap,[In, Buffer] DWRITE_SHAPING_TEXT_PROPERTIES* textProps,[In] unsigned int textLength,[In, Buffer] const unsigned short* glyphIndices,[In, Buffer] const DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,[In] unsigned int glyphCount,[In] IDWriteFontFace* fontFace,[In] float fontEmSize,[In] float pixelsPerDip,[In, Optional] const DWRITE_MATRIX* transform,[In] BOOL useGdiNatural,[In] BOOL isSideways,[In] BOOL isRightToLeft,[In] const DWRITE_SCRIPT_ANALYSIS* scriptAnalysis,[In, Optional] const wchar_t* localeName,[In, Optional] const void** features,[In, Buffer, Optional] const unsigned int* featureRangeLengths,[In] unsigned int featureRanges,[Out, Buffer] float* glyphAdvances,[Out, Buffer] DWRITE_GLYPH_OFFSET* glyphOffsets)
public void GetGdiCompatibleGlyphPlacements(string textString, short[] clusterMap, ShapingTextProperties[] textProps, int textLength, short[] glyphIndices, ShapingGlyphProperties[] glyphProps, int glyphCount, FontFace fontFace, float fontEmSize, float pixelsPerDip, Matrix3x2? transform, Bool useGdiNatural, Bool isSideways, Bool isRightToLeft, ScriptAnalysis scriptAnalysis, string localeName, IntPtr features, int[] featureRangeLengths, int featureRanges, float[] glyphAdvances, GlyphOffset[] glyphOffsets)
textString stringclusterMap short[]textProps ShapingTextProperties[]textLength intglyphIndices short[]glyphProps ShapingGlyphProperties[]glyphCount intfontFace FontFacefontEmSize floatpixelsPerDip floattransform Matrix3x2?useGdiNatural BoolisSideways BoolisRightToLeft BoolscriptAnalysis ScriptAnalysislocaleName stringfeatures System.IntPtrfeatureRangeLengths int[]featureRanges intglyphAdvances float[]glyphOffsets 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, Matrix3x2? transform, bool useGdiNatural, bool isSideways, bool isRightToLeft, ScriptAnalysis scriptAnalysis, string localeName, FontFeature[][] features, int[] featureRangeLengths, float[] glyphAdvances, GlyphOffset[] glyphOffsets)
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.
pixelsPerDip floatThe pixels per dip.
transform Matrix3x2?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.
HRESULT IDWriteTextAnalyzer::GetGlyphPlacements([In, Buffer] const wchar_t* textString,[In, Buffer] const unsigned short* clusterMap,[In, Buffer] DWRITE_SHAPING_TEXT_PROPERTIES* textProps,[In] unsigned int textLength,[In, Buffer] const unsigned short* glyphIndices,[In, Buffer] const DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,[In] unsigned int glyphCount,[In] IDWriteFontFace* fontFace,[In] float fontEmSize,[In] BOOL isSideways,[In] BOOL isRightToLeft,[In] const DWRITE_SCRIPT_ANALYSIS* scriptAnalysis,[In, Optional] const wchar_t* localeName,[In, Optional] const void** features,[In, Buffer, Optional] const unsigned int* featureRangeLengths,[In] unsigned int featureRanges,[Out, Buffer] float* glyphAdvances,[Out, Buffer] DWRITE_GLYPH_OFFSET* glyphOffsets)
public void GetGlyphPlacements(IntPtr textString, IntPtr clusterMap, IntPtr textProps, int textLength, IntPtr glyphIndices, IntPtr glyphProps, int glyphCount, IntPtr fontFace, float fontEmSize, Bool isSideways, Bool isRightToLeft, ScriptAnalysis scriptAnalysis, IntPtr localeName, IntPtr features, IntPtr featureRangeLengths, int featureRanges, IntPtr glyphAdvances, IntPtr glyphOffsets)
textString System.IntPtrclusterMap System.IntPtrtextProps System.IntPtrtextLength intglyphIndices System.IntPtrglyphProps System.IntPtrglyphCount intfontFace System.IntPtrfontEmSize floatisSideways BoolisRightToLeft BoolscriptAnalysis ScriptAnalysislocaleName System.IntPtrfeatures System.IntPtrfeatureRangeLengths System.IntPtrfeatureRanges intglyphAdvances System.IntPtrglyphOffsets System.IntPtrHRESULT IDWriteTextAnalyzer::GetGlyphPlacements([In, Buffer] const wchar_t* textString,[In, Buffer] const unsigned short* clusterMap,[In, Buffer] DWRITE_SHAPING_TEXT_PROPERTIES* textProps,[In] unsigned int textLength,[In, Buffer] const unsigned short* glyphIndices,[In, Buffer] const DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,[In] unsigned int glyphCount,[In] IDWriteFontFace* fontFace,[In] float fontEmSize,[In] BOOL isSideways,[In] BOOL isRightToLeft,[In] const DWRITE_SCRIPT_ANALYSIS* scriptAnalysis,[In, Optional] const wchar_t* localeName,[In, Optional] const void** features,[In, Buffer, Optional] const unsigned int* featureRangeLengths,[In] unsigned int featureRanges,[Out, Buffer] float* glyphAdvances,[Out, Buffer] DWRITE_GLYPH_OFFSET* glyphOffsets)
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, IntPtr features, int[] featureRangeLengths, int featureRanges, float[] glyphAdvances, GlyphOffset[] glyphOffsets)
textString stringclusterMap short[]textProps ShapingTextProperties[]textLength intglyphIndices short[]glyphProps ShapingGlyphProperties[]glyphCount intfontFace FontFacefontEmSize floatisSideways BoolisRightToLeft BoolscriptAnalysis ScriptAnalysislocaleName stringfeatures System.IntPtrfeatureRangeLengths int[]featureRanges intglyphAdvances float[]glyphOffsets 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)
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.
HRESULT IDWriteTextAnalyzer::GetGlyphs([In, Buffer] const wchar_t* textString,[In] unsigned int textLength,[In] IDWriteFontFace* fontFace,[In] BOOL isSideways,[In] BOOL isRightToLeft,[In] const DWRITE_SCRIPT_ANALYSIS* scriptAnalysis,[In, Optional] const wchar_t* localeName,[In, Optional] IDWriteNumberSubstitution* numberSubstitution,[In, Optional] const void** features,[In, Buffer, Optional] const unsigned int* featureRangeLengths,[In] unsigned int featureRanges,[In] unsigned int maxGlyphCount,[Out, Buffer] unsigned short* clusterMap,[Out, Buffer] DWRITE_SHAPING_TEXT_PROPERTIES* textProps,[Out, Buffer] unsigned short* glyphIndices,[Out, Buffer] DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,[Out] unsigned int* actualGlyphCount)
public HResult GetGlyphs(IntPtr textString, int textLength, IntPtr fontFace, bool isSideways, bool isRightToLeft, ScriptAnalysis scriptAnalysis, IntPtr localeName, IntPtr numberSubstitution, IntPtr features, IntPtr featureRangeLengths, int maxGlyphCount, IntPtr clusterMap, IntPtr textProps, IntPtr glyphIndices, IntPtr glyphProps, out int actualGlyphCount)
textString System.IntPtrtextLength intfontFace System.IntPtrisSideways boolisRightToLeft boolscriptAnalysis ScriptAnalysislocaleName System.IntPtrnumberSubstitution System.IntPtrfeatures System.IntPtrfeatureRangeLengths System.IntPtrmaxGlyphCount intclusterMap System.IntPtrtextProps System.IntPtrglyphIndices System.IntPtrglyphProps System.IntPtractualGlyphCount intHRESULT IDWriteTextAnalyzer::GetGlyphs([In, Buffer] const wchar_t* textString,[In] unsigned int textLength,[In] IDWriteFontFace* fontFace,[In] BOOL isSideways,[In] BOOL isRightToLeft,[In] const DWRITE_SCRIPT_ANALYSIS* scriptAnalysis,[In, Optional] const wchar_t* localeName,[In, Optional] IDWriteNumberSubstitution* numberSubstitution,[In, Optional] const void** features,[In, Buffer, Optional] const unsigned int* featureRangeLengths,[In] unsigned int featureRanges,[In] unsigned int maxGlyphCount,[Out, Buffer] unsigned short* clusterMap,[Out, Buffer] DWRITE_SHAPING_TEXT_PROPERTIES* textProps,[Out, Buffer] unsigned short* glyphIndices,[Out, Buffer] DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,[Out] unsigned int* actualGlyphCount)
public int GetGlyphs(string textString, int textLength, FontFace fontFace, Bool isSideways, Bool isRightToLeft, ScriptAnalysis scriptAnalysis, string localeName, NumberSubstitution numberSubstitution, IntPtr features, int[] featureRangeLengths, int featureRanges, int maxGlyphCount, short[] clusterMap, ShapingTextProperties[] textProps, short[] glyphIndices, ShapingGlyphProperties[] glyphProps)
textString stringtextLength intfontFace FontFaceisSideways BoolisRightToLeft BoolscriptAnalysis ScriptAnalysislocaleName stringnumberSubstitution NumberSubstitutionfeatures System.IntPtrfeatureRangeLengths int[]featureRanges intmaxGlyphCount intclusterMap short[]textProps ShapingTextProperties[]glyphIndices short[]glyphProps ShapingGlyphProperties[]Gets the glyphs (TODO doc)
public int 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)
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.
Performs an explicit conversion from System.IntPtr to TextAnalyzer.
public static explicit operator TextAnalyzer(IntPtr nativePointer)
nativePointer System.IntPtr