1 <sect1 id="config-fonts-main">
2 <title>Dealing with Fonts</title>
4 <sect2 id="config-windows-fonts">
10 The <command>fnt2bdf</command> utility is included with
11 Wine. It can be found in the <filename>tools</filename>
12 directory. Links to the other tools mentioned in this
13 document can be found on wine headquarters:
14 <ulink url="http://www.winehq.org/development/">http://www.winehq.org/development/</ulink>
20 <title>How To Convert Windows Fonts</title>
22 If you have access to a Windows installation you should use the
23 <command>fnt2bdf</command> utility (found in the
24 <filename>tools</filename> directory) to convert bitmap
25 fonts (<filename>VGASYS.FON</filename>,
26 <filename>SSERIFE.FON</filename>, and
27 <filename>SERIFE.FON</filename>) into the format that the X
28 Window System can recognize.
34 Extract bitmap fonts with <command>fnt2bdf</command>.
39 Convert <filename>.bdf</filename> files produced by Step
40 1 into <filename>.pcf</filename> files with
41 <command>bdftopcf</command>.
46 Copy <filename>.pcf</filename> files to the font server
47 directory which is usually
48 <filename>/usr/lib/X11/fonts/misc</filename> (you will
49 probably need superuser privileges). If you want to
50 create a new font directory you will need to add it to
56 Run <command>mkfontdir</command> for the directory you
57 copied fonts to. If you are already in X you should run
58 <command>xset fp rehash</command> to make X server aware
59 of the new fonts. You may also or instead have to restart
60 the font server (using e.g.
61 <command>/etc/init.d/xfs restart</command>
67 Edit the <filename>~/.wine/config</filename> file to remove
68 aliases for the fonts you've just installed.
73 Wine can get by without these fonts but 'the look and feel'
74 may be quite different. Also, some applications try to load
75 their custom fonts on the fly (WinWord 6.0) and since Wine
76 does not implement this yet it instead prints out something
80 STUB: AddFontResource( SOMEFILE.FON )
83 You can convert this file too. Note that
84 <filename>.FON</filename> file may not hold any bitmap
85 fonts and <command>fnt2bdf</command> will fail if this is
86 the case. Also note that although the above message will not
87 disappear Wine will work around the problem by using the
88 font you extracted from the
89 <filename>SOMEFILE.FON</filename>.
90 <command>fnt2bdf</command> will only work for Windows 3.1
91 fonts. It will not work for TrueType fonts.
94 What to do with TrueType fonts? There are several commercial
95 font tools that can convert them to the Type1 format but the
96 quality of the resulting fonts is far from stellar. The
97 other way to use them is to get a font server capable of
98 rendering TrueType (Caldera has one, there also is the free
99 <command>xfstt</command> in
100 <filename>Linux/X11/fonts</filename> on sunsite and mirrors,
101 if you're on FreeBSD you can use the port in
102 <filename>/usr/ports/x11-servers/Xfstt</filename>. And
103 there is <command>xfsft</command> which uses the freetype
104 library, see <link linkend="ttfont-server">freetype</link>
108 However, there is a possibility of the native TrueType
109 support via FreeType renderer in the future (hint, hint :-)
114 <title>How To Add Font Aliases To <filename>~/.wine/config</filename></title>
116 Many Windows applications assume that fonts included in
117 original Windows 3.1 distribution are always present. By
118 default Wine creates a number of aliases that map them on
119 the existing X fonts:
126 <entry>Windows font</entry>
127 <entry>...is mapped to...</entry>
128 <entry>X font</entry>
133 <entry>"MS Sans Serif"</entry>
134 <entry align="center">-></entry>
135 <entry>"-adobe-helvetica-"</entry>
138 <entry>"MS Serif"</entry>
139 <entry align="center">-></entry>
140 <entry>"-bitstream-charter-"</entry>
143 <entry>"Times New Roman"</entry>
144 <entry align="center">-></entry>
145 <entry>"-adobe-times-"</entry>
148 <entry>"Arial"</entry>
149 <entry align="center">-></entry>
150 <entry>"-adobe-helvetica-"</entry>
157 There is no default alias for the "System" font. Also, no
158 aliases are created for the fonts that applications install
159 at runtime. The recommended way to deal with this problem
160 is to convert the missing font (see above). If it proves
161 impossible, like in the case with TrueType fonts, you can
162 force the font mapper to choose a closely related X font by
163 adding an alias to the [fonts] section. Make sure that the
164 X font actually exists (with <command>xfontsel</command>
168 AliasN = [Windows font], [X font] <, optional "mask X font" flag>
174 Alias0 = System, --international-, subst
184 There must be no gaps in the sequence <literal>{0, ...,
185 N}</literal> otherwise all aliases after the first gap
191 Usually font mapper translates X font names into font
192 names visible to Windows programs in the following
200 <entry>X font</entry>
201 <entry>...will show up as...</entry>
202 <entry>Extracted name</entry>
207 <entry>--international-...</entry>
208 <entry align="center">-></entry>
209 <entry>"International"</entry>
212 <entry>-adobe-helvetica-...</entry>
213 <entry align="center">-></entry>
214 <entry>"Helvetica"</entry>
217 <entry>-adobe-utopia-...</entry>
218 <entry align="center">-></entry>
219 <entry>"Utopia"</entry>
222 <entry>-misc-fixed-...</entry>
223 <entry align="center">-></entry>
224 <entry>"Fixed"</entry>
228 <entry align="center">-></entry>
232 <entry>-sony-fixed-...</entry>
233 <entry align="center">-></entry>
234 <entry>"Sony Fixed"</entry>
238 <entry align="center">-></entry>
246 Note that since <literal>-misc-fixed-</literal> and
247 <literal>-sony-fixed-</literal> are different fonts Wine
248 modified the second extracted name to make sure Windows
249 programs can distinguish them because only extracted
250 names appear in the font selection dialogs.
255 "Masking" alias replaces the original extracted name so
256 that in the example case we will have the following
263 <entry>X font</entry>
264 <entry>...is masked to...</entry>
265 <entry>Extracted name</entry>
270 <entry>--international-...</entry>
271 <entry align="center">-></entry>
272 <entry>"System"</entry>
278 "Nonmasking" aliases are transparent to the user and
279 they do not replace extracted names.
282 Wine discards an alias when it sees that the native X
288 If you do not have access to Windows fonts mentioned in
289 the first paragraph you should try to substitute the
290 "System" font with nonmasking alias. The
291 <command>xfontsel</command> application will show you
292 the fonts available to X.
295 Alias.. = System, ...bold font without serifs
300 Also, some Windows applications request fonts without
301 specifying the typeface name of the font. Font table starts
302 with Arial in most Windows installations, however X font
303 table starts with whatever is the first line in the
304 <filename>fonts.dir</filename>. Therefore Wine uses the
305 following entry to determine which font to check first.
311 Default = -adobe-times-
317 It is better to have a scalable font family (bolds and
318 italics included) as the default choice because mapper
319 checks all available fonts until requested height and other
320 attributes match perfectly or the end of the font table is
321 reached. Typical X installations have scalable fonts in the
322 <filename>../fonts/Type1</filename> and
323 <filename>../fonts/Speedo</filename> directories.
328 <title>How To Manage Cached Font Metrics</title>
330 Wine stores detailed information about available fonts in
331 the <filename>~/.wine/cachedmetrics.[display]</filename> file. You
332 can copy it elsewhere and add this entry to the [fonts]
333 section in your <filename>~/.wine/config</filename>:
336 FontMetrics = <file with metrics>
339 If Wine detects changes in the X font configuration it will
340 rebuild font metrics from scratch and then it will overwrite
341 <filename>~/.wine/cachedmetrics.[display]</filename> with the new
342 information. This process can take a while.
347 <title>Too Small Or Too Large Fonts</title>
349 Windows programs may ask Wine to render a font with the
350 height specified in points. However, point-to-pixel ratio
351 depends on the real physical size of your display (15",
352 17", etc...). X tries to provide an estimate of that but it
353 can be quite different from the actual size. You can change
354 this ratio by adding the following entry to the [fonts]
358 Resolution = <integer value>
361 In general, higher numbers give you larger fonts. Try to
362 experiment with values in the 60 - 120 range. 96 is a good
368 <title>"FONT_Init: failed to load ..." Messages On Startup</title>
370 The most likely cause is a broken
371 <filename>fonts.dir</filename> file in one of your font
372 directories. You need to rerun <command>mkfontdir</command>
373 to rebuild this file. Read its manpage for more information.
374 If you can't run <command>mkfontdir</command> on this
375 machine as you are not root, use <command>xset -fp
376 xxx</command> to remove the broken font path.
381 <sect2 id="ttfont-server">
382 <title>Setting up a TrueType Font Server</title>
384 Follow these instructions to set up a TrueType font server on your system.
390 Get a freetype source archive (<filename>freetype-X.Y.tar.gz</filename> ?).
395 Read docs, unpack, configure and install
400 Test the library, e.g. <command>ftview 20 /dosc/win95/fonts/times</command>
405 Get <filename>xfsft-beta1e.linux-i586</filename>
410 Install it and start it when booting, e.g. in an
411 rc-script. The manpage for <command>xfs</command>
417 Follow the hints given by <email>williamc@dai.ed.ac.uk</email>
422 I got <command>xfsft</command> from
423 <ulink url="http://www.dcs.ed.ac.uk/home/jec/progindex.html">http://www.dcs.ed.ac.uk/home/jec/progindex.html</ulink>.
424 I have it running all the time. Here is
425 <filename>/usr/X11R6/lib/X11/fs/config</filename>:
430 catalogue = /c/windows/fonts
431 error-file = /usr/X11R6/lib/X11/fs/fs-errors
432 default-point-size = 120
433 default-resolutions = 75,75,100,100
436 Obviously <filename>/c/windows/fonts</filename> is where
437 my Windows fonts on my Win95 <medialabel>C:</medialabel>
438 drive live; could be e.g.
439 <filename>/mnt/dosC/windows/system</filename> for Win31.
442 In <filename>/c/windows/fonts/fonts.scale</filename> I
447 arial.ttf -monotype-arial-medium-r-normal--0-0-0-0-p-0-iso8859-1
448 arialbd.ttf -monotype-arial-bold-r-normal--0-0-0-0-p-0-iso8859-1
449 arialbi.ttf -monotype-arial-bold-o-normal--0-0-0-0-p-0-iso8859-1
450 ariali.ttf -monotype-arial-medium-o-normal--0-0-0-0-p-0-iso8859-1
451 cour.ttf -monotype-courier-medium-r-normal--0-0-0-0-p-0-iso8859-1
452 courbd.ttf -monotype-courier-bold-r-normal--0-0-0-0-p-0-iso8859-1
453 courbi.ttf -monotype-courier-bold-o-normal--0-0-0-0-p-0-iso8859-1
454 couri.ttf -monotype-courier-medium-o-normal--0-0-0-0-p-0-iso8859-1
455 times.ttf -monotype-times-medium-r-normal--0-0-0-0-p-0-iso8859-1
456 timesbd.ttf -monotype-times-bold-r-normal--0-0-0-0-p-0-iso8859-1
457 timesbi.ttf -monotype-times-bold-i-normal--0-0-0-0-p-0-iso8859-1
458 timesi.ttf -monotype-times-medium-i-normal--0-0-0-0-p-0-iso8859-1
459 symbol.ttf -monotype-symbol-medium-r-normal--0-0-0-0-p-0-microsoft-symbol
460 wingding.ttf -microsoft-wingdings-medium-r-normal--0-0-0-0-p-0-microsoft-symbol
463 In <filename>/c/windows/fonts/fonts.dir</filename> I have
467 In <filename>/usr/X11R6/lib/X11/XF86Config</filename> I have
470 FontPath "tcp/localhost:7100"
473 in front of the other <literal>FontPath</literal> lines.
474 That's it! As an interesting by-product of course, all
475 those web pages which specify Arial come up in Arial in
481 Shut down X and restart (and debug errors you did while
482 setting up everything).
487 Test with e.g. <command>xlsfont | grep arial</command>
496 <!-- Keep this comment at the end of the file
499 sgml-parent-document:("wine-user.sgml" "set" "book" "chapter" "")