2 <title>Dealing with Fonts
</title>
4 <sect1 id=
"windows-fonts">
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/tools.html">http://www.winehq.com/tools.html
</ulink>
27 <title>How To Convert Windows Fonts
</title>
29 If you have access to a Windows installation you should use
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
69 Edit the
<filename>wine.conf
</filename> file to remove
70 aliases for the fonts you've just installed.
75 WINE can get by without these fonts but 'the look and feel'
76 may be quite different. Also, some applications try to load
77 their custom fonts on the fly (WinWord
6.0) and since WINE
78 does not implement this yet it instead prints out something
82 STUB: AddFontResource( SOMEFILE.FON )
85 You can convert this file too. Note that
86 <filename>.FON
</filename> file may not hold any bitmap
87 fonts and
<command>fnt2bdf
</command> will fail if this is
88 the case. Also note that although the above message will not
89 disappear WINE will work around the problem by using the
90 font you extracted from the
91 <filename>SOMEFILE.FON
</filename>.
92 <command>fnt2bdf
</command> will only work for Windows
3.1
93 fonts. It will not work for TrueType fonts.
96 What to do with TrueType fonts? There are several commercial
97 font tools that can convert them to the Type1 format but the
98 quality of the resulting fonts is far from stellar. The
99 other way to use them is to get a font server capable of
100 rendering TrueType (Caldera has one, there also is the free
101 <command>xfstt
</command> in
102 <filename>Linux/X11/fonts
</filename> on sunsite and mirrors,
103 if you're on FreeBSD you can use the port in
104 <filename>/usr/ports/x11-servers/Xfstt
</filename>. And
105 there is
<command>xfsft
</command> which uses the freetype
106 library, see
<filename>documentation/ttfserver
</filename>).
109 However, there is a possibility of the native TrueType
110 support via FreeType renderer in the future (hint, hint :-)
115 <title>How To Add Font Aliases To
<filename>wine.conf
</filename></title>
117 Many Windows applications assume that fonts included in
118 original Windows
3.1 distribution are always present. By
119 default Wine creates a number of aliases that map them on
120 the existing X fonts:
127 <entry>Windows font
</entry>
128 <entry>...is mapped to...
</entry>
129 <entry>X font
</entry>
134 <entry>"MS Sans Serif"</entry>
135 <entry align=
"center">-
></entry>
136 <entry>"-adobe-helvetica-"</entry>
139 <entry>"MS Serif"</entry>
140 <entry align=
"center">-
></entry>
141 <entry>"-bitstream-charter-"</entry>
144 <entry>"Times New Roman"</entry>
145 <entry align=
"center">-
></entry>
146 <entry>"-adobe-times-"</entry>
149 <entry>"Arial"</entry>
150 <entry align=
"center">-
></entry>
151 <entry>"-adobe-helvetica-"</entry>
158 There is no default alias for the
"System" font. Also, no
159 aliases are created for the fonts that applications install
160 at runtime. The recommended way to deal with this problem
161 is to convert the missing font (see above). If it proves
162 impossible, like in the case with TrueType fonts, you can
163 force the font mapper to choose a closely related X font by
164 adding an alias to the [fonts] section. Make sure that the
165 X font actually exists (with
<command>xfontsel
</command>
169 AliasN = [Windows font], [X font]
<, optional
"mask X font" flag
>
175 Alias0 = System, --international-, subst
185 There must be no gaps in the sequence
<literal>{
0, ...,
186 N}
</literal> otherwise all aliases after the first gap
192 Usually font mapper translates X font names into font
193 names visible to Windows programs in the following
201 <entry>X font
</entry>
202 <entry>...will show up as...
</entry>
203 <entry>Extracted name
</entry>
208 <entry>--international-...
</entry>
209 <entry align=
"center">-
></entry>
210 <entry>"International"</entry>
213 <entry>-adobe-helvetica-...
</entry>
214 <entry align=
"center">-
></entry>
215 <entry>"Helvetica"</entry>
218 <entry>-adobe-utopia-...
</entry>
219 <entry align=
"center">-
></entry>
220 <entry>"Utopia"</entry>
223 <entry>-misc-fixed-...
</entry>
224 <entry align=
"center">-
></entry>
225 <entry>"Fixed"</entry>
229 <entry align=
"center">-
></entry>
233 <entry>-sony-fixed-...
</entry>
234 <entry align=
"center">-
></entry>
235 <entry>"Sony Fixed"</entry>
239 <entry align=
"center">-
></entry>
247 Note that since
<literal>-misc-fixed-
</literal> and
248 <literal>-sony-fixed-
</literal> are different fonts Wine
249 modified the second extracted name to make sure Windows
250 programs can distinguish them because only extracted
251 names appear in the font selection dialogs.
256 "Masking" alias replaces the original extracted name so
257 that in the example case we will have the following
264 <entry>X font
</entry>
265 <entry>...is masked to...
</entry>
266 <entry>Extracted name
</entry>
271 <entry>--international-...
</entry>
272 <entry align=
"center">-
></entry>
273 <entry>"System"</entry>
279 "Nonmasking" aliases are transparent to the user and
280 they do not replace extracted names.
283 Wine discards an alias when it sees that the native X
289 If you do not have access to Windows fonts mentioned in
290 the first paragraph you should try to substitute the
291 "System" font with nonmasking alias. The
292 <command>xfontsel
</command> application will show you
293 the fonts available to X.
296 Alias.. = System, ...bold font without serifs
301 Also, some Windows applications request fonts without
302 specifying the typeface name of the font. Font table starts
303 with Arial in most Windows installations, however X font
304 table starts with whatever is the first line in the
305 <filename>fonts.dir
</filename>. Therefore WINE uses the
306 following entry to determine which font to check first.
312 Default = -adobe-times-
318 It is better to have a scalable font family (bolds and
319 italics included) as the default choice because mapper
320 checks all available fonts until requested height and other
321 attributes match perfectly or the end of the font table is
322 reached. Typical X installations have scalable fonts in the
323 <filename>../fonts/Type1
</filename> and
324 <filename>../fonts/Speedo
</filename> directories.
329 <title>How To Manage Cached Font Metrics
</title>
331 WINE stores detailed information about available fonts in
332 the
<filename>~/.wine/.cachedmetrics
</filename> file. You
333 can copy it elsewhere and add this entry to the [fonts]
334 section in your
<filename>wine.conf
</filename>:
337 FontMetrics =
<file with metrics
>
340 If WINE detects changes in the X font configuration it will
341 rebuild font metrics from scratch and then it will overwrite
342 <filename>~/.wine/.cachedmetrics
</filename> with the new
343 information. This process can take a while.
348 <title>Too Small Or Too Large Fonts
</title>
350 Windows programs may ask WINE to render a font with the
351 height specified in points. However, point-to-pixel ratio
352 depends on the real physical size of your display (
15",
353 17", etc...). X tries to provide an estimate of that but it
354 can be quite different from the actual size. You can change
355 this ratio by adding the following entry to the [fonts]
359 Resolution =
<integer value
>
362 In general, higher numbers give you larger fonts. Try to
363 experiment with values in the
60 -
120 range.
96 is a good
369 <title>"FONT_Init: failed to load ..." Messages On Startup
</title>
371 The most likely cause is a broken
372 <filename>fonts.dir
</filename> file in one of your font
373 directories. You need to rerun
<command>mkfontdir
</command>
374 to rebuild this file. Read its manpage for more information.
375 If you can't run
<command>mkfontdir
</command> on this
376 machine as you are not root, use
<command>xset -fp
377 xxx
</command> to remove the broken font path.
382 <sect1 id=
"ttfont-server">
383 <title>Setting up a TrueType Font Server
</title>
388 (Extracted from
<filename>wine/documentation/ttfserver
</filename>)
392 Follow these instructions to set up a TrueType font server on your system.
397 <para>Get
<filename>freetype-
1.0.full.tar.gz
</filename></para>
400 <para>Read docs, unpack, configure and install
</para>
403 <para>Test the library, e.g.
<command>ftview
20 /dosc/win95/fonts/times
</command></para>
406 <para>Get
<filename>xfsft-beta1e.linux-i586
</filename></para>
410 Install it and start it when booting, e.g. in an
411 rc-script. The manpage for
<command>xfs
</command>
416 <para>Follow the hints given by
<email>williamc@dai.ed.ac.uk
</email></para>
420 I got
<command>xfsft
</command> from
421 <ulink url=
"http://www.dcs.ed.ac.uk/home/jec/progindex.html">http://www.dcs.ed.ac.uk/home/jec/progindex.html
</ulink>.
422 I have it running all the time. Here is
423 <filename>/usr/X11R6/lib/X11/fs/config
</filename>:
428 catalogue = /c/windows/fonts
429 error-file = /usr/X11R6/lib/X11/fs/fs-errors
430 default-point-size =
120
431 default-resolutions =
75,
75,
100,
100
434 Obviously
<filename>/c/windows/fonts
</filename> is where
435 my Windows fonts on my Win95
<medialabel>C:
</medialabel>
436 drive live; could be e.g.
437 <filename>/mnt/dosC/windows/system
</filename> for Win31.
438 In
<filename>/c/windows/fonts/fonts.scale
</filename> I
443 arial.ttf -monotype-arial-medium-r-normal--
0-
0-
0-
0-p-
0-iso8859-
1
444 arialbd.ttf -monotype-arial-bold-r-normal--
0-
0-
0-
0-p-
0-iso8859-
1
445 arialbi.ttf -monotype-arial-bold-o-normal--
0-
0-
0-
0-p-
0-iso8859-
1
446 ariali.ttf -monotype-arial-medium-o-normal--
0-
0-
0-
0-p-
0-iso8859-
1
447 cour.ttf -monotype-courier-medium-r-normal--
0-
0-
0-
0-p-
0-iso8859-
1
448 courbd.ttf -monotype-courier-bold-r-normal--
0-
0-
0-
0-p-
0-iso8859-
1
449 courbi.ttf -monotype-courier-bold-o-normal--
0-
0-
0-
0-p-
0-iso8859-
1
450 couri.ttf -monotype-courier-medium-o-normal--
0-
0-
0-
0-p-
0-iso8859-
1
451 times.ttf -monotype-times-medium-r-normal--
0-
0-
0-
0-p-
0-iso8859-
1
452 timesbd.ttf -monotype-times-bold-r-normal--
0-
0-
0-
0-p-
0-iso8859-
1
453 timesbi.ttf -monotype-times-bold-i-normal--
0-
0-
0-
0-p-
0-iso8859-
1
454 timesi.ttf -monotype-times-medium-i-normal--
0-
0-
0-
0-p-
0-iso8859-
1
455 symbol.ttf -monotype-symbol-medium-r-normal--
0-
0-
0-
0-p-
0-microsoft-symbol
456 wingding.ttf -microsoft-wingdings-medium-r-normal--
0-
0-
0-
0-p-
0-microsoft-symbol
459 In
<filename>/c/windows/fonts/fonts.dir
</filename> I have
463 In
<filename>/usr/X11R6/lib/X11/XF86Config
</filename> I have
466 FontPath
"tcp/localhost:7100"
469 in front of the other
<literal>FontPath
</literal> lines.
470 That's it! As an interesting by-product of course, all
471 those web pages which specify Arial come up in Arial in
477 Shut down X and restart (and debug errors you did while
478 setting up everything).
482 <para>Test with e.g
<command>xlsfont | grep arial
</command></para>
493 <!-- Keep this comment at the end of the file
496 sgml-parent-document:("wine-doc.sgml" "book" "chapter" "")