Linux setup 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

Fonts

This article or section needs expansion.

Читайте также:  Как установить windows с образа wim

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.

Источник

Как изменить шрифт в консоли?

По дефолту шрифт в консоли не отображает кириллицу. Проблема решается вызовом setfont:

Но после перезагрузки, естественно, слетает.
Каким образом можно установить шрифт перманентно?

P.S. Речь идёт о консоли на tty*, а не в DE.

Ubuntu Wily Werewolf.
Такая же ерунда была и в Vivid Vervet и, по-моему, в Trusty.

Смотри в сторону /etc/vconsole.conf и systemd-vconsole-setup.service

/etc/vconsole.conf — нет такого.

Такое можешь сделать?

Пробовал через dpkg-reconfigure console-setup.

Говорит, что после перезагрузки все будет хорошо:

Your console font configuration will be updated the next time your system boots. If you want to update it now, run ‘setupcon’ from a virtual console.

Но по факту, пока не вызовешь setupcon шрифты старые.

Выше сообщением ответил. Пока не вызовешь вручную setupcon шрифты не применяются. Такое же поведение было и в Vivid.

Я так понимаю, для этого должен присутствовать /usr/lib/systemd/systemd-vconsole-setup, а его нет.

Шамань над vconsole.conf и systemd-vconsole. На лоре тема была кстати, там чел всё ненужное из systemd-vconsole-setup.service выпилил

Полазал по форумам, похоже, что дело в этом:

systemctl status systemd-vconsole-setup.service
● systemd-vconsole-setup.service — Setup Virtual Console
Loaded: loaded (/lib/systemd/system/systemd-vconsole-setup.service; static; vendor preset: enabled)
Active: active (exited) since Чт. 2015-09-10 16:35:23 MSK; 13min ago
Process: 335 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 335 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/systemd-vconsole-setup.service

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

А должно быть: ExecStart=/bin/setupcon

Да, помогло. Всем спасибо.

1. dpkg-reconfigure console-setup и выбор соответствующих шрифтов;
2. В файле /lib/systemd/system/systemd-vconsole-setup.service заменить ExecStart=/bin/true на ExecStart=/bin/setupcon.

Первое же обновление потрет фикс. Надо в /etc/systemd/system скопировать и его уже править.

Источник

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.

Читайте также:  Куда можно установить windows

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.

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.

Читайте также:  Восстановление xbox windows 10

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.

Источник

Можно ли изменить шрифт консоли текстового режима?

У меня установлена ​​Unix-подобная ОС без оконной среды; т.е. просто консоль в текстовом режиме и без графического интерфейса.

Можно ли изменить шрифт, используемый консолью?

Чтобы было ясно, я не говорю об эмуляторе терминала, который поставляется с окружением рабочего стола, таким как KDE или GNOME.

Если вы используете консоль Linux, лучший способ, который я нашел, это:

Другой способ заключается в использовании setfont из kbd пакета:

Это работает для моего Debian; это может отличаться для вас.

В Debian вы также можете запускать dpkg-reconfigure -plow console-setup запрос на различные настройки консоли и выбирать их из меню.

Редактировать — я собрал небольшую страницу, как настроить цвета шрифта . Раздел, относящийся к этому сообщению, имеет заголовок «Linux VT» (= ttys или «console»).

Если вы хотите использовать практически любой X-совместимый шрифт, вам стоит взглянуть на работу Дэвида Херрмана kmscon . Название слегка противоречит проекту, поскольку настройка режима ядра не обязательна для его работы — он также работает с устройствами с кадровым буфером — например, если вы используете проприетарные драйверы дисплея AMD или nvidia. С kmscon вы получаете мультиместное управление сеансами, xterm как клавиатура и UTF-8 обработки шрифтов и управление сеансами. Изменение шрифта может быть сделано с помощью /etc/kmscon/kmscon.conf или через параметр командной строки.

/etc/default/console-setup и другие. были заменены в операционных системах systemd, хотя вы обнаружите, что некоторые операционные системы, такие как Debian, пытаются поддерживать более старую конфигурационную систему.

Способ сделать это в операционной системе systemd — отредактировать настройки шрифта в /etc/vconsole.conf файле. Эти параметры применяются systemd-vconsole-setup службой, которая по сути является прославленным способом запуска setfont и loadkeys до запуска служб входа в систему.

Так что вы бы FONT=Uni2-Terminus28x14 в этом файле, например.

Обратите внимание, что служебная программа позволяет параметрам командной строки ядра, например, vconsole.font переопределять /etc/vconsole.conf содержимое. Если вы возитесь с опциями командной строки ядра GRUB, помните об этом.

дальнейшее чтение

  • Поттеринг и др .. vconsole.conf . Системные справочные страницы. FreeDesktop.org.
  • Поттеринг и др .. systemd-vconsole-setup . Системные справочные страницы. FreeDesktop.org.
  • Настройка шрифта консоли в vconsole.conf не работает (systemd)
  • https://unix.stackexchange.com/a/326804/5132

Используя Ubuntu 16.04 (вероятно, работает во всех поддерживаемых версиях), я отредактировал

/.bashrc и перед самым всплыванием терминала в конце файла вставил setfont команду:

Теперь при выборе Ctrl + Alt + F1 через Ctrl + Alt + F6 и получить хорошие большие шрифты.

Это самый большой из доступных шрифтов, и вы можете увидеть полный список с помощью ls команды:

Образец экрана

Это факсимиле, а не настоящий снимок экрана с консоли, где экран шире на 20%, а фон черный:

До изменений я не мог прочитать экран на мониторе HDPI.

Источник

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