LinuxCommandLibrary

setfont

Load console screen fonts for Linux TTYs

TLDR

Change the terminal font

$ setfont [font].gz
copy
Change font by specifying a full path
$ setfont /usr/share/kbd/consolefonts/[font.psf.gz]
copy
Double the font size
$ setfont -d
copy
Reset to the default font
$ setfont
copy
Save the current font before changing
$ setfont -o [saved_font] [new_font]
copy
Set font for a specific console
$ setfont -C /dev/tty2 [font]
copy

SYNOPSIS

setfont [OPTIONS] [font.new...] [-m cmap] [-u umap] [-C console]

DESCRIPTION

setfont loads console screen fonts into the EGA/VGA character generator for Linux virtual terminals (TTYs). It can load PSF (PC Screen Font) files and optionally associate Unicode mapping tables for proper character display.
Fonts are typically stored in /usr/share/kbd/consolefonts/ and come in various sizes (8x8, 8x14, 8x16). The command operates on the current console by default but can target specific TTYs with -C. When called without arguments, it loads a default 8x8 font.

PARAMETERS

-d, --double

Double the font size for high-density displays
-h N, --font-height N
Override font height (useful for partial fonts)
-o file
Save previous font to the specified file
-O file
Save previous font and Unicode map together
-om file
Store current console mapping table
-ou file
Save current Unicode mapping to file
-m file, --consolemap file
Load console map or Unicode console map
-u file, --unicodemap file
Load Unicode mapping table for the font
-C device, --console device
Set font on the specified console device
-f, --force
Force loading Unicode map even if empty
-R, --reset
Restore console to bootup defaults
-v, --verbose
Enable verbose output
-V, --version
Print version information

CAVEATS

Only works on Linux virtual consoles (TTYs), not in terminal emulators like xterm or GNOME Terminal. Requires appropriate permissions (typically root) to modify console settings. Font changes do not persist across reboots; configure in /etc/vconsole.conf for systemd systems or appropriate init scripts.

HISTORY

setfont is part of the kbd (keyboard and console utilities) package, which has been a standard Linux component since the early 1990s. The PSF font format was developed specifically for Linux console fonts. The command evolved from earlier utilities like loadfont and integrates Unicode support added in Linux 2.0 era.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community