Pixel Art Font: Pixel Perfect Text in Godot 4 and Unity
Keep a pixel art font pixel perfect in Godot 4 at any window size: stretch mode, integer scaling and the font settings we tested in 4.7.2, plus Unity.

Your game runs at 320 x 180 and the sprites look clean. The dialogue looked clean too, until the window got bigger. On a 1366 x 768 laptop, or when a tester drags the window to a new size, the text goes grey at the edges and some letters come out a pixel wider than others, while the sprites next to it still look right.
A pixel art font stays pixel perfect when every font pixel becomes the same whole number of screen pixels. In Godot 4 that depends on the stretch mode, the scale mode and the font's own settings more than on the font. We tested each one in Godot 4.7.2 with a pixel TrueType font in a 320 x 180 game and counted the grey pixels in every frame. The numbers are below, and the Pixel Font Previewer shows a font's crisp sizes before you change anything.
What makes a font a pixel art font
A pixel art font is drawn on a grid, which gives it a pixel size: the size where one font pixel is one screen pixel. Gridwright Micro, the font we tested with, has a pixel size of 11. It is crisp at 11, 22 and 33 px; at any size between, its pixels get split and some come out wider than others.

Pick one from your base resolution, not your monitor:
- Letters per line: a 320 px screen with 8 px margins leaves 304 px, so a font 6 px wide per letter fits about 50 characters and one 8 px wide fits 38.
- HUD and dialogue: a 3 x 5 or 5 x 7 font fits a score counter; dialogue people read for minutes needs taller letters and lowercase.
- The letters you use: accents, quotes and the euro sign are the usual gaps.
Set the font size in game pixels
With a stretch mode on, Godot measures font sizes at your base resolution. In our test a Label with font_size 11 in a 320 x 180 game, shown in a 1280 x 720 window, drew every font pixel as an exact 4 x 4 block. So type the size in game pixels: the font's pixel size, or 2x or 3x of it.

Stretch mode: canvas_items or viewport
The setting is Project Settings > Display > Window > Stretch > Mode. It starts as disabled; the two that matter for pixel art are canvas_items and viewport.
- viewport draws the whole game at its base size and then scales the finished picture. Text pixels are game pixels, like everything else. In our test the frame Godot drew was 320 x 180 in both a 1280 x 720 and a 1120 x 630 window, with 0 grey pixels in the text.
- canvas_items draws everything at the window's size and draws the text again at the scaled size. At 4x (1280 x 720) we counted 0 grey pixels, and every run of lit pixels was 4, 8 or 12 px long. At 3.5x (1120 x 630) the same text had 714 grey pixels and runs of 3, 4, 6, 7 and 10 px. That was with antialiasing turned off on the font.
That is the blurry laptop: 1366 x 768 is 4.27 times 320 x 180, and no font setting makes 4.27 screen pixels per font pixel come out even.
Scale Mode: integer
Under the stretch mode is Scale Mode, fractional by default. Set it to integer and Godot scales only by whole steps, with bars around the rest. In our test the 1120 x 630 window then drew the game at 3x (960 x 540), and the grey pixels went from 714 to 0, with runs of 3, 6 and 9 px.
For a game that is pixel art all the way through, use viewport with integer: text and sprites can never disagree. If you need canvas_items, set the scale mode to integer anyway, since that is what fixed our text.
Leave oversampling on
In canvas_items mode Godot keeps text sharp by drawing the font again at the scaled size, which it calls oversampling. It is on by default: GUI > Fonts > Dynamic Fonts > Use Oversampling in the Project Settings and the viewport's own Oversampling property both start on.
With the viewport's oversampling off, our text at 4x had 19 fully lit pixels and 3,444 grey ones: the font was drawn at 11 px and stretched with Godot's default Linear filter. Setting Project Settings > Rendering > Textures > Canvas Textures > Default Texture Filter to Nearest brought back clean 4 x 4 blocks. Leave oversampling on and set the filter to Nearest anyway, since your sprites need it too.
Rendering > 2D > Snap > Snap 2D Transforms to Pixel and Snap 2D Vertices to Pixel start off. A Label we placed at x = 8.5 already drew from a whole game pixel in both stretch modes, and turning Snap 2D Transforms to Pixel on changed nothing in the text, so set them for your sprites.
The project font settings only touch Godot's own font
Project Settings > GUI > Theme > Custom Font sets one font for every Control. Next to it are Default Font Antialiasing, Hinting, Subpixel Positioning, Multichannel Signed Distance Field and Generate Mipmaps, which look like the place to make your pixel font sharp.
We set Custom Font to our pixel TTF and Default Font Antialiasing to None, and the font still came out with Grayscale antialiasing, the value from its own import. With no Custom Font, the same setting did switch Godot's built-in font to None. So those settings are for Godot's own font only. Yours are in its Import dock:
- Antialiasing: None (the import default is Grayscale)
- Hinting: None
- Subpixel Positioning: Disabled
- Multichannel Signed Distance Field and Generate Mipmaps: off, as they are by default
Then press Reimport. On import Godot printed "Pixel font detected, disabling hinting" and the same for subpixel positioning, but antialiasing stayed on Grayscale, so that one is up to you. For a BMFont .fnt, its Scaling Mode and per-Label overrides, see Bitmap font in Godot 4.
Pixel art font assets in Unity
In Unity the font becomes a TextMeshPro font asset, and the settings that keep it sharp are in the Font Asset Creator:
- Render Mode: RASTER or RASTER_HINTED.
- Sampling Point Size: a crisp size of the font, its pixel size or a multiple of it.
- Padding: 0.
- Generate the asset, then set the atlas texture's Filter Mode to Point.
Or use a BMFont of the font, which the previewer below makes from a TrueType font.
The fast way: the Pixel Font Previewer
All of the above starts with one number, the font's pixel size, and many font downloads don't say what it is. The Pixel Font Previewer reads it from the font's outlines and shows your text the way your game will draw it, in your browser, without uploading the font.
- Drop a font: a
.ttf,.otfor.woff, or a BMFont.fntwith its PNG (text, XML or binary). Or try 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.
- Pick the game screen, from 320 x 180 to 640 x 360, the background and where the text sits, and add a shadow or an outline of one font pixel.
- Compare your crisp text with 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 which letters of your text the font is missing.
- Download the ZIP: PNGs of the text and the screen, a Godot 4 scene with the font's antialiasing, hinting and subpixel positioning already off, a BMFont of a TrueType font, and a README with the crisp sizes and the settings for Godot, Unity, GameMaker, LOVE, Phaser and Ren'Py.
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 includesFAQ
Why is my pixel font sharp in the editor and blurry in fullscreen?
Your test window was a whole multiple of the base size, and the fullscreen one isn't. A 320 x 180 game on a 1920 x 1080 screen is exactly 6x, but on 1366 x 768 it is 4.27x. Set Scale Mode to integer.
What size should a pixel font be at 320 x 180?
Its pixel size or a whole multiple of it, typed as the font size in game pixels. For an 8 px font that is 8 or 16, never 12.
Do I need viewport mode for crisp text?
No. canvas_items with integer scaling was just as crisp in our test; viewport mode only makes it impossible to get wrong.
Put crisp text in your game
Open the Pixel Font Previewer, drop your font and take a size from its crisp row, then set the stretch mode and integer scaling above. For the rest of a pixel-art project's window settings, see Godot pixel perfect settings. If you want 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 3 x 5. 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