In the game Minecraft, the developers have used a PNG file for screen fonts.
How would I go about doing this in my Java application?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The Java font rendering system assumes scalable fonts only, such as TrueType fonts, that describe the shapes of glyphs in terms of parameterized curves.
There is no support for bitmapped fonts, so you would have to lay out the glyphs in your own code. So if you wanted to display a String at position (x, y), you would need to look up the shapes for your bitmapped font, then find the first letter’s shape, draw it at (x,y), find the next letters’ shape, draw it to (x+fontWidth, y), etc.