Linux change console font

Linux console

The Linux console is a system console internal to the Linux kernel. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports virtual consoles — consoles that are logically separate, but which access the same physical keyboard and display.

This article describes the basics of the Linux console and how to configure the font display. Keyboard configuration is described in the /Keyboard configuration subpage.

Contents

Implementation

This article or section needs expansion.

The console, unlike most services that interact directly with users, is implemented in the kernel. This contrasts with terminal emulation software, such as Xterm, which is implemented in user space as a normal application. The console has always been part of released Linux kernels, but has undergone changes in its history, most notably the transition to using the framebuffer and support for Unicode.

Despite many improvements in the console, its full backward compatibility with legacy hardware means it is limited compared to a graphical terminal emulator.

Virtual consoles

The console is presented to the user as a series of virtual consoles. These give the impression that several independent terminals are running concurrently; each virtual console can be logged in with different users, run its own shell and have its own font settings. The virtual consoles each use a device /dev/ttyX , and you can switch between them by pressing Alt+Fx (where x is equal to the virtual console number, beginning with 1). The device /dev/console is automatically mapped to the active virtual console.

Text mode

This article or section needs expansion.

Since Linux originally began as a kernel for PC hardware, the console was developed using standard IBM CGA/EGA/VGA graphics, which all PCs supported at the time. The graphics operated in VGA text mode, which provides a simple 80×25 character display with 16 colours. This legacy mode is similar to the capabilities of dedicated text terminals, such as the DEC VT100 series. It is still possible to boot in text mode if the system hardware supports it, but almost all modern distributions (including Arch Linux) use the framebuffer console instead.

Framebuffer console

As Linux was ported to other non-PC architectures, a better solution was required, since other architectures do not use VGA-compatible graphics adapters, and may not support text modes at all. The framebuffer console was implemented to provide a standard console across all platforms, and so presents the same VGA-style interface regardless of the underlying graphics hardware. As such, the Linux console is not a terminal emulator, but a terminal in its own right. It uses the terminal type linux , and is largely compatible with VT100.

Keyboard shortcuts

Keyboard Shortcut Description
Ctrl+Alt+Del Reboots the system (specified by the symlink /usr/lib/systemd/system/ctrl-alt-del.target )
Alt+F1 , F2 , F3 , . Switch to n-th virtual console
Alt+ ← Switch to previous virtual console
Alt+ → Switch to next virtual console
Scroll Lock When Scroll Lock is activated, input/output is locked
Ctrl+c Kills current task
Ctrl+d Inserts an EOF
Ctrl+z Pauses current Task
Читайте также:  Partition ssd windows 10

Fonts

This article or section needs expansion.

By default, the virtual console uses the kernel built-in font with a CP437 character set, [1] but this can be easily changed.

The Linux console uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called unimap, is needed. Nowadays most of the console fonts have the unimap built-in; historically, it had to be loaded separately.

The kbd package provides tools to change virtual console font and font mapping. Available fonts are saved in the /usr/share/kbd/consolefonts/ directory, those ending with .psfu or .psfu.gz have a Unicode translation map built-in.

Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of /usr/share/kbd/keymaps/ , see /Keyboard configuration for details.

Preview and temporary changes

shows a table of glyphs or letters of a font.

setfont temporarily change the font if passed a font name (in /usr/share/kbd/consolefonts/ ) such as

Font names are case-sensitive. With no parameter, setfont returns the console to the default font.

So to have a small 8×8 font, with that font installed like seen below, use e.g.:

To have a bigger font, the Terminus font ( terminus-font ) is available in many sizes, such as ter-132n which is large.

Источник

How to Change Console Fonts in Ubuntu Server

By default, Ubuntu server software is designed to run without a graphical environment. Therefore, a fresh installation of Ubuntu server can only be managed via a console (the black background and white text, and a command prompt – after successful login), but for some reason you might like to change the font on your console for better appearance.

In this article, we will show you how to change console fonts and font size on Ubuntu server.

The file console-setup specifies the encoding and the font as well as font size to be implemented by the setupcon program. This program sets up the font and keyboard on the console of the Ubuntu server.

The default font and font size on Ubuntu server console is normally VGA and 8X16 respectively, which does not really look nice (especially if you have developed a strong liking for gorgeous looking fonts on the terminal, like we have), as shown in the following screenshot.

Default Ubuntu Server Fonts

To change Ubuntu server console font, run the following command to reconfigure the console-setup file, this requires root privileges, so use the sudo command as shown.

Then choose the encoding to use on the console, you may leave the default, and press [Enter].

Choose Encoding in Ubuntu

Next, choose the character set to support, you may leave the default, and press [Enter] to continue.

Читайте также:  Intel pentium g4560 windows

Choose Character Set in Ubuntu

In this step, choose the font you want to use, for example we will use Fixed, so we will select it and press [Enter].

Choose Console Font in Ubuntu

Finally, choose the font size, and we have selected 8X18. Then press [Enter]. Your console font will now change and the system will apply the recent changes. Once everything is done, your command prompt should appear with text formated in the new font.

Choose Font Size in Ubuntu

The following screenshot shows the Ubuntu server console with the Fixed font type and font size of 8×18.

New Fonts in Ubuntu Server

For more information, see the console-setup and setupcon man pages.

That’s it! In this article, we have explained how to change console font and font size on Ubuntu server. To ask any questions, use the comment form below.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

How to Change Your Linux Console Fonts

I try to be a peaceful soul, but some things make that difficult, like tiny console fonts. Mark my words, friends, someday your eyes will be decrepit and you won’t be able to read those tiny fonts you coded into everything, and then you’ll be sorry, and I will laugh.

Fortunately, Linux fans, you can change your console fonts. As always, the ever-changing Linux landscape makes this less than straightforward, and font management on Linux is non-existent, so we’ll muddle along as best we can. In this article, I’ll show what I’ve found to be the easiest approach.

What is the Linux Console?

Let us first clarify what we’re talking about. When I say Linux console, I mean TTY1-6, the virtual terminals that you access from your graphical desktop with Ctrl+Alt+F1 through F6. To get back to your graphical environment, press Alt+F7. (This is no longer universal, however, and your Linux distribution may have it mapped differently. You may have more or fewer TTYs, and your graphical session may not be at F7. For example, Fedora puts the default graphical session at F2, and an extra one at F1.) I think it is amazingly cool that we can have both X and console sessions running at the same time.

The Linux console is part of the kernel, and does not run in an X session. This is the same console you use on headless servers that have no graphical environments. I call the terminals in a graphical session X terminals, and terminal emulators is my catch-all name for both console and X terminals.

But that’s not all. The Linux console has come a long way from the early ANSI days, and thanks to the Linux framebuffer, it has Unicode and limited graphics support. There are also a number of console multimedia applications that we will talk about in a future article.

Читайте также:  Windows 10 видна только панель задач

Console Screenshots

The easy way to get console screenshots is from inside a virtual machine. Then you can use your favorite graphical screen capture program from the host system. You may also make screen captures from your console with fbcat or fbgrab. fbcat creates a portable pixmap format (PPM) image; this is a highly portable uncompressed image format that should be readable on any operating system, and of course you can convert it to whatever format you want. fbgrab is a wrapper script to fbcat that creates a PNG file. There are multiple versions of fbgrab written by different people floating around. Both have limited options and make only a full-screen capture.

fbcat needs root permissions, and must redirect to a file. Do not specify a file extension, but only the filename:

After cropping in GIMP, I get Figure 1.

Figure 1: View after cropping.

It would be nice to have a little padding on the left margin, so if any of you excellent readers know how to do this, please tell us in the comments.

fbgrab has a few more options that you can read about in man fbgrab , such as capturing a different console, and time delay. This example makes a screen grab just like fbcat , except you don’t have to explicitly redirect:

Finding Fonts

As far as I know, there is no way to list your installed kernel fonts other than looking in the directories they are stored in: /usr/share/consolefonts/ (Debian/etc.), /lib/kbd/consolefonts/ (Fedora), /usr/share/kbd/consolefonts (openSUSE)…you get the idea.

Changing Fonts

Readable fonts are not a new concept. Embrace the old! Readability matters. And so does configurability, which sometimes gets lost in the rush to the new-shiny.

On Debian/Ubuntu/etc. systems you can run sudo dpkg-reconfigure console-setup to set your console font, then run the setupcon command in your console to activate the changes. setupcon is part of the console-setup package. If your Linux distribution doesn’t include it, there might be a package for you at openSUSE.

You can also edit /etc/default/console-setup directly. This example sets the Terminus Bold font at 32 points, which is my favorite, and restricts the width to 80 columns.

The FONTFACE and FONTSIZE values come from the font’s filename, TerminusBold32x16.psf.gz . Yes, you have to know to reverse the order for FONTSIZE. Computers are so much fun. Run setupcon to apply the new configuration. You can see the whole character set for your active font with showconsolefont . Refer to man console-setup for complete options.

Systemd

Systemd is different from console-setup , and you don’t need to install anything, except maybe some extra font packages. All you do is edit /etc/vconsole.conf and then reboot. On my Fedora and openSUSE systems I had to install some extra Terminus packages to get the larger sizes as the installed fonts only went up to 16 points, and I wanted 32. This is the contents of /etc/vconsole.conf on both systems:

Come back next week to learn some more cool console hacks, and some multimedia console applications.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

Источник

Оцените статью