to create fonts for your jME3 applications and NiftyGUI interfaces I now added a font creator to jMP. Just select a project and press “New File”, then select “GUI” -> “Font”, you will be presented with a list of all fonts installed on your computer:
After selecting a font you can configure the bitmap and font size to fit the font to the image:
When pressing “Finish” a PNG and FNT file will be created in the Interface/Fonts/ assets directory, you can use the font e.g. in NiftyGUI by specifying e.g. font=”Interface/Fonts/Arial.fnt” in a nifty text tag.
Available in the nightly update center, you have to install the plugin manually.
Work in progress, please tell me about any problems you encounter. I also don’t know what all of the parameters in the fnt file really do, if you see errors or problems, please give me a note.
any future plan about adding features like color, gradient, outline, shadow like “Hiero”?
Should be easy, just look at the code, post the patch files in the contribution forum :P Color is variable through text support in jme.
Selection of the basic font styles (plain, italic, bold) has been added (will only be available in the next nightly though).
P.S. Creasy, I saw your post :P Its really easy jMP code, if you want to take a whack at it, theres docs on how to build the sdk and change stuff in the wiki.
I was create font with Cyirilic symbols, load them:
String text = "TEST test ТЕСТ тест …\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 …";
BitmapFont myFont = assetManager.loadFont("Interface/Fonts/CyrillicRibbon.fnt");
BitmapText hudText = new BitmapText(myFont, false);
hudText.setSize(myFont.getCharSet().getRenderedSize()); // font size
hudText.setText(text); // the text
hudText.setLocalTranslation(200, hudText.getLineHeight(), 0); // position
All Cyrillic symbols was not shown.
This is a great tool!
If I have some time, I may take a look at the source code. But in the meanwhile, here are my thoughts about features and tweaks :
- calculate image size automatically (or replace image size by a bpp combo box) for optimal size.
- optionally let the user enter the desired characters in a text field (use default character set, or a custom one)
- add a charset encoding drop-down list to select the encoding to use when generating the font
- add a final step : Set font name
1) doesn’t really make sense, there is no “ideal” image size. That parameter is left in deliberately.
2) the character sets are defined as per the normal definitions, atm only ASCII is supported. support for UTF-8 etc. can and will be added at some point but not for random chatacter combinations
3) see 2)
4) see @nehon‘s answer
You must be logged in to reply to this topic.