This page goes into fonts, specifically on how to create, setup, split and use fonts in a vanilla resource pack. Remember as always to check out the resources.
Modifying and adding your own fonts is really simple, but has a lot of tiny details that could go wrong resulting in your unicode showing up as □. If it does, something in the configuration went wrong and must be tweaked.
If you’re stuck with □, check out the debugging page here:
<aside> 📚 Content:
In this guide we will be modifying the default font default.json
, but everything here applies to custom fonts as well.
We start off with an empty list of providers like this:
{
"providers":[
]
}
Providers are objects that override given unicodes, allowing us to bind custom textures to them. The structure of a “bitmap” font provider looks like this:
{
"type":"bitmap",
"file":"texture.png",
"ascent":8,
"height":9,
"chars":[
"A"
]
}
All of the properties are explained on the Minecraft Wiki in detail, but we’ll go over the things we need from them. The only “type” we’ll ever need while working with advanced fonts will be the “bitmap” type, which refers to the texture structure, in which textures are defined like this:
“file” is the path to the texture, which can be anywhere inside of assets/.../textures
Before the name of the texture, you can specify a namespace with the default being minecraft
(because assets/minecraft
is the default namespace). If you wish to separate your own textures from the textures inside the default folder, you do so by creating a folder assets/namespace/textures
and moving your textures there.
(After the .../textures
part, you can create any folders you want, like .../textures/furniture
or .../textures/myitems
). Then define that path in “file” as namespace:folder/texture.png
“ascent” is an important property, as it is the only way, you can move your texture vertically (horizontal movement is achieved with negative space symbols, explained here). Making smaller will shift the texture down and bigger will shift the texture up. Note that the value of the ascent cannot be larger than the height of the texture, which is why for higher vertical shift you may want to have either a larger texture or display the text elsewhere (action bar, boss bar, scoreboard etc.)