Font to XML
Last updated
Last updated
We're going to be using to generate the necessary font files. It's a free, simple bitmap font generation website.
You'll have to specify which characters you want to include in your custom font.
This is done at the Glyphs
section in the top-left corner.
By default, there should be all the characters you'll need.
But it's crucial you get rid of the №
character, because it is not supported.
If you're going to be using any more characters, feel free to add them. But you can use only .
Head over to the Font
section, located right below Glyphs
.
Get a .ttf
or .otf
file (a font file), whether it's one of your own or one you found online.
Press ADD FONT FILE
, and select your font file.
Set Font Size
to your largest intended use case.
Try to avoid extreme size values like 500px unless absolutely necessary, as images have to be replicated from server to client.
Head over to the Fill
section, located in the top-right corner.
Set Color
to pure white (255, 255, 255, 100).
A pure white color will actually simply keep your original font color. If your font file is pure white too, you can be assured that the color you apply when rendering will be identical to the outcome.
Click Export
in the top bar.
Input a File Name
for your font.
For the Export Type
select one of the two BMFont XML
options.
Press Save
in the bottom-right corner of the pop-up.
It should save a .xml
(or .fnt
) and a .png
file.