source: postlfs/config/console-fonts.xml@ 3f2db3a6

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 3f2db3a6 was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 18 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

  • Property mode set to 100644
File size: 9.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="postlfs-console-fonts" xreflabel="About Console Fonts">
9 <?dbhtml filename="console-fonts.html"?>
10
11
12 <title>About Console Fonts</title>
13
14 <indexterm zone="postlfs-console-fonts">
15 <primary sortas="a-console-fonts">console-fonts</primary>
16 </indexterm>
17
18 <para>
19 An LFS system can be used without a graphical desktop, and unless or until
20 you install <xref linkend="x-window-system"/> you will have to work in the
21 console. Most, if not all, PCs boot with an 8x16 font - whatever the actual
22 screen size. There are a few things you can do to alter the display on the
23 console. Most of them involve changing the font, but the first alters the
24 commandline used by grub.
25 </para>
26
27 <para condition="html" role="usernotes">User Notes:
28 <ulink url="&blfs-wiki;/aboutconsolefonts"/></para>
29
30 <sect2 id="grub-video">
31 <title>Setting a smaller screen size in grub</title>
32
33 <indexterm zone="postlfs-console-fonts grub-video">
34 <primary sortas="e-boot-grub-grub-cfg">/boot/grub/grub.cfg</primary>
35 </indexterm>
36
37 <para>
38 Modern screens often have a lot more pixels then the screens used in the
39 past. If your screen is 1600 pixels wide, an 8x16 font will give you 200
40 columns of text - unless your monitor is enormous, the text will be tiny.
41 One of the ways to work around this is to tell grub to use a smaller size,
42 such as 1024x768 or 800x600 or even 640x480. Even if your screen does not
43 have a 4:3 aspect ratio, this should work.
44 </para>
45
46 <para>
47 To try this, you can reboot and edit grub's command-line to insert a
48 'video=' parameter between the 'root=/dev/sdXn' and 'ro', for example
49 <literal>root=/dev/sda2 video=1024x768 ro</literal> based on the
50 example in LFS section 10.4.4 :
51 <ulink url="&lfs-root;/chapter10/grub.html"/>.
52 </para>
53
54 <para>
55 If you decide that you wish to do this, you can then (as the
56 <systemitem class="username">root</systemitem> user) edit
57 <filename>/boot/grub/grub.cfg</filename>.
58 </para>
59
60 </sect2>
61
62 <sect2 id="psf-fonts">
63 <title>Using the standard psf fonts</title>
64
65 <indexterm zone="postlfs-console-fonts psf-fonts">
66 <primary sortas="g-usr-share-consolefonts">/usr/share/consolefonts</primary>
67 </indexterm>
68
69 <para>
70 In LFS the <application>kbd</application> package is used. The fonts it
71 provides are PC Screen Fonts, usually called PSF, and they were installed
72 into <filename class="directory">/usr/share/consolefonts</filename>. Where
73 these include a unicode mapping table, the file suffix is often changed to
74 <literal>.psfu</literal> although packages such as
75 <application>terminus-font</application> (see below) do not add the 'u'.
76 These fonts are usually compressed with gzip to save space, but that is
77 not essential.
78 </para>
79
80 <para>
81 The initial PC text screens had 8 colours, or 16 colours if the bright
82 versions of the original 8 colours were used. A PSF font can include up
83 to 256 characters (technically, glyphs) while allowing 16 colours, or up
84 to 512 characters (in which case, the bright colours will not be
85 available). Clearly, these console fonts cannot be used to display CJK
86 text - that would need thousands of available glyphs.
87 </para>
88
89 <para>
90 Some fonts in <application>kbd</application> can cover more than 512
91 codepoints ('characters'), with varying degrees of fidelity: unicode
92 contains several whitespace codepoints which can all be mapped to a space,
93 varieties of dashes can be mapped to a minus sign, smart quotes can map to
94 the regular ASCII quotes rather than to whatever is used for "codepoint
95 not present or invalid", and those cyrillic or greek letters which look
96 like latin letters can be mapped onto them, so 'A' can also do duty for
97 cyrillic A and greek Alpha, and 'P' can also do duty for cyrillic ER and
98 greek RHO. Unfortunately, where a font has been created from a BDF file
99 (the method in terminus and debian's <ulink
100 url="https://packages.debian.org/jessie/utils/console-setup">console-setup
101 </ulink>) such mapping of additional codepoints onto an existing glyph is
102 not always done, although the terminus ter-vXXn fonts do this well.
103 </para>
104
105 <para>
106 There are over 120 combinations of font and size in
107 <application>kbd</application>: often a font is provided at several
108 character sizes, and sometimes varieties cover different subsets of
109 unicode. Most are 8 pixels wide, in heights from 8 to 16 pixels, but there
110 are a few which are 9 pixels wide, some others which are 12x22, and even
111 one (<filename>latarcyrheb-sun32.psfu</filename>) which has been scaled up
112 to 16x32. Using a bigger font is another way of making text on a large
113 screen easier to read.
114 </para>
115
116 </sect2>
117
118 <sect2 id="testing-fonts">
119 <title>Testing different fonts</title>
120
121 <para>
122 You can test fonts as a normal user. If you have a font which has not been
123 installed, you can load it with :
124 </para>
125
126<screen><userinput>setfont /path/to/yourfont.ext</userinput></screen>
127
128 <para>
129 For the fonts already installed you only need the name, so using
130 <filename>gr737a-9x16.psfu.gz</filename> as an example:
131 </para>
132
133<screen><userinput>setfont gr737a-9x16</userinput></screen>
134
135 <para>
136 To see the glyphs in the font, use:
137 </para>
138
139<screen><userinput>showconsolefont</userinput></screen>
140
141 <para>
142 If the font looks as if it might be useful, you can then go on to test it
143 more thoroughly.
144 </para>
145
146 <para>
147 When you find a font which you wish to use, as the
148 <systemitem class="username">root</systemitem> user) edit
149 <phrase revision="sysv">
150 <filename>/etc/sysconfig/console</filename> as described in
151 LFS section 9.6.5
152 <ulink url="&lfs-root;/chapter09/usage.html"/>.</phrase>
153 <phrase revision="systemd">
154 <filename>/etc/vconsole.conf</filename> as described in
155 LFS section 9.6
156 <ulink url="&lfs-root;/chapter09/console.html"/>.</phrase>.
157 </para>
158
159 <para>
160 For fonts not supplied with the <application>kbd</application> package
161 you will need to optionally compress it / them with
162 <command>gzip</command> and then install it / them as the
163 <systemitem class="username">root</systemitem> user.
164 </para>
165
166 </sect2>
167
168<!-- after that, psf-tools -->
169
170 <sect2 id="psf-tools">
171 <title>Editing fonts using psf-tools</title>
172
173 <indexterm zone="postlfs-console-fonts psf-tools">
174 <primary sortas="a-psftools">psftools</primary>
175 </indexterm>
176
177 <para>
178 Although some console fonts are created from BDF files, which is a text
179 format with hex values for the pixels in each row of the character, there
180 are more-modern tools available for editing psf fonts. The
181 <ulink url="https://www.seasip.info/Unix/PSF/">psftools</ulink> package
182 allows you to dump a font to a text representation with a dash for a
183 pixel which is off (black) and a hash for a pixel which is on (white).
184 You can then edit the text file to add more characters, or reshape them,
185 or map extra codepoints onto them, and then create a new psf font with
186 your changes.
187 </para>
188
189 </sect2>
190
191<!-- finally, link to terminus and link to it from above -->
192 <sect2 id="terminus-font">
193 <title>Using fonts from Terminus-font</title>
194
195 <indexterm zone="postlfs-console-fonts terminus-font">
196 <primary sortas="a-terminus-font">terminus-font</primary>
197 </indexterm>
198
199 <para>
200 The <ulink
201 url="http://terminus-font.sourceforge.net/">Terminus Font</ulink> package
202 provides fixed-width bitmap fonts designed for long (8 hours and more per
203 day) work with computers. Under 'Character variants' on that page is a
204 list of patches (in the <filename class="directory">alt/</filename>
205 directory). If you are using a graphical browser to look at that page, you
206 can see what the patches do, e.g. 'll2' makes 'l' more visibly different
207 from 'i' and '1'.
208 </para>
209
210 <para>
211 By default <application>terminus-fonts</application> will try to create
212 several types of font, and it will fail if <command>bdftopcf</command>
213 from <xref linkend="xorg7-app"/> has not been installed. The configure
214 script is only really useful if you go on to install
215 <emphasis>all</emphasis> the fonts (console and X11 bitmap) to the
216 correct directories, as in a distro. To build only the PSF fonts and
217 their dependencies, run:
218 </para>
219
220<screen><userinput>make psf</userinput></screen>
221
222 <para>
223 This will create more than 240 ter-*.psf fonts. The 'b' suffix indicates
224 bright, 'n' indicates normal. You can then test them to see if any fit
225 your requirements. Unless you are creating a distro, there seems little
226 point in installing them all.
227 </para>
228
229 <para>
230 As an example, to install the last of these fonts, you can gzip it and
231 then as the
232 <systemitem class="username">root</systemitem> user:
233 </para>
234
235<screen><userinput>install -v -m644 ter-v32n.psf.gz /usr/share/consolefonts</userinput></screen>
236
237 </sect2>
238
239
240<!-- then svn up, add changelog, do the propsets, create wiki page -->
241</sect1>
Note: See TracBrowser for help on using the repository browser.