Results 1 to 3 of 3
  1. #1
    nmc94 is offline Member
    Join Date
    Dec 2011
    Posts
    1
    Rep Power
    0

    Question Quick Java Question

    Hey,

    I am relativly new to Java and am currently working on my first Java game. I am running into a problem with fonts.
    What I am trying to do is add a font from a .ttf file in my /src path and use it in my game. I cant figure out the code to do it.

    Any help is greatly appreciated!

    Thanks!

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Re: Quick Java Question

    Use Font.createFont(int fontformat, InputStream fontfile)

    for ttf the fontformat should be Font.TRUETYPE_FONT

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Quick Question for java with jobs :(
    By pamboys09 in forum Jobs Discussion
    Replies: 1
    Last Post: 02-07-2011, 06:56 PM
  2. Quick question
    By Thumper in forum New To Java
    Replies: 10
    Last Post: 11-07-2010, 10:06 PM
  3. Quick Question
    By Graeme in forum New To Java
    Replies: 4
    Last Post: 01-08-2009, 08:01 PM
  4. Quick Question
    By Spenc in forum New To Java
    Replies: 3
    Last Post: 09-22-2008, 02:26 PM
  5. Quick Java question/help
    By Zedy in forum New To Java
    Replies: 6
    Last Post: 04-22-2008, 03:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •