1 <sect1 id="config-fonts-main">
2 <title>Dealing with Fonts</title>
4 <sect2 id="config-windows-fonts">
8 Written by &name-alex-korobka; <email>&email-alex-korobka;</email>
11 (Extracted from <filename>wine/documentation/fonts</filename>)
17 The <command>fnt2bdf</command> utility is included with
18 Wine. It can be found in the <filename>tools</filename>
19 directory. Links to the other tools mentioned in this
20 document can be found on wine headquarters:
21 <ulink url="http://www.winehq.com/development/">http://www.winehq.com/development/</ulink>
27 <title>How To Convert Windows Fonts</title>
29 If you have access to a Windows installation you should use the
30 <command>fnt2bdf</command> utility (found in the
31 <filename>tools</filename> directory) to convert bitmap
32 fonts (<filename>VGASYS.FON</filename>,
33 <filename>SSERIFE.FON</filename>, and
34 <filename>SERIFE.FON</filename>) into the format that the X
35 Window System can recognize.
40 <para>Extract bitmap fonts with <command>fnt2bdf</command>.</para>
44 Convert <filename>.bdf</filename> files produced by Step
45 1 into <filename>.pcf</filename> files with
46 <command>bdftopcf</command>.
51 Copy <filename>.pcf</filename> files to the font server
52 directory which is usually
53 <filename>/usr/lib/X11/fonts/misc</filename> (you will
54 probably need superuser privileges). If you want to
55 create a new font directory you will need to add it to
61 Run <command>mkfontdir</command> for the directory you
62 copied fonts to. If you are already in X you should run
63 <command>xset fp rehash</command> to make X server aware
64 of the new fonts. You may also or instead have to restart
65 the font server (using e.g.
66 <command>/etc/init.d/xfs restart</command>
72 Edit the <filename>~/.wine/config</filename> file to remove
73 aliases for the fonts you've just installed.
78 Wine can get by without these fonts but 'the look and feel'
79 may be quite different. Also, some applications try to load
80 their custom fonts on the fly (WinWord 6.0) and since Wine
81 does not implement this yet it instead prints out something
85 STUB: AddFontResource( SOMEFILE.FON )
88 You can convert this file too. Note that
89 <filename>.FON</filename> file may not hold any bitmap
90 fonts and <command>fnt2bdf</command> will fail if this is
91 the case. Also note that although the above message will not
92 disappear Wine will work around the problem by using the
93 font you extracted from the
94 <filename>SOMEFILE.FON</filename>.
95 <command>fnt2bdf</command> will only work for Windows 3.1
96 fonts. It will not work for TrueType fonts.
99 What to do with TrueType fonts? There are several commercial
100 font tools that can convert them to the Type1 format but the
101 quality of the resulting fonts is far from stellar. The
102 other way to use them is to get a font server capable of
103 rendering TrueType (Caldera has one, there also is the free
104 <command>xfstt</command> in
105 <filename>Linux/X11/fonts</filename> on sunsite and mirrors,
106 if you're on FreeBSD you can use the port in
107 <filename>/usr/ports/x11-servers/Xfstt</filename>. And
108 there is <command>xfsft</command> which uses the freetype
109 library, see <link linkend="ttfont-server">freetype</link>
113 However, there is a possibility of the native TrueType
114 support via FreeType renderer in the future (hint, hint :-)
119 <title>How To Add Font Aliases To <filename>~/.wine/config</filename></title>
121 Many Windows applications assume that fonts included in
122 original Windows 3.1 distribution are always present. By
123 default Wine creates a number of aliases that map them on
124 the existing X fonts:
131 <entry>Windows font</entry>
132 <entry>...is mapped to...</entry>
133 <entry>X font</entry>
138 <entry>"MS Sans Serif"</entry>
139 <entry align="center">-></entry>
140 <entry>"-adobe-helvetica-"</entry>
143 <entry>"MS Serif"</entry>
144 <entry align="center">-></entry>
145 <entry>"-bitstream-charter-"</entry>
148 <entry>"Times New Roman"</entry>
149 <entry align="center">-></entry>
150 <entry>"-adobe-times-"</entry>
153 <entry>"Arial"</entry>
154 <entry align="center">-></entry>
155 <entry>"-adobe-helvetica-"</entry>
162 There is no default alias for the "System" font. Also, no
163 aliases are created for the fonts that applications install
164 at runtime. The recommended way to deal with this problem
165 is to convert the missing font (see above). If it proves
166 impossible, like in the case with TrueType fonts, you can
167 force the font mapper to choose a closely related X font by
168 adding an alias to the [fonts] section. Make sure that the
169 X font actually exists (with <command>xfontsel</command>
173 AliasN = [Windows font], [X font] <, optional "mask X font" flag>
179 Alias0 = System, --international-, subst
189 There must be no gaps in the sequence <literal>{0, ...,
190 N}</literal> otherwise all aliases after the first gap
196 Usually font mapper translates X font names into font
197 names visible to Windows programs in the following
205 <entry>X font</entry>
206 <entry>...will show up as...</entry>
207 <entry>Extracted name</entry>
212 <entry>--international-...</entry>
213 <entry align="center">-></entry>
214 <entry>"International"</entry>
217 <entry>-adobe-helvetica-...</entry>
218 <entry align="center">-></entry>
219 <entry>"Helvetica"</entry>
222 <entry>-adobe-utopia-...</entry>
223 <entry align="center">-></entry>
224 <entry>"Utopia"</entry>
227 <entry>-misc-fixed-...</entry>
228 <entry align="center">-></entry>
229 <entry>"Fixed"</entry>
233 <entry align="center">-></entry>
237 <entry>-sony-fixed-...</entry>
238 <entry align="center">-></entry>
239 <entry>"Sony Fixed"</entry>
243 <entry align="center">-></entry>
251 Note that since <literal>-misc-fixed-</literal> and
252 <literal>-sony-fixed-</literal> are different fonts Wine
253 modified the second extracted name to make sure Windows
254 programs can distinguish them because only extracted
255 names appear in the font selection dialogs.
260 "Masking" alias replaces the original extracted name so
261 that in the example case we will have the following
268 <entry>X font</entry>
269 <entry>...is masked to...</entry>
270 <entry>Extracted name</entry>
275 <entry>--international-...</entry>
276 <entry align="center">-></entry>
277 <entry>"System"</entry>
283 "Nonmasking" aliases are transparent to the user and
284 they do not replace extracted names.
287 Wine discards an alias when it sees that the native X
293 If you do not have access to Windows fonts mentioned in
294 the first paragraph you should try to substitute the
295 "System" font with nonmasking alias. The
296 <command>xfontsel</command> application will show you
297 the fonts available to X.
300 Alias.. = System, ...bold font without serifs
305 Also, some Windows applications request fonts without
306 specifying the typeface name of the font. Font table starts
307 with Arial in most Windows installations, however X font
308 table starts with whatever is the first line in the
309 <filename>fonts.dir</filename>. Therefore Wine uses the
310 following entry to determine which font to check first.
316 Default = -adobe-times-
322 It is better to have a scalable font family (bolds and
323 italics included) as the default choice because mapper
324 checks all available fonts until requested height and other
325 attributes match perfectly or the end of the font table is
326 reached. Typical X installations have scalable fonts in the
327 <filename>../fonts/Type1</filename> and
328 <filename>../fonts/Speedo</filename> directories.
333 <title>How To Manage Cached Font Metrics</title>
335 Wine stores detailed information about available fonts in
336 the <filename>~/.wine/cachedmetrics.[display]</filename> file. You
337 can copy it elsewhere and add this entry to the [fonts]
338 section in your <filename>~/.wine/config</filename>:
341 FontMetrics = <file with metrics>
344 If Wine detects changes in the X font configuration it will
345 rebuild font metrics from scratch and then it will overwrite
346 <filename>~/.wine/cachedmetrics.[display]</filename> with the new
347 information. This process can take a while.
352 <title>Too Small Or Too Large Fonts</title>
354 Windows programs may ask Wine to render a font with the
355 height specified in points. However, point-to-pixel ratio
356 depends on the real physical size of your display (15",
357 17", etc...). X tries to provide an estimate of that but it
358 can be quite different from the actual size. You can change
359 this ratio by adding the following entry to the [fonts]
363 Resolution = <integer value>
366 In general, higher numbers give you larger fonts. Try to
367 experiment with values in the 60 - 120 range. 96 is a good
373 <title>"FONT_Init: failed to load ..." Messages On Startup</title>
375 The most likely cause is a broken
376 <filename>fonts.dir</filename> file in one of your font
377 directories. You need to rerun <command>mkfontdir</command>
378 to rebuild this file. Read its manpage for more information.
379 If you can't run <command>mkfontdir</command> on this
380 machine as you are not root, use <command>xset -fp
381 xxx</command> to remove the broken font path.
386 <sect2 id="ttfont-server">
387 <title>Setting up a TrueType Font Server</title>
392 (Extracted from <filename>wine/documentation/ttfserver</filename>)
396 Follow these instructions to set up a TrueType font server on your system.
401 <para>Get a freetype source archive (<filename>freetype-X.Y.tar.gz</filename> ?).</para>
404 <para>Read docs, unpack, configure and install</para>
407 <para>Test the library, e.g. <command>ftview 20 /dosc/win95/fonts/times</command></para>
410 <para>Get <filename>xfsft-beta1e.linux-i586</filename></para>
414 Install it and start it when booting, e.g. in an
415 rc-script. The manpage for <command>xfs</command>
420 <para>Follow the hints given by <email>williamc@dai.ed.ac.uk</email></para>
424 I got <command>xfsft</command> from
425 <ulink url="http://www.dcs.ed.ac.uk/home/jec/progindex.html">http://www.dcs.ed.ac.uk/home/jec/progindex.html</ulink>.
426 I have it running all the time. Here is
427 <filename>/usr/X11R6/lib/X11/fs/config</filename>:
432 catalogue = /c/windows/fonts
433 error-file = /usr/X11R6/lib/X11/fs/fs-errors
434 default-point-size = 120
435 default-resolutions = 75,75,100,100
438 Obviously <filename>/c/windows/fonts</filename> is where
439 my Windows fonts on my Win95 <medialabel>C:</medialabel>
440 drive live; could be e.g.
441 <filename>/mnt/dosC/windows/system</filename> for Win31.
444 In <filename>/c/windows/fonts/fonts.scale</filename> I
449 arial.ttf -monotype-arial-medium-r-normal--0-0-0-0-p-0-iso8859-1
450 arialbd.ttf -monotype-arial-bold-r-normal--0-0-0-0-p-0-iso8859-1
451 arialbi.ttf -monotype-arial-bold-o-normal--0-0-0-0-p-0-iso8859-1
452 ariali.ttf -monotype-arial-medium-o-normal--0-0-0-0-p-0-iso8859-1
453 cour.ttf -monotype-courier-medium-r-normal--0-0-0-0-p-0-iso8859-1
454 courbd.ttf -monotype-courier-bold-r-normal--0-0-0-0-p-0-iso8859-1
455 courbi.ttf -monotype-courier-bold-o-normal--0-0-0-0-p-0-iso8859-1
456 couri.ttf -monotype-courier-medium-o-normal--0-0-0-0-p-0-iso8859-1
457 times.ttf -monotype-times-medium-r-normal--0-0-0-0-p-0-iso8859-1
458 timesbd.ttf -monotype-times-bold-r-normal--0-0-0-0-p-0-iso8859-1
459 timesbi.ttf -monotype-times-bold-i-normal--0-0-0-0-p-0-iso8859-1
460 timesi.ttf -monotype-times-medium-i-normal--0-0-0-0-p-0-iso8859-1
461 symbol.ttf -monotype-symbol-medium-r-normal--0-0-0-0-p-0-microsoft-symbol
462 wingding.ttf -microsoft-wingdings-medium-r-normal--0-0-0-0-p-0-microsoft-symbol
465 In <filename>/c/windows/fonts/fonts.dir</filename> I have
469 In <filename>/usr/X11R6/lib/X11/XF86Config</filename> I have
472 FontPath "tcp/localhost:7100"
475 in front of the other <literal>FontPath</literal> lines.
476 That's it! As an interesting by-product of course, all
477 those web pages which specify Arial come up in Arial in
483 Shut down X and restart (and debug errors you did while
484 setting up everything).
488 <para>Test with e.g. <command>xlsfont | grep arial</command></para>
499 <!-- Keep this comment at the end of the file
502 sgml-parent-document:("wine-user.sgml" "set" "book" "chapter" "")