Font loading problems in Windows

TrueType-fonts in my game does’nt get loaded in M$ Windows, but the same code is working great in Linux and OS X.
Only if i install the font in windows does it work, how come? Weird if the users have to install the font themself just to get your application working, it can’t be that stupid, i must do SOMETHING wrong!

Sample-code:
Font tmpFont = Font.createFont(Font.TRUETYPE_FONT, new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream(GAMECONSTANTS.GAME_FONT)));
mFont = new Font(tmpFont.getName(), tmpFont.getStyle(), FONTSIZE);

oh, it’s a Java Webstart game if it matters.

Thanks!

// Henrik

No takers? Anyone?

I’ve asked our fonts guy, Phil, and he said that there’s nothing different in the way we createFont on linux and windows, so it “should just work” ©. There were some issues with getting resources out of (compressed?) jar files, may be this is the problem?

Thanks,
Dmitri

That method can throw 3 flavours of exceptions… so do you get any? Enable the jws console and also enable logging while you’re at it. (A tool for making 1.5’s logs humanreadable again can be found here (source included).)

here were some issues with getting resources out of (compressed?) jar files, may be this is the problem?

That new BufferedInputStream bit should fix that kind of 1.4 issues iirc.

Thanks guys(?)!

Yes, i’m trying to catch all exceptions, the code look like this:
try
{
Font tmpFont = Font.createFont(Font.TRUETYPE_FONT, new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream(GAME_FONT)));
mFont = new Font(tmpFont.getName(), tmpFont.getStyle(), FONTSIZE);
} catch (IllegalArgumentException exception)
{
exception.printStackTrace();
} catch (FontFormatException exception)
{
exception.printStackTrace();
} catch (IOException exception)
{
exception.printStackTrace();
}

I’ll try turning on some more extensive logging, thanks for the tool(oNyx)!