1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "../docbook-xml/docbookx.dtd"
5 <!ENTITY % myents SYSTEM "../fvwm.ent" >
9 <!-- $Id: fonts.xml,v 1.4 2007/06/16 12:38:46 griph Exp $ -->
13 <section id='font_names_and_font_loading'>
14 <title>Font names and font loading</title>
15 <para>The fonts used for the text of a window title, icon titles, menus
16 and geometry window can be specified by using the Font and
17 IconFont <fvwmref cmd="Style"/>, the Font <fvwmref cmd="MenuStyle"/> and the <fvwmref cmd="DefaultFont"/>
18 commands. Also, all the Modules which use text have configuration
19 command(s) to specify font(s). All these styles and commands take
20 a font name as an argument. This section explains what is a font
21 name for fvwm and which fonts fvwm loads.</para>
23 <para>First, you can use what we can call a usual font name, for
27 -adobe-courier-bold-r-normal--10-100-75-75-m-60-ISO8859-1
28 -adobe-courier-bold-r-normal--10-*
29 -*-fixed-medium-o-normal--14-*-ISO8859-15
32 <para>That is, you can use an X Logical Font Description (XLFD for
33 short). Then the "first" font which matches the description is
34 loaded and used. This "first" font depends of your font path and
35 also of your locale. Fonts which match the locale charset are
36 loaded in priority order. For example with</para>
39 -adobe-courier-bold-r-normal--10-*
42 <para>if the locale charset is ISO8859-1, then fvwm tries to load a
43 font which matches</para>
46 -adobe-courier-bold-r-normal--10-*-ISO8859-1
49 <para>with the locale charset ISO8859-15 fvwm tries to load</para>
52 -adobe-courier-bold-r-normal--10-*-ISO8859-15.
56 <para>A font name can be given as an extended XLFD. This
57 is a comma separated list of (simple) XLFD font names, for example:</para>
60 -adobe-courier-bold-r-normal--14-*,-*-courier-medium-r-normal--14-*
63 <para>Each simple font name is tried until a matching font with the
64 locale charset is found and if this fails each simple font name is
65 tried without constraint on the charset.</para>
67 <para>More details on the XLFD can be found in the X manual page, the X
68 Logical Font Description Conventions document (called xlfd) and
69 the XLoadFont and XCreateFontSet manual pages. Some useful font
70 utilities are: xlsfonts, xfontsel, xfd and xset.</para>
72 <para>If you have Xft support you can specify an Xft font name
73 (description) of a true type (or Type1) font prefixed by "xft:",
78 "xft:Luxi Mono:Medium:Roman:size=14:encoding=iso8859-1"
81 <para>The "first" font which matches the description is loaded. This
82 first font depends on the XftConfig configuration file with Xft1
83 and on the /etc/fonts/fonts.conf file with Xft2.
84 One may read the Xft manual page and the fontconfig man page with
85 Xft2. The first string which follows "xft:" is always considered
86 as the family. With the second example Luxi Mono is the Family
87 (Other XFree TTF families: "Luxi Serif", "Luxi Sans"), Medium is
88 the Weight (other possible weights: Light, DemiBold, Bold, Black),
89 Roman is the slant or the style (other possibilities: Regular,
90 Oblique, Italic) size specifies the point size (for a pixel size
91 use pixelsize=), encoding allows for enforce a charset (iso8859-1
92 or iso10646-1 only; if no encoding is given the locale charset is
94 An important parameter is "minspace=bool" where bool is True or
95 False. If bool is False (the default?) Xft gives a greater font
96 height to fvwm than if bool is True. This may modify text
97 placement, icon and window title height, line spacing in menus and
98 <fvwmref mod="FvwmIdent"/>, button height in some fvwm modules ...etc. With a LCD
99 monitor you may try to add "rgba=mode" where mode is either rgb,
100 bgr, vrgb or vbgr to enable subpixel rendering. The best mode
101 depends on the way your LCD cells are arranged. You can pass other
102 specifications in between ":", as "foundry=foundry_name",
103 "spacing=type" where type can be monospace, proportional or
104 charcell, "charwidth=integer", "charheight=integer" or
105 "antialias=bool" where bool is True or False. It seems that these
106 parameters are not always taken in account.</para>
108 <para>To determine which Xft fonts are really loaded you can export
109 XFT_DEBUG=1 before starting fvwm and take a look to the error
110 log. With Xft2 you may use fc-list to list the available
111 fonts. Anyway, Xft support is experimental (from the X and the
112 fvwm point of view) and the quality of the rendering depends on
113 number of parameters (the XFree and the freetype versions and your
114 video card(s)).</para>
116 <para>After an Xft font name you can add after a ";" an XLFD
117 font name (simple or extended) as:</para>
120 xft:Verdana:pixelsize=14;-adobe-courier-bold-r-normal--14-*
123 <para>then, if either loading the Xft font fails or fvwm has no Xft
124 support, fvwm loads the font
125 "-adobe-courier-bold-r-normal--14-*". This allows for writing
126 portable configuration files.</para>
130 <section id='font_and_string_encoding'>
131 <title>Font and string encoding</title>
132 <para>Once a font is loaded, fvwm finds its encoding (or charset) using
133 its name (the last two fields of the name). fvwm assumes that the
134 strings which are displayed with this font use this encoding (an
135 exception is that if an iso10646-1 font is loaded, then UTF-8 is
136 assumed for string encoding).
137 In a normal situation,
138 (i) a font is loaded by giving a font name without specifying the
140 (ii) the encoding of the loaded font is the locale encoding, and
142 (iii) the strings in the fvwm configuration files should use the
143 locale encoding as well as the window and icon name. With Xft the
144 situation is bit different as Xft supports only iso10646-1 and
145 iso8859-1. If you do not specify one of these encodings in the Xft
146 font name, then fvwm does strings conversion using (iii). Note
147 that with multibyte fonts (and in particular with "CJK" fonts) for
148 good text rendering, the locale encoding should be the charset of
151 <para>To override the previous rules, it is possible to specify the
152 string encoding in the beginning of a font description as follow:</para>
155 StringEncoding=<replaceable>enc</replaceable>:_full_font_name_
159 <replaceable>enc</replaceable>
160 is an encoding supported by fvwm (usually font name charset plus some
161 unicode encodings: UTF-8, USC-2, USC-4 and UTF-16).</para>
163 <para>For example, you may use an iso8859-1 locale charset and have an
164 <fvwmref mod="FvwmForm"/> in Russian using koi8-r encoding. In this case, you just
165 have to ask <fvwmref mod="FvwmForm"/> to load a koi8-r font by specifying the
166 encoding in the font name. With a multibyte language, (as
167 multibyte font works well only if the locale encoding is the
168 charset of the font), you should use an iso10646-1 font:</para>
171 StringEncoding=jisx0208.1983-0:-*-fixed-medium-r-*-ja-*-iso10646-1
177 "StringEncoding=jisx0208.1983-0:xft:Bitstream Cyberbit"
181 <fvwmref mod="FvwmForm"/>
182 configuration uses jisx0208.1983-0 encoding. Another possibility
183 is to use UTF-8 encoding for your <fvwmref mod="FvwmForm"/> configuration and use
184 an iso10646-1 font:</para>
187 -*-fixed-medium-r-*-ja-*-iso10646-1
193 "StringEncoding=UTF-8:xft:Bitstream Cyberbit"
196 <para>or equivalently</para>
199 "xft:Bitstream Cyberbit:encoding=iso10646-1"
202 <para>In general iso10646-1 fonts together with UTF-8 string encoding
203 allows the display of any characters in a given menu, <fvwmref mod="FvwmForm"/>
206 <para>More and more, unicode is used and text files use UTF-8
207 encoding. However, in practice the characters used range over your
208 locale charset (this is the case when you generate a menu with
209 fvwm-menu-desktop with recent versions of <acronym>KDE</acronym> and
210 <acronym>GNOME</acronym>). For
211 saving memory (an iso10646-1 font may have a very large number of
212 characters) or because you have a pretty font without an
213 iso10646-1 charset, you can specify the string encoding to be
214 UTF-8 and use a font in the locale charset:</para>
217 StringEncoding=UTF-8:-*-pretty_font-*-12-*
221 <para>In most cases, fvwm correctly determines the encoding of the
222 font. However, some fonts do not end with valid encoding
223 names. When the font name isn't normal, for example:</para>
226 -misc-fixed-*--20-*-my_utf8-36
229 <para>you need to add the encoding after the font name using a slash as
230 a delimiter. For example:</para>
233 <fvwmref cmd="MenuStyle"/> * <fvwmref cmd="MenuStyle" opt="Font"/> -misc-fixed-*--20-*-my_utf8-36/iso10646-1
236 <para>If fvwm finds an encoding, fvwm uses the iconv system functions to
237 do conversion between encodings. Unfortunately, there are no
238 standards. For conversion between iso8859-1 and UTF-8: a GNU
239 system uses "ISO-8859-1" and other systems use "iso881" to define
240 the converters (these two names are supported by fvwm). Moreover,
241 in some cases it may be necessary to use machine specific
242 converters. So, if you experience problems you can try to get
243 information on your iconv implementation ("man iconv" may help)
244 and put the name which defines the converter between the font
245 encoding and UTF-8 at the end of the font name after the encoding
246 hint and a / (another possible solution is to use GNU
247 libiconv). For example use:</para>
250 <fvwmref cmd="Style"/> * <fvwmref cmd="Style" opt="Font"/> -misc-fixed-*--14-*-iso8859-1/*/latin1
253 <para>to use latin1 for defining the converter for the iso8859-1 encoding.
254 The "*" in between the "/" says to fvwm to determine the
255 encoding from the end of the font name. Use:</para>
258 <fvwmref cmd="Style"/> * <fvwmref cmd="Style" opt="Font"/> <literal output='man'>\
259 </literal>-misc-fixed-*--14-*-local8859-6/iso8859-6/local_iso8859_6_iconv
262 <para>to force fvwm to use the font with iso8859-6 as the encoding
263 (this is useful for bi-directionality)
264 and to use local_iso8859_6_iconv for defining the converters.</para>
268 <section id='font_shadow_effects'>
269 <title>Font Shadow Effects</title>
270 <para>Fonts can be given 3d effects. At the beginning of the font name
271 (or just after a possible StringEncoding specification) add</para>
274 Shadow=<replaceable>size</replaceable> <optional><replaceable>offset</replaceable></optional> <optional><replaceable>directions]</replaceable></optional>:
277 <para><replaceable>size</replaceable>
278 is a positive integer which specifies the number of pixels of shadow.
279 <replaceable>offset</replaceable>
280 is an optional positive integer which defines the number of pixels
281 to offset the shadow from the edge of the character. The default
283 <replaceable>directions</replaceable>
284 is an optional set of directions the shadow emanates from the
286 <replaceable>directions</replaceable>
287 are a space separated list of fvwm directions:</para>
289 <para><emphasis remap='I'>N</emphasis>, <emphasis remap='I'>North</emphasis>, <emphasis remap='I'>Top</emphasis>, <emphasis remap='I'>t</emphasis>, <emphasis remap='I'>Up</emphasis>, <emphasis remap='I'>u</emphasis>, <emphasis remap='I'>-</emphasis></para>
291 <para><emphasis remap='I'>E</emphasis>, <emphasis remap='I'>East</emphasis>, <emphasis remap='I'>Right</emphasis>, <emphasis remap='I'>r</emphasis>, <emphasis remap='I'>Right</emphasis>, <emphasis remap='I'>r</emphasis>, <emphasis remap='I'>]</emphasis></para>
293 <para><emphasis remap='I'>S</emphasis>, <emphasis remap='I'>South</emphasis>, <emphasis remap='I'>Bottom</emphasis>, <emphasis remap='I'>b</emphasis>, <emphasis remap='I'>Down</emphasis>, <emphasis remap='I'>d</emphasis>, <emphasis remap='I'>_</emphasis></para>
295 <para><emphasis remap='I'>W</emphasis>, <emphasis remap='I'>West</emphasis>, <emphasis remap='I'>Left</emphasis>, <emphasis remap='I'>l</emphasis>, <emphasis remap='I'>Left</emphasis>, <emphasis remap='I'>l</emphasis>, <emphasis remap='I'>[</emphasis></para>
297 <para><emphasis remap='I'>NE</emphasis>, <emphasis remap='I'>NorthEast</emphasis>, <emphasis remap='I'>TopRight</emphasis>, <emphasis remap='I'>tr</emphasis>, <emphasis remap='I'>UpRight</emphasis>, <emphasis remap='I'>ur</emphasis>, <emphasis remap='I'>^</emphasis></para>
299 <para><emphasis remap='I'>SE</emphasis>, <emphasis remap='I'>SouthEast</emphasis>, <emphasis remap='I'>BottomRight</emphasis>, <emphasis remap='I'>br</emphasis>, <emphasis remap='I'>DownRight</emphasis>, <emphasis remap='I'>dr</emphasis>, <emphasis remap='I'>></emphasis></para>
301 <para><emphasis remap='I'>SW</emphasis>, <emphasis remap='I'>SouthWest</emphasis>, <emphasis remap='I'>BottomLeft</emphasis>, <emphasis remap='I'>bl</emphasis>, <emphasis remap='I'>DownLeft</emphasis>, <emphasis remap='I'>dl</emphasis>, <emphasis remap='I'>v</emphasis></para>
303 <para><emphasis remap='I'>NW</emphasis>, <emphasis remap='I'>NorthWest</emphasis>, <emphasis remap='I'>TopLeft</emphasis>, <emphasis remap='I'>tl</emphasis>, <emphasis remap='I'>UpLeft</emphasis>, <emphasis remap='I'>ul</emphasis>, <emphasis remap='I'><</emphasis></para>
305 <para><emphasis remap='I'>C</emphasis>, <emphasis remap='I'>Center</emphasis>, <emphasis remap='I'>Centre</emphasis>, <emphasis>.</emphasis></para>
307 <para>A shadow is displayed in each given direction.
308 <emphasis remap='I'>All</emphasis>
309 is equivalent to all the directions. The default
310 <replaceable>direction</replaceable>
312 <emphasis remap='I'>BottomRight</emphasis>.
314 <emphasis remap='I'>Center</emphasis>
315 direction, the shadow surrounds the whole string. Since this is a
316 super set of all other directions, it is a waste of time to
317 specify this along with any other directions.</para>
319 <para>The shadow effect only works with colorsets. The color of the
320 shadow is defined by using the
321 <fvwmref cmd="Colorset" opt="fgsh"/>
323 <fvwmref cmd="Colorset"/>
324 command. Please refer to the
325 <fvwmref sect="colorsets" opt="colorsets" name="Colorsets"/>
326 section for details about colorsets.</para>
328 <para>Note: It can be difficult to find the font,
329 <fvwmref cmd="Colorset" opt="fg"/>, <fvwmref cmd="Colorset" opt="fgsh"/> and <fvwmref cmd="Colorset" opt="bg"/>
330 colors to make this effect look good, but it can look quite good.</para>