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