HD Fonts

_images/icon15.webp

The default font texture snippet.

File location

/assets/minecraft/optifine/font/**/*.{png,properties}

Danger

This feature is obsolete. Do not use it. Minecraft's font system has fixed the issues HD Fonts was created to resolve.
Characters outside the ASCII range are not supported.

HD Fonts can define custom widths for ASCII characters.

OptiFine first looks for fonts in the /assets/minecraft/optifine/font folder. This allows having a custom font that works in vanilla and a higher-resolution font that requires OptiFine to display properly.

To allow for more control over the widths of individual characters, OptiFine offers a way to specify them manually. Create a properties file corresponding to the font you want to customize.

Properties

width.<ascii>

Values: Integer, where <ascii> is a value from 0 to 255
Required

The width of the ASCII character.

blend

Values: Boolean
Optional

Whether to use alpha blending.

offsetBold

Values: Float
Optional

Horizontal offset by which to render the bold copy of a glyph.

JSON schema

Note

Although this page is .properties based, it can be mapped to JSON.

{
	"$schema": "http://json-schema.org/draft/2020-12/schema",
	"$id": "https://gitlab.com/whoatemybutter/optifinedocs/-/blob/master/schemas/hd_fonts.schema.json",
	"title": "HD Fonts",
	"description": "HD Fonts can define custom widths for characters.",
	"type": "object",
	"properties": {
		"blend": {
			"type": "boolean",
			"description": "Whether to use alpha blending.",
			"deprecated": true
		},
		"offsetBold": {
			"type": "number",
			"minimum": 0.0,
			"default": 1.0,
			"description": "Horizontal offset by which to render the bold copy of a glyph.",
			"deprecated": true
		}
	},
	"patternProperties": {
		"^width.(?:\\b(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})\\b\\s?)+$": {
			"type": "number",
			"minimum": 0,
			"maximum": 8,
			"description": "The width of a character.",
			"deprecated": true
		}
	},
	"additionalProperties": false,
	"deprecated": true
}

Assumes the latest OptiFine version.
Updated to commit dc7b4aca.

Last update: 2024 March 13