Bitmap Font in Godot 4: Import a BMFont and Keep It Sharp
Import a BMFont .fnt or a pixel TTF into Godot 4 and keep it sharp: the import options, the sizes that stay crisp, Nearest filtering and Label overrides.

You found a pixel font for your game, dropped it into Godot and set the Label to a size that looked about right. Now the letters are soft with grey edges, or some strokes are two pixels wide and others three. It looked fine at its own size, and the moment the text got bigger the dialogue box turned to mush.
A pixel font stays sharp in Godot 4 when three things agree: the font's import options, a font size that is a whole multiple of the font's pixel size, and the Nearest filter on whatever draws it. Below are the Godot 4.7.2 settings for both kinds of pixel font, and how the Pixel Font Previewer finds the crisp sizes before you set anything.
Bitmap font or TrueType pixel font
- A bitmap font is a picture of every letter plus a file that says where each one sits. The common format is AngelCode's BMFont: a
.fntfile and one or more PNG pages. It is made at one size, say 8 px, and every other size is a scaled copy of that picture. - A TrueType pixel font is an outline font whose shapes sit on a grid. It has a pixel size too: the size where one font pixel is one screen pixel. Gridwright Micro is drawn on a grid of 100 units in an em of 1,100, so its pixel size is 11 px.
Godot reads both into a FontFile resource, and only the import options differ.

Import a BMFont .fnt in Godot 4
- Put the
.fntand its PNG page in the same folder of your project. The.fntnames its page by file name, so keep that name. - Select the
.fntin the FileSystem dock and open the Import dock. Godot imports it as Font Data (AngelCode BMFont). - Set Scaling Mode to Enabled (Integer) and press Reimport.
Godot reads the text and binary .fnt formats. Avoid XML: in Godot 4.7.2 an XML .fnt imports with no error and comes out as an empty font.

Scaling Mode decides what happens when a Label asks for a size other than the font's Fixed Size, which Godot reads from the size in the .fnt:
- Disabled draws the font at its own size, whatever the Label asks for.
- Enabled (Integer) scales by whole steps only and rounds to the nearest one. With an 8 px font, sizes 12 to 19 all draw at 16 px (2x), and 20 draws at 24 px (3x).
- Enabled (Fractional) is the default and scales by any amount. At 20 px an 8 px font is scaled 2.5 times, so its pixels come out two or three screen pixels wide.
Antialiasing, hinting and subpixel positioning come in already off for a BMFont.
A PNG with the letters in a grid
If your font is one PNG with the letters in rows and no .fnt, select the PNG, change Import As to Font Data (Image Font), and fill in Columns, Rows and Character Ranges in the order the letters appear, such as 'A'-'Z' for a range or 65 for a single code. It has the same Scaling Mode option.
The texture filter
Godot draws 2D textures with the Linear filter by default, and a scaled bitmap font is a texture, so at 2x its pixels blend. In our Godot 4.7.2 test an 8 px BMFont at 16 px had no grey pixels with Nearest and 277 with the default Linear.
Set the filter once for the whole project in Project Settings > Rendering > Textures > Canvas Textures > Default Texture Filter: choose Nearest. Or set it per node under CanvasItem > Texture > Filter; children left on Inherit follow it.
Import a TrueType pixel font
A .ttf or .otf imports as Font Data (Dynamic Font). In Godot 4.7.2 its defaults are Antialiasing: Grayscale, Hinting: Light (Except Pixel Fonts) and Subpixel Positioning: Auto (Except Pixel Fonts). When the importer finds a pixel font it turns hinting and subpixel positioning off by itself; the Output panel says "Pixel font detected, disabling hinting." Antialiasing stays on. Select the font, set these, and press Reimport:
- Antialiasing: None
- Hinting: None
- Subpixel Positioning: Disabled
- Generate Mipmaps and Multichannel Signed Distance Field: both off, as they are by default
The size matters more than the settings
We drew one word in Gridwright Micro (pixel size 11) with Godot's default import. At 11, 22 and 33 px every pixel was fully lit or empty, even with the default smoothing on, because the outlines fell on whole pixels. At 16 px, 81 pixels came out grey. With Antialiasing set to None the grey went away at 16 px, but the strokes came out at uneven widths, since 16 isn't a multiple of 11.
So turn antialiasing off, then pick the size from the multiples: 11, 22, 33 for an 11 px font, and 8, 16, 24 for an 8 px font. Godot's own default font size is 16, which is a crisp size only for fonts made at 4, 8 or 16 px. If the font's readme doesn't give its pixel size, the previewer below reads it from the outlines.
Put the font on a Label
In the inspector, select the Label, open Theme Overrides > Fonts and drop the font on Font, then set Theme Overrides > Font Sizes > Font Size. For many Labels, share one LabelSettings resource with the font and size, or put the font in a Theme as its Default Font and Default Font Size. For the whole project, set Project Settings > GUI > Theme > Custom Font.
The same in code:
extends Label
const PIXEL_FONT := preload("res://fonts/my_font.fnt")
func _ready() -> void:
add_theme_font_override("font", PIXEL_FONT)
add_theme_font_size_override("font_size", 16) # 2x an 8 px font
texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
Load a font at run time
Fonts from a mod folder or the player's own files skip the import step. FontFile loads both kinds from a path:
func load_user_font(path: String) -> FontFile:
var font := FontFile.new()
if font.load_bitmap_font(path) != OK:
return null
font.fixed_size_scale_mode = TextServer.FIXED_SIZE_SCALE_INTEGER_ONLY
return font
func load_pixel_ttf(path: String) -> FontFile:
var font := FontFile.new()
if font.load_dynamic_font(path) != OK:
return null
font.antialiasing = TextServer.FONT_ANTIALIASING_NONE
font.hinting = TextServer.HINTING_NONE
font.subpixel_positioning = TextServer.SUBPIXEL_POSITIONING_DISABLED
return font
Set those properties yourself: a TTF loaded this way skips the importer's pixel-font check and starts with Grayscale antialiasing and Light hinting, and a BMFont starts with scaling disabled. We ran both, and the Label script, in Godot 4.7.2 and read every setting back.
The fast way: the Pixel Font Previewer
Guessing sizes means a reimport and a test run each time. The Pixel Font Previewer shows the crisp ones at once, in your browser, without uploading your font.
- Drop a font: a
.ttf,.otfor.woff, or a BMFont.fnttogether with its.png(text, XML or binary). Or open ours, Gridwright Micro. - Type your text or pick Dialogue, HUD, Menu or Title, then a size. 1x is the font's own pixel size, and 2x and up are its crisp sizes.
- Set the scene: a game screen from 320 x 180 to 640 x 360, a background, where the text sits, and a one-pixel shadow or outline.
- Compare. Your crisp text sits next to the three ways pixel text goes blurry: a size off the multiples, antialiasing at that size, and small text stretched with a smooth filter. The character table shows any letter of your text the font is missing.
- Download the ZIP.
Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.
Start: 3 days for $1 See everything it includesWhat is in the ZIP
- Your text and the game screen as PNGs, at 1x and zoomed.
- A Godot 4 folder:
font_preview.tscnwith your text on the same screen (open it and press F6), the font, and an.importfile with the settings above. An XML BMFont is rewritten there as a text.fnt. project_settings.txt: theproject.godotlines for a pixel-art window, with the Nearest filter, viewport stretch and integer scaling.- For a TrueType font, a BMFont of every character it has, as
.fnt,.xmland.png, at its pixel size and at the size you picked. - A README with the crisp sizes, the font's metrics and the settings for Godot, Unity, GameMaker, LOVE, Phaser and Ren'Py.
FAQ
Why is my BMFont sharp at its own size and blurry when bigger?
At its own size each font pixel is drawn one to one, so the filter has nothing to blend; scaled up, the default Linear filter blends them. Set the filter to Nearest and Scaling Mode to Enabled (Integer).
BMFont or TTF for a Godot game?
Both stay sharp with the settings above. A BMFont can't come out soft at any size once the filter is Nearest and scaling is whole-number. A TTF gives you every size from one file, but only its multiples are crisp.
Get crisp text in your game
Open the Pixel Font Previewer, drop your font and take a size from its crisp row. For stretch mode and integer scaling, see Godot pixel perfect settings. If you'd rather start from fonts that already come as TTF and BMFont, Pixel Fonts 2 has 12 pixel fonts with lowercase and accents, Gridwright Micro among them, and Pixel Fonts has 6 more, down to a tiny 3x5. The tool and both packs are part of Gridwright: 44 tools and 150 asset packs.
Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.
Start: 3 days for $1 See everything it includes