# GrapeCity.Documents.Text.Font.FromStream

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Text_Font_FromStream_" data-uid="GrapeCity.Documents.Text.Font.FromStream*">FromStream Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Text_Font_FromStream_" data-uid="GrapeCity.Documents.Text.Font.FromStream*"></a>
<h4 id="GrapeCity_Documents_Text_Font_FromStream_System_IO_Stream_System_Int32_System_Boolean_" data-uid="GrapeCity.Documents.Text.Font.FromStream(System.IO.Stream,System.Int32,System.Boolean)">FromStream(Stream, int, bool)</h4>
<div class="markdown level1 summary"><p>Loads a <a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a> from the specified stream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Font FromStream(Stream stream, int bytesToRead = -1, bool initCodeMap = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FromStream(stream As Stream, Optional bytesToRead As Integer = -1, Optional initCodeMap As Boolean = False) 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.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The stream containing the font data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bytesToRead</span></td>
      <td><p>The number of bytes to read from the stream; -1 causes reading till the end of stream.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">initCodeMap</span></td>
      <td><p>Set this parameter to True if you're planning to add the font to the fallback font collection.</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="GrapeCity.Documents.Text.Font.html">Font</a></td>
      <td><p>The newly created font, or null if the stream did not contain any fonts.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Text_Font_FromStream_" data-uid="GrapeCity.Documents.Text.Font.FromStream*"></a>
<h4 id="GrapeCity_Documents_Text_Font_FromStream_System_IO_Stream_System_String_System_Int32_" data-uid="GrapeCity.Documents.Text.Font.FromStream(System.IO.Stream,System.String,System.Int32)">FromStream(Stream, string, int)</h4>
<div class="markdown level1 summary"><p>Loads a <a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a> with given full font name from a specified stream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Font FromStream(Stream stream, string fullFontName, int bytesToRead = -1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FromStream(stream As Stream, fullFontName As String, Optional bytesToRead As Integer = -1) 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.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The stream containing the font data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fullFontName</span></td>
      <td><p>The full font name to be loaded.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bytesToRead</span></td>
      <td><p>The number of bytes to read from the stream; -1 causes reading till the end of stream.</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="GrapeCity.Documents.Text.Font.html">Font</a></td>
      <td><p>The newly created font.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
