Add Fonts

how do i add fonts to nifty, the preview always breaks when i change the font name. i’ve added a Fonts folder in the Interface folder and loaded it with some fonts, but how do i get the xml file to read the fonts?

If you wanna apply the font as the default font, you have to set the nifty default font to your font. It will help you https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:nifty_gui_scenarios#design_your_own_styles.



If you wanna use that font for a specific component, a text for example, put the font attribute on it, and point it to your font.

1 Like

so without creating a new style, i can only aurulent-sans-16?

No you can convert any font you have to a jme font.

so how do i use a font that i created in the jme3 ide?

Most nifty elements have a “font” attribute. so you set font="/Interface/Fonts/MyFont.fnt" on some text element.

ah, thanks normen. i just didn’t add the interface part in the folder path.