

= Font Creator

This SDK plugin provides font support for jMonkeyEngine games. It creates AngelFont files from system fonts. Make sure you have the rights/license to use this font! You can link:https://www.google.com/search?q=free+fonts[search for and download free fonts] from many sites.



== Installation

If the plugin is installed, you see it under `Plugins → Installed`



image::jme3/external/install-font-plugin.png[install-font-plugin.png,with="450",height="275",align="center"]



(If you don't see it, go to `Tools → Plugins → Available Plugins` to install Font Creator.)



== Create Font

The following example creates the custom font `Orbitron.fnt` in the `assets/Interface/Fonts` directory.



image::jme3/external/font-1.png[font-1.png,with="",height="",align="center"]




image::jme3/external/font-2.png[font-2.png,with="",height="",align="center"]




image::jme3/external/font-3.png[font-3.png,with="",height="",align="center"]




image::jme3/external/font-4.png[font-4.png,with="",height="",align="center"]




image::jme3/external/font-5.png[font-5.png,with="",height="",align="center"]




== Use Font

The following example loads text in the custom font `Orbitron.fnt` from the `assets/Interface/Fonts` directory. You use `com.jme3.font.*` package to handle text on the screen. `guiNode` is a preconfigured node in any `SimpleApplication`-based game.


[source,java]

----

BitmapFont myFont = assetManager.loadFont("Interface/Fonts/Orbitron.fnt");
BitmapText hudText = new BitmapText(myFont, false);
hudText.setText("You can write any string here");
guiNode.attachChild(hudText);

----
<tags><tag target="gui" /><tag target="documentation" /><tag target="hud" /></tags>
