Example #1
0
 /// <summary>
 /// <p>Determines an appropriate font to use to render the beginning range of text.</p>
 /// </summary>
 /// <param name="analysisSource"><dd>  <p>The text source implementation holds the text and locale.</p> </dd></param>
 /// <param name="textPosition"><dd>  <p>Starting position to analyze.</p> </dd></param>
 /// <param name="textLength"><dd>  <p>Length of the text to analyze.</p> </dd></param>
 /// <param name="baseFontCollection"><dd>  <p>Default font collection to use.</p> </dd></param>
 /// <param name="baseFamilyName"><dd>  <p>Family name of the base font. If you pass null, no matching     will be done against the family.</p> </dd></param>
 /// <param name="baseWeight"><dd>  <p>The desired weight.</p> </dd></param>
 /// <param name="baseStyle"><dd>  <p>The desired style.</p> </dd></param>
 /// <param name="baseStretch"><dd>  <p>The desired stretch.</p> </dd></param>
 /// <param name="mappedLength"><dd>  <p>Length of text mapped to the mapped font. This will always be less than     or equal to the text length and greater than zero (if the text length is non-zero) so     the caller advances at least one character.</p> </dd></param>
 /// <param name="mappedFont"><dd>  <p>The font that should be used to render the first <em>mappedLength</em> characters of the text. If it returns <c>null</c>, that means that no font can render the     text, and <em>mappedLength</em> is the number of characters to skip (rendered with a missing glyph).</p> </dd></param>
 /// <param name="scale"><dd>  <p>Scale factor to multiply the em size of the returned font by.</p> </dd></param>
 public void MapCharacters(
     TextAnalysisSource analysisSource,
     int textPosition,
     int textLength,
     FontCollection baseFontCollection,
     string baseFamilyName,
     FontWeight baseWeight,
     FontStyle baseStyle,
     FontStretch baseStretch,
     out int mappedLength,
     out Font mappedFont,
     out float scale
     )
 {
     MapCharacters_(
         TextAnalysisSourceShadow.ToIntPtr(analysisSource),
         textPosition,
         textLength,
         baseFontCollection,
         baseFamilyName,
         baseWeight,
         baseStyle,
         baseStretch,
         out mappedLength,
         out mappedFont,
         out scale
         );
 }
Example #2
0
 /// <summary>
 /// Return a pointer to the unmanaged version of this callback.
 /// </summary>
 /// <param name="callback">The callback.</param>
 /// <returns>A pointer to a shadow c++ callback</returns>
 public static IntPtr ToIntPtr(TextAnalysisSource callback)
 {
     return(ToCallbackPtr <TextAnalysisSource>(callback));
 }
Example #3
0
 /// <summary>
 /// 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}}.
 /// </summary>
 /// <param name="analysisSource">The source object to analyze.</param>
 /// <param name="textPosition">The starting position within the source object.</param>
 /// <param name="textLength">The length to analyze.</param>
 /// <param name="analysisSink">A reference to the sink callback object that receives the text analysis.</param>
 /// <returns>
 /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
 /// </returns>
 /// <unmanaged>HRESULT IDWriteTextAnalyzer::AnalyzeNumberSubstitution([None] IDWriteTextAnalysisSource* analysisSource,[None] int textPosition,[None] int textLength,[None] IDWriteTextAnalysisSink* analysisSink)</unmanaged>
 /// <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.
 /// </remarks>
 public void AnalyzeNumberSubstitution(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)
 {
     AnalyzeNumberSubstitution__(TextAnalysisSourceShadow.ToIntPtr(analysisSource), textPosition, textLength, TextAnalysisSinkShadow.ToIntPtr(analysisSink));
 }
Example #4
0
 /// <summary>
 /// Analyzes a text range for script directionality, reading attributes from the source and reporting levels to the sink callback {{SetBidiLevel}}.
 /// </summary>
 /// <param name="analysisSource">A reference to a source object to analyze.</param>
 /// <param name="textPosition">The starting text position within the source object.</param>
 /// <param name="textLength">The text length to analyze.</param>
 /// <param name="analysisSink">A reference to the sink callback object that receives the text analysis.</param>
 /// <returns>
 /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
 /// </returns>
 /// <unmanaged>HRESULT IDWriteTextAnalyzer::AnalyzeBidi([None] IDWriteTextAnalysisSource* analysisSource,[None] int textPosition,[None] int textLength,[None] IDWriteTextAnalysisSink* analysisSink)</unmanaged>
 /// <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.
 /// </remarks>
 public void AnalyzeBidi(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)
 {
     AnalyzeBidi__(TextAnalysisSourceShadow.ToIntPtr(analysisSource), textPosition, textLength, TextAnalysisSinkShadow.ToIntPtr(analysisSink));
 }
Example #5
0
 /// <summary>
 /// Analyzes a text range for potential breakpoint opportunities, reading attributes from the source and reporting breakpoint opportunities to the sink callback {{SetLineBreakpoints}}.
 /// </summary>
 /// <param name="analysisSource">A reference to the source object to analyze.</param>
 /// <param name="textPosition">The starting text position within the source object.</param>
 /// <param name="textLength">The text length to analyze.</param>
 /// <param name="analysisSink">A reference to the  sink callback object that receives the text analysis.</param>
 /// <returns>
 /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
 /// </returns>
 /// <unmanaged>HRESULT IDWriteTextAnalyzer::AnalyzeLineBreakpoints([None] IDWriteTextAnalysisSource* analysisSource,[None] int textPosition,[None] int textLength,[None] IDWriteTextAnalysisSink* analysisSink)</unmanaged>
 /// <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.
 /// </remarks>
 public void AnalyzeLineBreakpoints(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)
 {
     AnalyzeLineBreakpoints__(TextAnalysisSourceShadow.ToIntPtr(analysisSource), textPosition, textLength, TextAnalysisSinkShadow.ToIntPtr(analysisSink));
 }
 /// <summary>
 /// Return a pointer to the unamanged version of this callback.
 /// </summary>
 /// <param name="callback">The callback.</param>
 /// <returns>A pointer to a shadow c++ callback</returns>
 public static IntPtr ToIntPtr(TextAnalysisSource callback)
 {
     return ToCallbackPtr<TextAnalysisSource>(callback);
 }
Example #7
0
 /// <summary>
 /// 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}}.
 /// </summary>
 /// <param name="analysisSource">The source object to analyze.</param>
 /// <param name="textPosition">The starting position within the source object.</param>
 /// <param name="textLength">The length to analyze.</param>
 /// <param name="analysisSink">A reference to the sink callback object that receives the text analysis.</param>
 /// <returns>
 /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
 /// </returns>
 /// <unmanaged>HRESULT IDWriteTextAnalyzer::AnalyzeNumberSubstitution([None] IDWriteTextAnalysisSource* analysisSource,[None] int textPosition,[None] int textLength,[None] IDWriteTextAnalysisSink* analysisSink)</unmanaged>
 /// <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.
 /// </remarks>
 public void AnalyzeNumberSubstitution(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)
 {
     AnalyzeNumberSubstitution__(TextAnalysisSourceShadow.ToIntPtr(analysisSource), textPosition, textLength, TextAnalysisSinkShadow.ToIntPtr(analysisSink));
 }
Example #8
0
 /// <summary>
 /// Analyzes a text range for script directionality, reading attributes from the source and reporting levels to the sink callback {{SetBidiLevel}}.
 /// </summary>
 /// <param name="analysisSource">A reference to a source object to analyze.</param>
 /// <param name="textPosition">The starting text position within the source object.</param>
 /// <param name="textLength">The text length to analyze.</param>
 /// <param name="analysisSink">A reference to the sink callback object that receives the text analysis.</param>
 /// <returns>
 /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
 /// </returns>
 /// <unmanaged>HRESULT IDWriteTextAnalyzer::AnalyzeBidi([None] IDWriteTextAnalysisSource* analysisSource,[None] int textPosition,[None] int textLength,[None] IDWriteTextAnalysisSink* analysisSink)</unmanaged>
 /// <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.
 /// </remarks>
 public void AnalyzeBidi(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)
 {
     AnalyzeBidi__(TextAnalysisSourceShadow.ToIntPtr(analysisSource), textPosition, textLength, TextAnalysisSinkShadow.ToIntPtr(analysisSink));
 }
Example #9
0
 /// <summary>
 /// Analyzes a text range for potential breakpoint opportunities, reading attributes from the source and reporting breakpoint opportunities to the sink callback {{SetLineBreakpoints}}.
 /// </summary>
 /// <param name="analysisSource">A reference to the source object to analyze.</param>
 /// <param name="textPosition">The starting text position within the source object.</param>
 /// <param name="textLength">The text length to analyze.</param>
 /// <param name="analysisSink">A reference to the  sink callback object that receives the text analysis.</param>
 /// <returns>
 /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
 /// </returns>
 /// <unmanaged>HRESULT IDWriteTextAnalyzer::AnalyzeLineBreakpoints([None] IDWriteTextAnalysisSource* analysisSource,[None] int textPosition,[None] int textLength,[None] IDWriteTextAnalysisSink* analysisSink)</unmanaged>
 /// <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.
 /// </remarks>
 public void AnalyzeLineBreakpoints(TextAnalysisSource analysisSource, int textPosition, int textLength, TextAnalysisSink analysisSink)
 {
     AnalyzeLineBreakpoints__(TextAnalysisSourceShadow.ToIntPtr(analysisSource), textPosition, textLength, TextAnalysisSinkShadow.ToIntPtr(analysisSink));
 }