← 返回命令列表

Linux command

setfont 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Change

setfont [font].gz

Example

setfont /usr/share/kbd/consolefonts/[font.psf.gz]

Double

setfont -d

Reset

setfont

Save

setfont -o [saved_font] [new_font]

Example

setfont -C /dev/tty2 [font]

说明

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.

参数

-d, --double
Double the font size for high-density displays.
-h _N_, --font-height _N_
Override font height (useful for partial fonts).
-N, --default8x=_N_
Load the built-in default font of width _N_ (8xN).
-o _file_, --output-font=_file_
Save the previous font to _file_ before loading the new one.
-O _file_, --output-fullfont=_file_
Save the previous font together with its Unicode map to _file_.
-om _file_, --output-consolemap=_file_
Save the current console mapping table to _file_.
-ou _file_, --output-unicodemap=_file_
Save the current Unicode mapping table to _file_.
-m _file_, --consolemap=_file_
Load console map or Unicode console map from _file_.
-u _file_, --unicodemap=_file_
Load the Unicode mapping table that describes the font.
-C _device_, --console=_device_
Set the font on the specified console device.
-f, --force
Force-load the Unicode map even if it is empty.
-R, --reset
Restore the console font, size, and Unicode mapping to boot-up defaults.
-v, --verbose
Enable verbose output.
-V, --version
Print version and exit.

FAQ

What is the setfont command used for?

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.

How do I run a basic setfont example?

Run `setfont [font].gz` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --double do in setfont?

Double the font size for high-density displays.