1

I'm tired of using the default fonts bundled in the default style jar, so I figured it'd be as easy as downloading some bitmap font files and specifying which one I wanted to use by there path relative to the workspace.

e.g.

//inside of a ScreenBuilder init
//...
control(new LabelBuilder("score"){{
    alignCenter();
    font("font/13-Nimbus.fnt");
    color("#f00f");
    backgroundColor("#3300af");
    text("foobar");
    width((wGUI/3-10)+"px");
    height((hGUI-10)+"px");
}});

Unfortunately this gives me the following error:

java.lang.RuntimeException: Resource not found: font/13-Nimbus.fnt at de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader.getResourceAsStream(NiftyResourceLoader.java:72) ...

So this leads me to believe there is some of add-resource-location function I should be calling to tell nifty where my fonts are. But after looking through the Javadoc I can't find any such function.

Roopendra
  • 7,674
  • 16
  • 65
  • 92
zergylord
  • 4,368
  • 5
  • 38
  • 60

1 Answers1

2

Make sure that font/13-Nimbus.fnt is in your classpath. The way we've set it up it an assets source directory that contains font/etc.fnt

JeroenWarmerdam
  • 412
  • 2
  • 9
  • Thanks for the speedy response! That fixes the initial problem (no more error), but the text using the new font doesn't appear. Any chance this problem also has a quick solution? – zergylord Jan 18 '13 at 08:58
  • If you add the screen source, I might have time to look into it later today. – JeroenWarmerdam Jan 18 '13 at 09:23
  • Or the complete java source if you're building it there. – JeroenWarmerdam Jan 18 '13 at 10:40
  • I'd feel bad making you answer a different question in a comment, so I made a seperate question if your still interested: http://stackoverflow.com/q/14510730/821806 thanks again! – zergylord Jan 24 '13 at 21:06