title: pdfMake: Use System Fonts
body: <p>I am using the <a href="https://github.com/bpampuch/pdfmake" rel="nofollow">pdfMake</a>-library to generate PDF documents on the client side in one of my applications. My main problem when using the library is that it relies on having available fonts in a virtual file system. The fonts are therefore sent to the client in a JavaScript file called <a href="https://github.com/bpampuch/pdfmake/blob/master/build/vfs_fonts.js" rel="nofollow">vfs_fonts.js</a> and are then loaded into the virtual file system and later embedded in the resulting PDF-file (of course only the used character subset of the whole font). </p>
  
  <p>With the default settings the library uses the Roboto font and therefore sends a little more than 800kb only for the fonts. My main intuition here is: </p>
  
  <p><strong>Why doesn't it use the system fonts and as a result saves traffic?</strong></p>
  
  <p><strong>Is there a workaround to make it use system fonts?</strong></p>
  
  <p>My current approach to reduce the traffic is to remove the font styles from the vfs_fonts.js that aren't used in the documents that I create. E.g. I remove the italic, bold style and italic/bold style when only using regular styles. With this method I was at least able to reduce the size of the font file by 3/4.</p>