title: How to load font from InputStream in SWT?
body: <p>I need to load font (<code>.otf</code> or <code>.ttf</code>) file from java <code>Resource</code> or <code>InputStream</code> in SWT.</p>
  
  <p><code>org.eclipse.swt.graphics.Device.loadFont(String path)</code> allows me (<a href="https://stackoverflow.com/questions/221568/swt-os-agnostic-way-to-get-monospaced-font/226404#226404">example</a>) to load font from font file path (and it works), but there is no corresponding method to load it from any other source.</p>
  
  <p>I was thinking of using <code>java.awt.Font.createFont(int fontFormat, InputStream fontStream)</code> and then building <code>org.eclipse.swt.graphics.FontData</code> and <code>org.eclipse.swt.graphics.Font</code> objects out of AWT <code>java.awt.Font</code> object.</p>
  
  <p>Since I haven't tried that option yet (I don't even know if it works that way) I was just wondering if there are any other options available?</p>