Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7817677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:18:35+00:00 2026-06-02T06:18:35+00:00

I have Slick2D library and making a game in Java. I have been wondering,

  • 0

I have Slick2D library and making a game in Java. I have been wondering, just a short question, how do you set fonts on Graphics object to draw in a different font.
I can’t make it work. I think it has something to do with AngelCode but that requires some format that isn’t ‘.tff’ so I don’t know.

So can you tell me how you do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:18:37+00:00Added an answer on June 2, 2026 at 6:18 am

    You can use angel code’s BMF font tool, which makes bitmap font files with a glyph image that stores the character images, and a text file that describes the image file (windows only, Herio.jar is similar and is included with slick, but it only works sometimes, crashing on me repeatedly)

    1. Get BMF font here and install it with the included windows installer. Once you have done that, use the GUI to select a font, size, etc. (note that you have to make 1 font/glyh image pair per size and font) Then highlight the boxes that contain characters you want to use, noting that slick only supports up to 256 (I think) characters.

    2. you need to Change some export settings so that slick will recognize the files. Go to file -> export options and change the the "bit channels" (I think that’s what its called) A -> glyph R,G, and B -> one. Set presets to custom, and the textures to .png files, and your configuring is done.

    3. Export your newly created font files [file -> save bitmap font as] (yes, it will make a glyph image (.png), and a text descriptor file with the extension .fnt) in your appropriate data directory.

    4. Code it in by using the AngelCodeFont constrcutor:

      fnt = new AngelCodeFont("LOCATION OF .fnt FILE", new Image("LOCATION OF .png GLYPH IMAGE");

    then you can then either draw with it directly:

    fnt.drawString(float x, float y, "TEXT TO DISPAY");
    

    or you can

    set the current graphics font as the AngelCodeFont and draw directly through the graphics class.

    GraphicsObject.setFont(fnt);
    GraphicsObject.drawString("THIS WLL DRAW IN THE ANGEL CODE FONT");
    

    hope this helped 😀

    more info here, in the API documentation:
    http://slick.cokeandcode.com/javadoc/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a game using the LWJGL and Slick2D made in Java. I recently
I decided to make a 2d game in Java (using the slick2d library and
So I made a little game in java with slick2D, but I want my
Have you ever created or encountered a self modifying code in Java? If yes,
Have you ever had to justify the choice over using .NET instead of Java
I have a clojure project that uses the slick 2d game engine that I
Have a rather abstract question for you all. I'm looking at getting involved in
Have been following Rails Tutorial by Michael Hart rails version 3.0 on mac OS
So I'm currently creating a library extension to the Slick2d library called TiledMapPlus .
have been trying couple of hours now to make my iphone app universal. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.