How To Make A Resource Pack III

Fonts

Understanding Fonts

Minecraft uses fonts to display text in-game, these fonts can be of two types: bitmap and ttf. Bitmap fonts are fonts that use image coordinates to display characters, ttf (TrueType Font) is a file type used by our OS to load fonts, being this last method the easiest and quickest.
The font specifications as well as .ttf files are both located in assets\minecraft\font\ while the textures used by bitmap fonts are located in assets\minecraft\textures\font\
Additionally, you can try out my fonts.json generator.

TTF

TrueType Fonts can be loaded into Minecraft by pasting the .ttf file in assets\minecraft\font\ and then creating a file named 'default.json' in the same location. In this file, we need to paste this basic template:
{
 "providers": [
  {
   "type": "ttf",
   "file": "minecraft:❬.ttf file name❭",
   "shift": [0, 0],
   "size": 11.0,
   "oversample": 2.0
  }
 ]
}

Now that we have the template is time to understand it:

  • The "type" attribute determines if our font is ttf or bitmap.
  • The "file" attribute determines what file is used as the font, which is always 'minecraft:name of the file'
  • The "shift" attribute determines the displacement of the font, the first value is horizontal and the second value is vertical.
  • The "size" attribute determines the size of the font in pixels, the default value is '11.0'.
  • The "oversample" attribute determines the resolution of your font, the default is '2.0'.

Bitmap

Bitmap fonts use images to display characters in game, this image must be pasted in assets\minecraft\textures\font\ and, the same way we did with the ttf font, we need to create a .json file in assets\minecraft\font\ named 'default.json'. In this file, we need to paste this basic template:
{
 "providers": [
  {
   "type": "bitmap",
   "file": "minecraft:font/❬image_name❭.png",
   "ascent": 0.0,
   "height": 8.0,
   "chars": [
    "❬unicode_character_code1❭❬unicode_character_code2❭❬unicode_character_code3❭",
    "❬unicode_character_code4❭❬unicode_character_code5❭❬unicode_character_code6❭"
   ]
  }
 ]
}

Now that we have the template is time to understand it:

  • The "type" attribute determines if our font is ttf or bitmap.
  • The "file" attribute determines what file is used as the font, which is always 'minecraft:/font/name of the file.png'
  • The "ascent" attribute determines the vertical displacement of the character.
  • The "height" attribute determines the height of the character in pixels, the default value is '8.0'.
  • The "chars" attribute determines the characters used by the font, all lines must have the same number of characters since the texture is divided into one equally sized row for each element. Each line must have a comma at the end except the last one. Unicode characters must follow this syntax: \uXXXX. (Complete list of unicode characters)