title: Need to add font-family dot matrix dynamically using jquery for print
body: <p>I have a print function in jquery as follows:</p>
  
  <pre><code>$("#btn_print").click(function () {
          //Create print div
          populatePrintdiv();
          $("#btn_cmplte").css('display', 'block');
          var divToPrint = document.getElementById('printdiv');
          var newWin = window.open('', 'Print-Window');
          newWin.document.open();
          newWin.document.write('&lt;html&gt;&lt;body onload="window.print()" style="font-family:consolas;margin-left:30px;"&gt;' + divToPrint.innerHTML + '&lt;/body&gt;&lt;/html&gt;');
          newWin.document.close();
          setTimeout(function () {
              newWin.close();
          }, 10);
      });
  </code></pre>
  
  <p>Here I am specifying font-family as consolas for as you can see in this line</p>
  
  <pre><code>newWin.document.write('&lt;html&gt;&lt;body onload="window.print()" style="font-family:consolas;margin-left:30px;"&gt;' + divToPrint.innerHTML + '&lt;/body&gt;&lt;/html&gt;');
  </code></pre>
  
  <p>I want to use Dot Matrix font family so I downloaded the font family <code>1979_dot_matrix.ttf</code> file and put it inside my project <code>fonts</code> folder.</p>
  
  <p>How can I include this font-family using font face inside :</p>
  
  <pre><code>  newWin.document.write('&lt;html&gt;&lt;body onload="window.print()" style="font-family:consolas;margin-left:30px;"&gt;' + divToPrint.innerHTML + '&lt;/body&gt;&lt;/html&gt;');
  </code></pre>
  
  <p>In css it will looks like:</p>
  
  <pre><code>@font-face {
    font-family: 1979_dot_matrix;
    src: local("1979_dot_matrix"),
         local("1979_dot_matrix"),
         url(fonts/1979_dot_matrix.ttf);
    font-weight: bold;
  }
  </code></pre>
  
  <p>How can I use this dynamically using jquery as the same line above.</p>