LWJGL TrueTypeFont Example From Stream


SUBMITTED BY: Guest

DATE: Aug. 19, 2013, 5:41 p.m.

FORMAT: Java

SIZE: 365 Bytes

HITS: 805

  1. try {
  2. InputStream inputStream = ResourceLoader.getResourceAsStream("C:/Users//Desktop/Coalition.ttf");
  3. Font awtFont = Font.createFont(Font.TRUETYPE_FONT, inputStream);
  4. awtFont = awtFont.deriveFont(48f); // set font size
  5. font = new TrueTypeFont(awtFont, false);
  6. } catch (Exception e) {
  7. e.printStackTrace();
  8. }

comments powered by Disqus