Well I've tried replacing it with UnicodeFont but it's not working so far:
Code:
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.Color;
import org.newdawn.slick.Font;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.UnicodeFont;
public class FontTestGame extends BasicGame {
private static Font font;
private FontTestGame() throws SlickException {
super("Font Tester");
}
public static void main(String[] args) throws SlickException {
FontTestGame game = new FontTestGame();
AppGameContainer container = new AppGameContainer(game, 640, 480, false);
container.setSmoothDeltas(true);
container.setVSync(true);
container.setTargetFrameRate(60);
container.start();
}
@Override
public void init(GameContainer arg0) throws SlickException {
font = new UnicodeFont(new java.awt.Font("Arial", java.awt.Font.ITALIC, 26));
}
@Override
public void update(GameContainer arg0, int arg1) throws SlickException {
}
public void render(GameContainer container, Graphics graphics) throws SlickException {
graphics.setFont(font);
graphics.setColor(Color.white);
graphics.drawString("Capital P, V and Y seem to suffer the most from this!", 30, 30);
font.drawString(30, 80, "Does this work?");
}
}
When I run this, nothing gets displayed at all. I tried rendering from the graphics and font itself, but neither is working, at least not on OS X.
I also tried using the UnicodeFont(String, int, boolean, boolean) constructor instead of the one with a java.awt.Font, but that one would crash immediately saying it couldn't find the font. I see that in the UnicodeFontTest class, a complete windows path is being specified to load the font (which also crashes for me on OS X).
Shouldn't the constructor using a String parameter perform the same lookup as java.awt.Font to find its TTF? Seems like that would be the most convenient variant to use.