How to change the font of a Linux Console
I try to keep my mind as peaceful as possible, but there are always some things that make me feel uncomfortable, for example, the console font is too small. Remember me, my friend, your eyes will degrade one day and you will not be able to see the small fonts you use when coding. Then you will regret it.
Fortunately, you can change the font of the console. According to Linux's consistent urine, the ever-changing Linux environment makes this problem not easy to understand, and there is no such thing as font Management in Linux, which makes it easy for us to get dizzy. In this article, I will show you the simplest way to change the font.
What is Linux console like?
First, let's clarify what we are talking about. When I mention the Linux console, I'm referring to the TTY1-6 that you use from the graphic environmentCtrl-Alt-F1
ToF6
The virtual terminal to be switched. PressCtrl+Alt+F7
Switch back to the graphic environment. (However, these hotkeys are no longer commonly used. Your Linux release may have different key mappings. The number of your TTY may be different, and your graph environment session may not beF7
. For example, the default graph session of Fedora isF2
, It only has one additional terminal inF1
.) I think it's cool to have both X sessions and terminal sessions.
The Linux console is part of the kernel and does not run in X sessions. It is the same as the console you use on headless servers without a graphic environment. I call the X terminal in a graphic session as a terminal, and the console and X terminal as a terminal simulator.
But this is not complete yet. Linux has been developing for a long time since the early ANSI era. Thanks to Linux framebuffer, it now supports Unicode and has limited support for graphics. In addition, there are many multimedia applications running on the console, which will be mentioned in future articles.
Console screenshot
The simplest way to get screenshots of the console is to run the console inside the VM. Then you can use the screen capture software on the host system. However, with fbcat and fbgrab, you can also take screenshots directly on the console.fbcat
A portable pixel PPM ing format (PPM) image will be created; this is a highly portable unzipped image format that can be read on all operating systems, of course, you can also convert it to any other format you like.fbgrab
Isfbcat
Is used to generate a PNG file. Many people write too many versionsfbgrab
. Each version has limited options and can only create full screen captures.
fbcat
And its output needs to be redirected to the file. You do not need to specify the file extension. You only need to enter the file name:
$ sudo fbcat >Pictures/myfile
After cropping in GIMP, Figure 1 is displayed.
Figure 1: view after Cropping
If you can fill in the blank space on the left, please let me know how to implement it in the message box.
fbgrab
You can useman fbgrab
These options include screenshots of another console and delayed screenshots. As shown in the following example,fbgrab
Screenshots andfbcat
Screenshots are similar, but you do not need to explicitly repeat the output:
$ sudo fbgrab Pictures/myOtherfile
Search for Fonts
As far as I know, apart from viewing the font storage directory/usr/share/consolefonts/
(Debian, etc ),/lib/kbd/consolefonts/
(Fedora ),/usr/share/kbd/consolefonts
(OpenSUSE) there are no other methods to List Installed fonts.
Change font
Readable fonts are not new concepts. We should respect our previous experiences! Readability is very important. Configurability is also very important, but now it is not very important.
On Debian/Ubuntu and other systems, you can runsudo dpkg-reconfigure console-setup
To set the console font, and then runsetupcon
Command to make the change take effect.setupcon
Belongconsole-setup
Part of the software package. If your Linux release does not contain this tool, you can download it from openSUSE.
You can also edit/etc/default/console-setup
File. In the following example, set the font to the 32-point Terminus Bold font, which is my favorite and strictly limits the width of the console to 80 columns.
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
CODESET="guess"
FONTFACE="TerminusBold"
FONTSIZE="16x32"
SCREEN_WIDTH="80"
HereFONTFACE
AndFONTSIZE
The value is from the font file name.TerminusBold32x16.psf.gz
. Yes, you need to reverseFONTSIZE
The sequence of values. Computer is so funny. Then runsetupcon
To make the new configuration take effect. Availableshowconsolefont
To view all character sets of the current font. For more information about the complete options, seeman console-setup
.
Systemd
Systemd andconsole-setup
Not exactly. You don't need to install anything except the font. You only need to edit/etc/vconsole.conf
Then restart. I installed some extra Terminus fonts in the Fedora and openSUSE systems, because the default font size is only 16 o'clock and I want 32 o'clock. Then/etc/vconsole.conf
To:
KEYMAP="us"
FONT="ter-v32b"
Next we will also learn some cool console tips and some multimedia applications running on the console.
Https://www.bkjia.com/Linux/2018-02/150953.htm