How to change the font of a Linux Console

Source: Internet
Author: User

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-F1ToF6The virtual terminal to be switched. PressCtrl+Alt+F7Switch 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.fbcatA 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.fbgrabIsfbcatIs used to generate a PNG file. Many people write too many versionsfbgrab. Each version has limited options and can only create full screen captures.

fbcatAnd 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:

  1. $ 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.

fbgrabYou can useman fbgrabThese options include screenshots of another console and delayed screenshots. As shown in the following example,fbgrabScreenshots andfbcatScreenshots are similar, but you do not need to explicitly repeat the output:

  1. $ 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-setupTo set the console font, and then runsetupconCommand to make the change take effect.setupconBelongconsole-setupPart 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-setupFile. 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.

  1. ACTIVE_CONSOLES="/dev/tty[1-6]"
  2. CHARMAP="UTF-8"
  3. CODESET="guess"
  4. FONTFACE="TerminusBold"
  5. FONTSIZE="16x32"
  6. SCREEN_WIDTH="80"

HereFONTFACEAndFONTSIZEThe value is from the font file name.TerminusBold32x16.psf.gz. Yes, you need to reverseFONTSIZEThe sequence of values. Computer is so funny. Then runsetupconTo make the new configuration take effect. AvailableshowconsolefontTo view all character sets of the current font. For more information about the complete options, seeman console-setup.

 

Systemd

Systemd andconsole-setupNot exactly. You don't need to install anything except the font. You only need to edit/etc/vconsole.confThen 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.confTo:

  1. KEYMAP="us"
  2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.