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