# C1.Util.DX.DirectWrite.FontFallback.MapCharacters

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters*">MapCharacters Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_C1_Util_DX_DirectWrite_TextAnalysisSource_System_Int32_System_Int32_C1_Util_DX_DirectWrite_FontCollection_System_String_C1_Util_DX_DirectWrite_FontWeight_C1_Util_DX_DirectWrite_FontStyle_C1_Util_DX_DirectWrite_FontStretch_System_Int32__System_Single__" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters(C1.Util.DX.DirectWrite.TextAnalysisSource,System.Int32,System.Int32,C1.Util.DX.DirectWrite.FontCollection,System.String,C1.Util.DX.DirectWrite.FontWeight,C1.Util.DX.DirectWrite.FontStyle,C1.Util.DX.DirectWrite.FontStretch,System.Int32@,System.Single@)">MapCharacters(TextAnalysisSource, int, int, FontCollection, string, FontWeight, FontStyle, FontStretch, out int, out float)</h4>
<div class="markdown level1 summary"><p>Determines an appropriate font to use to render the range of text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Font MapCharacters(TextAnalysisSource source, int textPosition, int textLength, FontCollection baseFontCollection, string baseFamilyName, FontWeight baseWeight, FontStyle baseStyle, FontStretch baseStretch, out int mappedLength, out float scale)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapCharacters(source As TextAnalysisSource, textPosition As Integer, textLength As Integer, baseFontCollection As FontCollection, baseFamilyName As String, baseWeight As FontWeight, baseStyle As FontStyle, baseStretch As FontStretch, ByRef mappedLength As Integer, ByRef scale As Single) As Font</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextAnalysisSource.html">TextAnalysisSource</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>The text source implementation holds the text and locale.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">textPosition</span></td>
      <td><p>Starting position to analyze.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">textLength</span></td>
      <td><p>Length of the text to analyze.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontCollection.html">FontCollection</a></td>
      <td><span class="parametername">baseFontCollection</span></td>
      <td><p>Default font collection to use.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">baseFamilyName</span></td>
      <td><p>Family name of the base font. If you pass null, no matching will be done against the family.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontWeight.html">FontWeight</a></td>
      <td><span class="parametername">baseWeight</span></td>
      <td><p>Desired weight.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStyle.html">FontStyle</a></td>
      <td><span class="parametername">baseStyle</span></td>
      <td><p>Desired style.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStretch.html">FontStretch</a></td>
      <td><span class="parametername">baseStretch</span></td>
      <td><p>Desired stretch.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mappedLength</span></td>
      <td><p>Length of text mapped to the mapped font. This will always be less or equal to the input text length and greater than zero (if the text length is non-zero) so that the caller advances at least one character each call.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">scale</span></td>
      <td><p>Scale factor to multiply the em size of the returned font by.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.Font.html">Font</a></td>
      <td><p>The font that should be used to render the first mappedLength characters of the text. If it returns NULL, then no known font can render the text, and mappedLength is the number of unsupported characters to skip.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_System_IntPtr_System_Int32_System_Int32_C1_Util_DX_DirectWrite_FontCollection_System_String_C1_Util_DX_DirectWrite_FontWeight_C1_Util_DX_DirectWrite_FontStyle_C1_Util_DX_DirectWrite_FontStretch_System_Int32__System_Single__" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters(System.IntPtr,System.Int32,System.Int32,C1.Util.DX.DirectWrite.FontCollection,System.String,C1.Util.DX.DirectWrite.FontWeight,C1.Util.DX.DirectWrite.FontStyle,C1.Util.DX.DirectWrite.FontStretch,System.Int32@,System.Single@)">MapCharacters(IntPtr, int, int, FontCollection, string, FontWeight, FontStyle, FontStretch, out int, out float)</h4>
<div class="markdown level1 summary"><p>HRESULT IDWriteFontFallback::MapCharacters(IDWriteTextAnalysisSource* source, UINT32 textPosition, UINT32 textLength, [in, optional] IDWriteFontCollection* baseFontCollection, [in, optional] wchar_t* baseFamilyName, DWRITE_FONT_WEIGHT baseWeight, DWRITE_FONT_STYLE baseStyle, DWRITE_FONT_STRETCH baseStretch, [out] UINT32* mappedLength, [out] IDWriteFont** mappedFont, [out] FLOAT* scale)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Font MapCharacters(IntPtr source, int textPosition, int textLength, FontCollection baseFontCollection, string baseFamilyName, FontWeight baseWeight, FontStyle baseStyle, FontStretch baseStretch, out int mappedLength, out float scale)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapCharacters(source As IntPtr, textPosition As Integer, textLength As Integer, baseFontCollection As FontCollection, baseFamilyName As String, baseWeight As FontWeight, baseStyle As FontStyle, baseStretch As FontStretch, ByRef mappedLength As Integer, ByRef scale As Single) As Font</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">source</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">textPosition</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">textLength</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontCollection.html">FontCollection</a></td>
      <td><span class="parametername">baseFontCollection</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">baseFamilyName</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontWeight.html">FontWeight</a></td>
      <td><span class="parametername">baseWeight</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStyle.html">FontStyle</a></td>
      <td><span class="parametername">baseStyle</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStretch.html">FontStretch</a></td>
      <td><span class="parametername">baseStretch</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mappedLength</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">scale</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.Font.html">Font</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFallback_MapCharacters_System_IntPtr_System_Int32_System_Int32_System_IntPtr_System_IntPtr_C1_Util_DX_DirectWrite_FontWeight_C1_Util_DX_DirectWrite_FontStyle_C1_Util_DX_DirectWrite_FontStretch_System_Int32__System_Single__" data-uid="C1.Util.DX.DirectWrite.FontFallback.MapCharacters(System.IntPtr,System.Int32,System.Int32,System.IntPtr,System.IntPtr,C1.Util.DX.DirectWrite.FontWeight,C1.Util.DX.DirectWrite.FontStyle,C1.Util.DX.DirectWrite.FontStretch,System.Int32@,System.Single@)">MapCharacters(IntPtr, int, int, IntPtr, IntPtr, FontWeight, FontStyle, FontStretch, out int, out float)</h4>
<div class="markdown level1 summary"><p>HRESULT IDWriteFontFallback::MapCharacters(IDWriteTextAnalysisSource* source, UINT32 textPosition, UINT32 textLength, [in, optional] IDWriteFontCollection* baseFontCollection, [in, optional] wchar_t* baseFamilyName, DWRITE_FONT_WEIGHT baseWeight, DWRITE_FONT_STYLE baseStyle, DWRITE_FONT_STRETCH baseStretch, [out] UINT32* mappedLength, [out] IDWriteFont** mappedFont, [out] FLOAT* scale)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Font MapCharacters(IntPtr source, int textPosition, int textLength, IntPtr baseFontCollection, IntPtr baseFamilyName, FontWeight baseWeight, FontStyle baseStyle, FontStretch baseStretch, out int mappedLength, out float scale)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MapCharacters(source As IntPtr, textPosition As Integer, textLength As Integer, baseFontCollection As IntPtr, baseFamilyName As IntPtr, baseWeight As FontWeight, baseStyle As FontStyle, baseStretch As FontStretch, ByRef mappedLength As Integer, ByRef scale As Single) As Font</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">source</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">textPosition</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">textLength</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">baseFontCollection</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">baseFamilyName</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontWeight.html">FontWeight</a></td>
      <td><span class="parametername">baseWeight</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStyle.html">FontStyle</a></td>
      <td><span class="parametername">baseStyle</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStretch.html">FontStretch</a></td>
      <td><span class="parametername">baseStretch</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">mappedLength</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">scale</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.Font.html">Font</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
