/// <summary> /// Gets the glyphs (TODO doc) /// </summary> /// <param name="textString">The text string.</param> /// <param name="textLength">Length of the text.</param> /// <param name="fontFace">The font face.</param> /// <param name="isSideways">if set to <c>true</c> [is sideways].</param> /// <param name="isRightToLeft">if set to <c>true</c> [is right to left].</param> /// <param name="scriptAnalysis">The script analysis.</param> /// <param name="localeName">Name of the locale.</param> /// <param name="numberSubstitution">The number substitution.</param> /// <param name="features">The features.</param> /// <param name="featureRangeLengths">The feature range lengths.</param> /// <param name="maxGlyphCount">The max glyph count.</param> /// <param name="clusterMap">The cluster map.</param> /// <param name="textProps">The text props.</param> /// <param name="glyphIndices">The glyph indices.</param> /// <param name="glyphProps">The glyph props.</param> /// <param name="actualGlyphCount">The actual glyph count.</param> /// <returns> /// If the method succeeds, it returns <see cref="Result.Ok"/>. /// </returns> /// <unmanaged>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, Buffer, 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)</unmanaged> public void GetGlyphs(string textString, int textLength, SharpDX.DirectWrite.FontFace fontFace, bool isSideways, bool isRightToLeft, SharpDX.DirectWrite.ScriptAnalysis scriptAnalysis, string localeName, SharpDX.DirectWrite.NumberSubstitution numberSubstitution, FontFeature[][] features, int[] featureRangeLengths, int maxGlyphCount, short[] clusterMap, SharpDX.DirectWrite.ShapingTextProperties[] textProps, short[] glyphIndices, SharpDX.DirectWrite.ShapingGlyphProperties[] glyphProps, out int actualGlyphCount) { var pFeatures = AllocateFeatures(features); try { GetGlyphs( textString, textLength, fontFace, isSideways, isRightToLeft, scriptAnalysis, localeName, numberSubstitution, pFeatures, featureRangeLengths, featureRangeLengths == null ? 0 : featureRangeLengths.Length, maxGlyphCount, clusterMap, textProps, glyphIndices, glyphProps, out actualGlyphCount); } finally { if (pFeatures != IntPtr.Zero) { Marshal.FreeHGlobal(pFeatures); } } }
/// <summary> /// Gets the GDI compatible glyph placements. /// </summary> /// <param name="textString">The text string.</param> /// <param name="clusterMap">The cluster map.</param> /// <param name="textProps">The text props.</param> /// <param name="textLength">Length of the text.</param> /// <param name="glyphIndices">The glyph indices.</param> /// <param name="glyphProps">The glyph props.</param> /// <param name="glyphCount">The glyph count.</param> /// <param name="fontFace">The font face.</param> /// <param name="fontEmSize">Size of the font em.</param> /// <param name="pixelsPerDip">The pixels per dip.</param> /// <param name="transform">The transform.</param> /// <param name="useGdiNatural">if set to <c>true</c> [use GDI natural].</param> /// <param name="isSideways">if set to <c>true</c> [is sideways].</param> /// <param name="isRightToLeft">if set to <c>true</c> [is right to left].</param> /// <param name="scriptAnalysis">The script analysis.</param> /// <param name="localeName">Name of the locale.</param> /// <param name="features">The features.</param> /// <param name="featureRangeLengths">The feature range lengths.</param> /// <param name="glyphAdvances">The glyph advances.</param> /// <param name="glyphOffsets">The glyph offsets.</param> /// <returns> /// If the method succeeds, it returns <see cref="Result.Ok"/>. /// </returns> /// <unmanaged>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, Buffer, 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)</unmanaged> public void GetGdiCompatibleGlyphPlacements(string textString, short[] clusterMap, SharpDX.DirectWrite.ShapingTextProperties[] textProps, int textLength, short[] glyphIndices, SharpDX.DirectWrite.ShapingGlyphProperties[] glyphProps, int glyphCount, SharpDX.DirectWrite.FontFace fontFace, float fontEmSize, float pixelsPerDip, RawMatrix3x2?transform, bool useGdiNatural, bool isSideways, bool isRightToLeft, SharpDX.DirectWrite.ScriptAnalysis scriptAnalysis, string localeName, FontFeature[][] features, int[] featureRangeLengths, float[] glyphAdvances, SharpDX.DirectWrite.GlyphOffset[] glyphOffsets) { var pFeatures = AllocateFeatures(features); try { GetGdiCompatibleGlyphPlacements( textString, clusterMap, textProps, textLength, glyphIndices, glyphProps, glyphCount, fontFace, fontEmSize, pixelsPerDip, transform, useGdiNatural, isSideways, isRightToLeft, scriptAnalysis, localeName, pFeatures, featureRangeLengths, featureRangeLengths == null ? 0 : featureRangeLengths.Length, glyphAdvances, glyphOffsets ); } finally { if (pFeatures != IntPtr.Zero) { Marshal.FreeHGlobal(pFeatures); } } }