1
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
2
<!ENTITY % defs SYSTEM "X11/defs.ent"> %defs;
9
<Title>Fonts in X11R</Title>
10
<AUTHOR><firstname>Juliusz</firstname><surname>Chroboczek</surname>
11
<EMAIL>jch@freedesktop.org</EMAIL>
13
<PubDate>30 October 2006</PubDate>
18
<Title>Introduction</Title>
21
This document describes the support for fonts in X11R.
22
<XRef LinkEnd="sec-installing"> is aimed at the
23
casual user wishing to install fonts in X11R the rest of the
24
document describes the font support in more detail.
28
We assume some familiarity with digital fonts. If anything is not
29
clear to you, please consult <XRef LinkEnd="sec-background"> at the end of this document for background
34
<Title>Two font systems</Title>
37
X11 includes two font systems: the original core X11 fonts
38
system, which is present in all implementations of X11, and the Xft
39
fonts system, which may not yet be distributed with implementations of
40
X11 that are not based on either XFree86 or X11R6.8 or later.
44
The core X11 fonts system is directly derived from the fonts system
45
included with X11R1 in 1987, which could only use monochrome bitmap
46
fonts. Over the years, it has been more or less happily coerced into
47
dealing with scalable fonts and rotated glyphs.
51
Xft was designed from the start to provide good support for scalable
52
fonts, and to do so efficiently. Unlike the core fonts system, it
53
supports features such as anti-aliasing and sub-pixel rasterisation.
54
Perhaps more importantly, it gives applications full control over the
55
way glyphs are rendered, making fine typesetting and WYSIWIG display
56
possible. Finally, it allows applications to use fonts that are not
57
installed system-wide for displaying documents with embedded fonts.
61
Xft is not compatible with the core fonts system: usage of Xft
62
requires fairly extensive changes to toolkits (user-interface
63
libraries). While X.Org will continue to maintain the core fonts
64
system, toolkit authors are encouraged to switch to Xft as soon as
72
<Sect1 id="sec-installing" xreflabel="Installing fonts">
73
<Title>Installing fonts</Title>
76
This section explains how to configure both Xft and the core fonts
77
system to access newly-installed fonts.
80
<Sect2 id="sec-configuring-xft">
81
<Title>Configuring Xft</Title>
84
Xft has no configuration mechanism itself, it relies upon the
85
fontconfig library to configure and customise fonts. That library is
86
not specific to the X Window system, and does not rely on any
87
particular font output mechanism.
91
<Title>Installing fonts in Xft</Title>
94
Fontconfig looks for fonts in a set of well-known directories that
95
include all of X11R's standard font directories
96
(`<Literal remap="tt">/usr/X11R6/lib/X11/lib/fonts/*</Literal>') by default) as well as a
97
directory called `<Literal remap="tt">.fonts/</Literal>' in the user's home directory.
98
Installing a font for use by Xft applications is as simple
99
as copying a font file into one of these directories.
102
$ cp lucbr.ttf ~/.fonts/
105
Fontconfig will notice the new font at the next opportunity and rebuild its
106
list of fonts. If you want to trigger this update from the command
107
line, you may run the command `<Literal remap="tt">fc-cache</Literal>'.
116
In order to globally update the system-wide Fontconfig information on
117
Unix systems, you will typically need to run this command as root:
128
<Title>Fine-tuning Xft</Title>
131
Fontconfig's behaviour is controlled by a set of configuration
132
files: a standard configuration file, `<Literal remap="tt">/etc/fonts/fonts.conf</Literal>',
133
a host-specific configuration file, `<Literal remap="tt">/etc/fonts/local.conf</Literal>',
134
and a user-specific file called `<Literal remap="tt">.fonts.conf</Literal>' in the user's
135
home directory (this can be overridden with the
136
`<Literal remap="tt">FONTCONFIG_FILE</Literal>' environment variable).
140
Every Fontconfig configuration file must start with the following
144
<?xml version="1.0"?>
145
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
149
In addition, every Fontconfig configuration file must end with the
159
The default Fontconfig configuration file includes the directory
160
`<Literal remap="tt">˜/.fonts/</Literal>' in the list of directories searched for font
161
files, and this is where user-specific font files should be installed.
162
In the unlikely case that a new font directory needs to be added, this
163
can be done with the following syntax:
166
<dir>/usr/local/share/fonts/</dir>
172
Another useful option is the ability to disable anti-aliasing (font
173
smoothing) for selected fonts. This can be done with the following
177
<match target="font">
178
<test qual="any" name="family">
179
<string>Lucida Console</string>
181
<edit name="antialias" mode="assign">
182
<bool>false</bool>
187
Anti-aliasing can be disabled for all fonts by the following incantation:
190
<match target="font">
191
<edit name="antialias" mode="assign">
192
<bool>false</bool>
200
Xft supports sub-pixel rasterisation on LCD displays. X11R should
201
automatically enable this feature on laptops and when using an LCD
202
monitor connected with a DVI cable; you can check whether this was
206
$ xdpyinfo -ext RENDER | grep sub-pixel
209
If this doesn't print anything, you will need to configure Render for
210
your particular LCD hardware manually; this is done with the following
214
<match target="font">
215
<edit name="rgba" mode="assign">
216
<const>rgb</const>
221
The string `<Literal remap="tt">rgb</Literal>' within the
222
`<Literal remap="tt"><const></Literal>'...`<Literal remap="tt"></const></Literal>'
223
specifies the order of pixel components on your display, and should be
224
changed to match your hardware; it can be one of `<Literal remap="tt">rgb</Literal> (normal
225
LCD screen), `<Literal remap="tt">bgr</Literal>' (backwards LCD screen), `<Literal remap="tt">vrgb</Literal>' (LCD
226
screen rotated clockwise) or `<Literal remap="tt">vbgr</Literal>' (LCD screen rotated
233
<Title>Configuring applications</Title>
236
A growing number of applications use Xft in preference to the core
237
fonts system. Some applications, however, need to be explicitly
238
configured to use Xft.
242
A case in point is XTerm, which can be set to use Xft by using the
243
`<Literal remap="tt">-fa</Literal>' command line option or by setting the `<Literal remap="tt">XTerm*faceName</Literal>'
247
XTerm*faceName: Courier
253
$ xterm -fa "Courier"
259
For KDE applications, you should select ``Anti-alias fonts'' in the
260
``Fonts'' panel of KDE's ``Control Center''. Note that this option is
261
misnamed: it switches KDE to using Xft but doesn't enable
262
anti-aliasing in case it was disabled by your Xft configuration file.
266
Gnome applications and Mozilla Firefox will use Xft by default.
274
<Title>Configuring the core X11 fonts system</Title>
277
Installing fonts in the core system is a two step process. First,
278
you need to create a <Emphasis remap="it">font directory</Emphasis> that contains all the
279
relevant font files as well as some index files. You then need to
280
inform the X server of the existence of this new directory by
281
including it in the <Emphasis remap="it">font path</Emphasis>.
285
<Title>Installing bitmap fonts</Title>
288
The X11R server can use bitmap fonts in both the cross-platform
289
BDF format and the somewhat more efficient binary PCF format.
290
(X11R also supports the obsolete SNF format.)
294
Bitmap fonts are normally distributed in the BDF format. Before
295
installing such fonts, it is desirable (but not absolutely necessary)
296
to convert the font files to the PCF format. This is done by using the
297
command `<Literal remap="tt">bdftopcf</Literal>', <Emphasis remap="it">e.g.</Emphasis>
300
$ bdftopcf courier12.bdf
303
You will then want to compress the resulting PCF font files:
312
After the fonts have been converted, you should copy all the font
313
files that you wish to make available into a arbitrary directory, say
314
`<Literal remap="tt">/usr/local/share/fonts/bitmap/</Literal>'. You should then create the
315
index file `<Literal remap="tt">fonts.dir</Literal>' by running the command `<Literal remap="tt">mkfontdir</Literal>'
316
(please see the <ULink
317
URL="mkfontdir.1.html"
320
manual page for more information):
323
$ mkdir /usr/local/share/fonts/bitmap/
324
$ cp *.pcf.gz /usr/local/share/fonts/bitmap/
325
$ mkfontdir /usr/local/share/fonts/bitmap/
331
All that remains is to tell the X server about the existence of the
332
new font directory; see <XRef LinkEnd="sec-set-font-path"> below.
338
<Title>Installing scalable fonts</Title>
341
The X11R server supports scalable fonts in multiple
342
formats, including Type 1, TrueType, OpenType/CFF and CIDFont.
343
This section only applies to the first three; for information on
344
CIDFonts, please see <XRef LinkEnd="sec-cid-fonts">
345
later in this document. (Earlier versions of X11 also included
346
support for the Speedo scalable font format, but that is disabled in
347
the default builds of X11R6.9 and not included in X11R7.0 and later
352
Installing scalable fonts is very similar to installing bitmap fonts:
353
you create a directory with the font files, and run `<Literal remap="tt">mkfontdir</Literal>'
354
to create an index file called `<Literal remap="tt">fonts.dir</Literal>'.
358
There is, however, a big difference: `<Literal remap="tt">mkfontdir</Literal>' cannot
359
automatically recognise scalable font files. For that reason, you
360
must first index all the font files in a file called
361
`<Literal remap="tt">fonts.scale</Literal>'. While this can be done by hand, it is best done
362
by using the `<Literal remap="tt">mkfontscale</Literal>' utility.
365
$ mkfontscale /usr/local/share/fonts/Type1/
366
$ mkfontdir /usr/local/share/fonts/Type1/
369
Under some circumstances, it may be necessary to modify the
370
`<Literal remap="tt">fonts.scale</Literal>' file generated by <Literal remap="tt">mkfontscale</Literal>; for more
371
information, please see the <ULink
372
URL="mkfontdir.1.html"
375
URL="mkfontscale.1.html"
376
>mkfontscale(1)</ULink
377
> manual pages and <XRef LinkEnd="sec-internationalisation">
378
later in this document.
383
<Sect3 id="sec-cid-fonts" xreflabel="Installing CIDFonts">
384
<Title>Installing CID-keyed fonts </Title>
387
The CID-keyed font format was designed by Adobe Systems for fonts
388
with large character sets. The CID-keyed format is obsolete, as it
389
has been superseded by other formats such as OpenType/CFF; however,
390
support for CID-keyed fonts is still provided in X11.
394
A CID-keyed font, or CIDFont for short, contains a collection of
395
glyphs indexed by <Emphasis remap="it">character ID</Emphasis> (CID).
399
In order to map such glyphs to meaningful indices, Adobe provide a set
400
of <Emphasis remap="it">CMap</Emphasis> files. The PostScript name of a font generated from a
401
CIDFont consists of the name of the CIDFont and the name of the CMap
402
separated by two dashes. For example, the font generated from the
403
CIDFont `<Literal remap="tt">Munhwa-Regular</Literal>' using the CMap `<Literal remap="tt">UniKS-UCS2-H</Literal>' is
407
Munhwa-Regular--UniKS-UCS2-H
413
The CIDFont code in X11R requires a very rigid directory
414
structure. The main directory must be called `<Literal remap="tt">CID</Literal>' (its location
415
defaults to `<Literal remap="tt">/usr/X11R6/lib/X11/fonts/CID</Literal>' but it may be
416
located anywhere), and it should contain a subdirectory for every CID
417
collection. Every subdirectory <Emphasis remap="it">must</Emphasis> contain subdirectories
418
called <Literal remap="tt">CIDFont</Literal> (containing the actual CIDFont files), <Literal remap="tt">CMap</Literal>
419
(containing all the needed CMaps), <Literal remap="tt">AFM</Literal> (containing the font
420
metric files) and <Literal remap="tt">CFM</Literal> (initially empty). For example, in the
421
case of the font <Literal remap="tt">Munhwa-Regular</Literal> that uses the CID collection
422
<Literal remap="tt">Adobe-Korea1-0</Literal>, the directory structure should be as follows:
425
CID/Adobe-Korea1/CIDFont/Munhwa-Regular
426
CID/Adobe-Korea1/CMap/UniKS-UCS2-H
427
CID/Adobe-Korea1/AFM/Munhwa-Regular.afm
428
CID/Adobe-Korea1/CFM/
436
After creating this directory structure and copying the relevant
437
files, you should create a `<Literal remap="tt">fonts.scale</Literal>' file. This file has the
438
same format as in the case of (non-CID) scalable fonts, except that
439
its first column contains PostScript font names with the extension
440
`<Literal remap="tt">.cid</Literal>' appended rather than actual filenames:
444
Adobe-Korea1/Munhwa-Regular--UniKS-UCS2-H.cid \
445
-adobe-munhwa-medium-r-normal--0-0-0-0-p-0-iso10646-1
448
(both names on the same line). Running `<Literal remap="tt">mkfontdir</Literal>'
449
creates the `<Literal remap="tt">fonts.dir</Literal>' file:
452
$ cd /usr/local/share/fonts/CID
459
Finally, you should create the font metrics summary files in the
460
directory `<Literal remap="tt">CFM</Literal>' by running the command `<Literal remap="tt">mkcfm</Literal>':
463
$ mkcfm /usr/local/share/fonts/CID
466
If no CFM files are available, the server will still be able to use
467
the CID fonts but querying them will take a long time. You should run
468
`<Literal remap="tt">mkcfm</Literal>' again whenever a change is made to any of the CID-keyed
469
fonts, or when the CID-keyed fonts are copied to a machine with a
470
different architecture.
475
<Sect3 id="sec-set-font-path" xreflabel="Setting the server font path">
476
<Title>Setting the server's font path </Title>
479
The list of directories where the server looks for fonts is known
480
as the <Emphasis remap="it">font path</Emphasis>. Informing the server of the existence of a new
481
font directory consists of putting it on the font path.
485
The font path is an ordered list; if a client's request matches
486
multiple fonts, the first one in the font path is the one that gets
487
used. When matching fonts, the server makes two passes over the font
488
path: during the first pass, it searches for an exact match; during
489
the second, it searches for fonts suitable for scaling.
493
For best results, scalable fonts should appear in the font path before
494
the bitmap fonts; this way, the server will prefer bitmap fonts to
495
scalable fonts when an exact match is possible, but will avoid scaling
496
bitmap fonts when a scalable font can be used. (The `<Literal remap="tt">:unscaled</Literal>'
497
hack, while still supported, should no longer be necessary in X11R.)
501
You may check the font path of the running server by typing the command
510
<Title>Temporary modification of the font path</Title>
513
The `<Literal remap="tt">xset</Literal>' utility may be used to modify the font path for the
514
current session. The font path is set with the command <Literal remap="tt">xset fp</Literal>;
515
a new element is added to the front with <Literal remap="tt">xset +fp</Literal>, and added to
516
the end with <Literal remap="tt">xset fp+</Literal>. For example,
519
$ xset +fp /usr/local/fonts/Type1
520
$ xset fp+ /usr/local/fonts/bitmap
526
Conversely, an element may be removed from the front of the font path
527
with `<Literal remap="tt">xset -fp</Literal>', and removed from the end with `<Literal remap="tt">xset fp-</Literal>'.
528
You may reset the font path to its default value with
529
`<Literal remap="tt">xset fp default</Literal>'.
533
For more information, please consult the <ULink
542
<Title>Permanent modification of the font path</Title>
545
The default font path (the one used just after server startup or
546
after `<Literal remap="tt">xset fp default</Literal>') is specified in the X server's
547
`<Literal remap="tt">xorg.conf</Literal>' file. It is computed by appending all the
548
directories mentioned in the `<Literal remap="tt">FontPath</Literal>' entries of the
549
`<Literal remap="tt">Files</Literal>' section in the order in which they appear.
552
FontPath "/usr/local/fonts/Type1"
554
FontPath "/usr/local/fonts/bitmap"
560
For more information, please consult the <ULink
561
URL="xorg.conf.5.html"
570
<Sect3 id="sec-troubleshooting-core">
571
<Title>Troubleshooting </Title>
574
If you seem to be unable to use some of the fonts you have
575
installed, the first thing to check is that the `<Literal remap="tt">fonts.dir</Literal>' files
576
are correct and that they are readable by the server (the X server
577
usually runs as root, beware of NFS-mounted font directories). If
578
this doesn't help, it is quite possible that you are trying to use a
579
font in a format that is not supported by your server.
583
X11R supports the BDF, PCF, SNF, Type 1, TrueType, OpenType
584
and CIDFont font formats. However, not all X11R servers
585
come with all the font backends configured in.
589
On most platforms, the X11R servers are <Emphasis remap="it">modular</Emphasis>: the font
590
backends are included in modules that are loaded at runtime. The
591
modules to be loaded are specified in the `<Literal remap="tt">xorg.conf</Literal>' file using
592
the `<Literal remap="tt">Load</Literal>' directive:
598
If you have trouble installing fonts in a specific format, you may
599
want to check the server's log file in order to see whether the
600
relevant modules are properly loaded. The list of font modules
601
distributed with X11R is as follows:
607
<Literal remap="tt">"bitmap"</Literal>: bitmap fonts (`<Literal remap="tt">*.bdf</Literal>', `<Literal remap="tt">*.pcf</Literal>'
608
and `<Literal remap="tt">*.snf</Literal>');
614
<Literal remap="tt">"freetype"</Literal>: TrueType fonts (`<Literal remap="tt">*.ttf</Literal>' and
615
`<Literal remap="tt">*.ttc</Literal>'), OpenType fonts (`<Literal remap="tt">*.otf</Literal>' and `<Literal remap="tt">*.otc</Literal>') and
616
Type 1 fonts (`<Literal remap="tt">*.pfa</Literal>' and `<Literal remap="tt">*.pfb</Literal>');
622
<Literal remap="tt">"type1"</Literal>: alternate Type 1 backend (`<Literal remap="tt">*.pfa</Literal>' and
623
`<Literal remap="tt">*.pfb</Literal>') and CIDFont backend;
629
<Literal remap="tt">"xtt"</Literal>: alternate TrueType backend (`<Literal remap="tt">*.ttf</Literal>' and
630
`<Literal remap="tt">*.ttc</Literal>').
636
Please note that the argument of the `<Literal remap="tt">Load</Literal>' directive is
647
<Title>Fonts included with X11R</Title>
650
<Title>Standard bitmap fonts</Title>
653
The Sample Implementation of X11 (SI) comes with a large number of
654
bitmap fonts, including the `<Literal remap="tt">fixed</Literal>' family, and bitmap versions
655
of Courier, Times, Helvetica and some members of the Lucida family. In
656
the SI, these fonts are provided in the ISO 8859-1 encoding (ISO
657
Latin Western-European).
661
In X11R, a number of these fonts are provided in Unicode-encoded
662
font files instead. At build time, these fonts are split into font
663
files encoded according to legacy encodings, a process which allows
664
us to provide the standard fonts in a number of regional encodings
665
with no duplication of work.
669
For example, the font file
672
/usr/X11R6/lib/X11/fonts/misc/6x13.bdf
678
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
681
is a Unicode-encoded version of the standard `<Literal remap="tt">fixed</Literal>' font with
682
added support for the Latin, Greek, Cyrillic, Georgian, Armenian, IPA
683
and other scripts plus numerous technical symbols. It contains over
684
2800 glyphs, covering all characters of ISO 8859 parts 1-5,
685
7-10, 13-15, as well as all European IBM and Microsoft code pages,
686
KOI8, WGL4, and the repertoires of many other character sets.
690
This font is used at build time for generating the font files
700
with respective XLFDs
703
-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
705
-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-15
706
-misc-fixed-medium-r-normal--13-120-75-75-c-60-koi8-r
709
The standard short name `<Literal remap="tt">fixed</Literal>' is normally an alias for
712
-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
720
<Title>The ClearlyU Unicode font family</Title>
723
The ClearlyU family of fonts provides a set of 12 pt,
724
100 dpi proportional fonts with many of the glyphs needed for
725
Unicode text. Together, the fonts contain approximately 7500 glyphs.
729
The main ClearlyU font has the XLFD
732
-mutt-clearlyu-medium-r-normal--17-120-100-100-p-101-iso10646-1
735
and resides in the font file
738
/usr/X11R6/lib/X11/fonts/misc/cu12.pcf.gz
741
Additional ClearlyU fonts include
744
-mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1
745
-mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-111-iso10646-1
746
-mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0
747
-mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0
753
The <Emphasis remap="it">Alternate Glyphs</Emphasis> font contains additional glyph shapes that
754
are needed for certain languages. A second alternate glyph font will
755
be provided later for cases where a character has more than one
756
commonly used alternate shape (<Emphasis remap="it">e.g.</Emphasis> the Urdu heh).
760
The <Emphasis remap="it">PUA</Emphasis> font contains extra glyphs that are useful for certain
765
The <Emphasis remap="it">Arabic Extra</Emphasis> font contains the glyphs necessary for
766
characters that don't have all of their possible shapes encoded in
767
ISO 10646. The glyphs are roughly ordered according to the order
768
of the characters in the ISO 10646 standard.
772
The <Emphasis remap="it">Ligature</Emphasis> font contains ligatures for various scripts that
773
may be useful for improved presentation of text.
779
<Title>Standard scalable fonts</Title>
782
X11R includes all the scalable fonts distributed with X11R6.
786
<Title>Standard Type 1 fonts</Title>
789
The IBM Courier set of fonts cover ISO 8859-1 and
790
ISO 8859-2 as well as Adobe Standard Encoding. These fonts have
794
-adobe-courier-medium-*-*--0-0-0-0-m-0-*-*
797
and reside in the font files
800
/usr/X11R6/lib/X11/fonts/Type1/cour*.pfa
806
The Adobe Utopia set of fonts only cover ISO 8859-1 as well as
807
Adobe Standard Encoding. These fonts have XLFD
810
-adobe-utopia-*-*-normal--0-0-0-0-p-0-iso8859-1
813
and reside in the font files
816
/usr/X11R6/lib/X11/fonts/Type1/UT*.pfa
822
Finally, X11R also comes with Type 1 versions of Bitstream
823
Courier and Charter. These fonts have XLFD
826
-bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1
827
-bitstream-charter-*-*-normal--0-0-0-0-p-0-iso8859-1
830
and reside in the font files
833
/usr/X11R6/lib/X11/fonts/Type1/c*bt_.pfb
843
<Title>The Bigelow & Holmes Luxi family</Title>
846
X11R includes the <Emphasis remap="it">Luxi</Emphasis> family of scalable fonts, in both
847
TrueType and Type 1 format. This family consists of the fonts
848
<Emphasis remap="it">Luxi Serif</Emphasis>, with XLFD
851
-b&h-luxi serif-medium-*-normal--*-*-*-*-p-*-*-*
854
<Emphasis remap="it">Luxi Sans</Emphasis>, with XLFD
857
-b&h-luxi sans-medium-*-normal--*-*-*-*-p-*-*-*
860
and <Emphasis remap="it">Luxi Mono</Emphasis>, with XLFD
863
-b&h-luxi mono-medium-*-normal--*-*-*-*-m-*-*-*
866
Each of these fonts comes Roman, oblique, bold and bold oblique variants
867
The TrueType version have glyphs covering the basic ASCII Unicode
868
range, the Latin 1 range, as well as the <Emphasis remap="it">Extended Latin</Emphasis>
869
range and some additional punctuation characters. In particular,
870
these fonts include all the glyphs needed for ISO 8859 parts 1,
871
2, 3, 4, 9, 13 and 15, as well as all the glyphs in the Adobe Standard
872
encoding and the Windows 3.1 character set.
876
The glyph coverage of the Type 1 versions is somewhat reduced,
877
and only covers ISO 8859 parts 1, 2 and 15 as well as the Adobe
882
The Luxi fonts are original designs by Kris Holmes and Charles
883
Bigelow. Luxi fonts include seriffed, sans serif, and monospaced
884
styles, in roman and oblique, and normal and bold weights. The fonts
885
share stem weight, x-height, capital height, ascent and descent, for
890
The character width metrics of Luxi roman and bold fonts match those
891
of core fonts bundled with popular operating and window systems.
895
The license terms for the Luxi fonts are included in the file
896
`<Literal remap="tt">COPYRIGHT.BH</Literal>', as well as in the <ULink
898
>License document</ULink
903
Charles Bigelow and Kris Holmes from Bigelow and Holmes Inc.
904
developed the Luxi typeface designs in Ikarus digital format.
908
URW++ Design and Development GmbH converted the Ikarus format fonts
909
to TrueType and Type1 font programs and implemented the grid-fitting
910
"hints" and kerning tables in the Luxi fonts.
914
For more information, please contact
916
>design@bigelowandholmes.com</EMAIL
919
>info@urwpp.de</EMAIL
922
URL="http://www.urwpp.de"
923
>the URW++ web site</ULink
928
An earlier version of the Luxi fonts was made available under the
929
name <Emphasis>Lucidux</Emphasis>. This name should no longer be used due to trademark
930
uncertainties, and all traces of the <Emphasis>Lucidux</Emphasis> name have been
938
<Sect1 id="sec-more-core">
939
<Title>More about core fonts </Title>
942
This section describes X11R-specific enhancements to the core
946
<Sect2 id="sec-internationalisation" xreflabel="Core fonts and
947
internationalisation">
948
<Title>Core fonts and internationalisation </Title>
951
The scalable font backends (Type 1 and TrueType) can
952
automatically re-encode fonts to the encoding specified in the
953
XLFD in `<Literal remap="tt">fonts.dir</Literal>'. For example, a `<Literal remap="tt">fonts.dir</Literal>' file can
954
contain entries for the Type 1 Courier font such as
957
cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
958
cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2
961
which will lead to the font being recoded to ISO 8859-1 and
962
ISO 8859-2 respectively.
965
<Sect3 id="sec-fontenc">
966
<Title>The <Emphasis remap="it">fontenc</Emphasis> layer </Title>
969
Two of the scalable backends (Type 1 and the
970
<Emphasis remap="it">FreeType</Emphasis> TrueType backend) use a common <Emphasis remap="it">fontenc</Emphasis> layer for
971
font re-encoding. This allows these backends to share their encoding
972
data, and allows simple configuration of new locales independently of
977
<Emphasis remap="it">Please note:</Emphasis> the X-TrueType (X-TT) backend is not included
978
in X11R. That functionality has been merged into the FreeType
983
In the <Emphasis remap="it">fontenc</Emphasis> layer, an encoding is defined by a name (such as
984
<Literal remap="tt">iso8859-1</Literal>), possibly a number of aliases (alternate names), and
985
an ordered collection of mappings. A mapping defines the way the
986
encoding can be mapped into one of the <Emphasis remap="it">target encodings</Emphasis> known to
987
<Emphasis remap="it">fontenc</Emphasis>; currently, these consist of Unicode, Adobe glyph names,
988
and arbitrary TrueType ``cmap''s.
992
A number of encodings are hardwired into <Emphasis remap="it">fontenc</Emphasis>, and are
993
therefore always available; the hardcoded encodings cannot easily be
994
redefined. These include:
1000
<Literal remap="tt">iso10646-1</Literal>: Unicode;
1006
<Literal remap="tt">iso8859-1</Literal>: ISO Latin-1 (Western Europe);
1012
<Literal remap="tt">iso8859-2</Literal>: ISO Latin-2 (Eastern Europe);
1018
<Literal remap="tt">iso8859-3</Literal>: ISO Latin-3 (Southern Europe);
1024
<Literal remap="tt">iso8859-4</Literal>: ISO Latin-4 (Northern Europe);
1030
<Literal remap="tt">iso8859-5</Literal>: ISO Cyrillic;
1036
<Literal remap="tt">iso8859-6</Literal>: ISO Arabic;
1042
<Literal remap="tt">iso8859-7</Literal>: ISO Greek;
1048
<Literal remap="tt">iso8859-8</Literal>: ISO Hebrew;
1054
<Literal remap="tt">iso8859-9</Literal>: ISO Latin-5 (Turkish);
1060
<Literal remap="tt">iso8859-10</Literal>: ISO Latin-6 (Nordic);
1066
<Literal remap="tt">iso8859-15</Literal>: ISO Latin-9, or Latin-0 (Revised
1073
<Literal remap="tt">koi8-r</Literal>: KOI8 Russian;
1079
<Literal remap="tt">koi8-u</Literal>: KOI8 Ukrainian (see RFC 2319);
1085
<Literal remap="tt">koi8-ru</Literal>: KOI8 Russian/Ukrainian;
1091
<Literal remap="tt">koi8-uni</Literal>: KOI8 ``Unified'' (Russian, Ukrainian, and
1098
<Literal remap="tt">koi8-e</Literal>: KOI8 ``European,'' ISO-IR-111, or ECMA-Cyrillic;
1104
<Literal remap="tt">microsoft-symbol</Literal> and <Literal remap="tt">apple-roman</Literal>: these are only
1105
likely to be useful with TrueType symbol fonts.
1114
Additional encodings can be added by defining <Emphasis remap="it">encoding files</Emphasis>.
1115
When a font encoding is requested that the <Emphasis remap="it">fontenc</Emphasis> layer doesn't
1116
know about, the backend checks the directory in which the font file
1117
resides (not necessarily the directory with <Literal remap="tt">fonts.dir</Literal>!) for a
1118
file named `<Literal remap="tt">encodings.dir</Literal>'. If found, this file is scanned for
1119
the requested encoding, and the relevant encoding definition file is
1120
read in. The `<Literal remap="tt">mkfontdir</Literal>' utility, when invoked with the
1121
`<Literal remap="tt">-e</Literal>' option followed by the name of a directory containing
1122
encoding files, can be used to automatically build `<Literal remap="tt">encodings.dir</Literal>'
1123
files. Please see the <ULink
1124
URL="mkfontdir.1.html"
1125
>mkfontdir(1)</ULink
1127
manual page for more details.
1131
A number of encoding files for common encodings are included with
1132
X11R. Information on writing new encoding files can be found in
1133
<XRef LinkEnd="sec-format-encoding-directory-files"> and <XRef LinkEnd="sec-format-encoding-files"> later in this document.
1139
<Title>Backend-specific notes about fontenc</Title>
1141
<Sect4 id="sec-fontenc-freetype">
1142
<Title>The <Emphasis remap="it">FreeType</Emphasis> backend </Title>
1145
For TrueType and OpenType fonts, the FreeType backend scans the
1146
mappings in order. Mappings with a target of PostScript are ignored;
1147
mappings with a TrueType or Unicode target are checked against all the
1148
cmaps in the file. The first applicable mapping is used.
1152
For Type 1 fonts, the FreeType backend first searches for a
1153
mapping with a target of PostScript. If one is found, it is used.
1154
Otherwise, the backend searches for a mapping with target Unicode,
1155
which is then composed with a built-in table mapping codes to glyph
1156
names. Note that this table only covers part of the Unicode code
1157
points that have been assigned names by Adobe.
1161
Specifying an encoding value of <Literal remap="tt">adobe-fontspecific</Literal> for a
1162
Type 1 font disables the encoding mechanism. This is useful with
1163
symbol and incorrectly encoded fonts (see <XRef LinkEnd="sec-incorrect-encoding"> below).
1167
If a suitable mapping is not found, the FreeType backend defaults to
1174
<Title>Type 1</Title>
1177
The Type 1 backend behaves similarly to the FreeType backend
1178
with Type 1 fonts, except that it limits all encodings to 8-bit
1186
<Sect3 id="sec-format-encoding-directory-files" xreflabel="Format of
1187
encodings directory files">
1188
<Title>Format of encoding directory files </Title>
1191
In order to use a font in an encoding that the font backend does
1192
not know about, you need to have an `<Literal remap="tt">encodings.dir</Literal>' file either
1193
in the same directory as the font file used or in a system-wide
1194
location (`<Literal remap="tt">/usr/X11R6/lib/X11/fonts/encodings/</Literal>' by default).
1198
The `<Literal remap="tt">encodings.dir</Literal>' file has a similar format to
1199
`<Literal remap="tt">fonts.dir</Literal>'. Its first line specifies the number of encodings,
1200
while every successive line has two columns, the name of the encoding,
1201
and the name of the encoding file; this can be relative to the current
1202
directory, or absolute. Every encoding name should agree with the
1203
encoding name defined in the encoding file. For example,
1210
mulearabic-0 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-0.enc
1211
mulearabic-1 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-1.enc
1212
mulearabic-2 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-2.enc
1218
The name of an encoding <Emphasis remap="it">must</Emphasis> be specified in the encoding file's
1219
`<Literal remap="tt">STARTENCODING</Literal>' or `<Literal remap="tt">ALIAS</Literal>' line. It is not enough to create
1220
an `<Literal remap="tt">encodings.dir</Literal>' entry.
1224
If your platform supports it (it probably does), encoding files may be
1225
compressed or gzipped.
1229
The `<Literal remap="tt">encoding.dir</Literal>' files are best maintained by the
1230
`<Literal remap="tt">mkfontdir</Literal>' utility. Please see the <ULink
1231
URL="mkfontdir.1.html"
1232
>mkfontdir(1)</ULink
1233
> manual page for more information.
1238
<Sect3 id="sec-format-encoding-files" xreflabel="Format of encoding files">
1239
<Title>Format of encoding files </Title>
1242
The encoding files are ``free form,'' <Emphasis remap="it">i.e.</Emphasis> any string of
1243
whitespace is equivalent to a single space. Keywords are parsed in a
1244
non-case-sensitive manner, meaning that `<Literal remap="tt">size</Literal>', `<Literal remap="tt">SIZE</Literal>', and
1245
`<Literal remap="tt">SiZE</Literal>' all parse as the same keyword; on the other hand, case is
1246
significant in glyph names.
1250
Numbers can be written in decimal, as in `<Literal remap="tt">256</Literal>', in hexadecimal,
1251
as in `<Literal remap="tt">0x100</Literal>', or in octal, as in `<Literal remap="tt">0400</Literal>'.
1255
Comments are introduced by a hash sign `<Literal remap="tt">#</Literal>'. A `<Literal remap="tt">#</Literal>' may
1256
appear at any point in a line, and all characters following the
1257
`<Literal remap="tt">#</Literal>' are ignored, up to the end of the line.
1261
The encoding file starts with the definition of the name of the
1262
encoding, and possibly its alternate names (aliases):
1265
STARTENCODING mulearabic-0
1269
The name of the encoding and its aliases should be suitable for use in
1270
an XLFD font name, and therefore contain exactly one dash `<Literal remap="tt">-</Literal>'.
1274
The encoding file may then optionally declare the size of the
1275
encoding. For a linear encoding (such as ISO 8859-1), the SIZE
1276
line specifies the maximum code plus one:
1282
For a matrix encoding, it should specify two numbers. The first is
1283
the number of the last row plus one, the other, the highest column
1284
number plus one. In the case of `<Literal remap="tt">jisx0208.1990-0</Literal>'
1285
(JIS X 0208(1990), double-byte encoding, high bit clear), it
1292
In the case of a matrix encoding, a `<Literal remap="tt">FIRSTINDEX</Literal>' line may be
1293
included to specify the minimum glyph index in an encoding. The
1294
keyword `<Literal remap="tt">FIRSTINDEX</Literal>' is followed by two integers, the minimum row
1295
number followed by the minimum column number:
1298
FIRSTINDEX 0x20 0x20
1301
In the case of a linear encoding, a `<Literal remap="tt">FIRSTINDEX</Literal>' line is not very
1302
useful. If for some reason however you chose to include on, it should
1303
be followed by a single integer.
1307
Note that in most font backends inclusion of a `<Literal remap="tt">FIRSTINDEX</Literal>' line
1308
has the side effect of disabling default glyph generation, and this
1309
keyword should therefore be avoided unless absolutely necessary.
1313
Codes outside the region defined by the `<Literal remap="tt">SIZE</Literal>' and
1314
`<Literal remap="tt">FIRSTINDEX</Literal>' lines are understood to be undefined. Encodings
1315
default to linear encoding with a size of 256 (0x100). This means
1316
that you must declare the size of all 16 bit encodings.
1320
What follows is one or more mapping sections. A mapping section
1321
starts with a `<Literal remap="tt">STARTMAPPING</Literal>' line stating the target of the mapping.
1322
The target may be one of:
1328
Unicode (ISO 10646):
1331
STARTMAPPING unicode
1339
a given TrueType ``cmap'':
1342
STARTMAPPING cmap 3 1
1350
PostScript glyph names:
1353
STARTMAPPING postscript
1361
Every line in a mapping section maps one from the encoding being
1362
defined to the target of the mapping. In mappings with a Unicode or
1363
TrueType mapping, codes are mapped to codes:
1371
As an abbreviation, it is possible to map a contiguous range of codes
1372
in a single line. A line consisting of three integers
1375
<it/start/ <it/end/ <it/target/
1378
is an abbreviation for the range of lines
1381
<Emphasis remap="it">start</Emphasis> <Emphasis remap="it">target</Emphasis>
1385
<Emphasis remap="it">start</Emphasis>+1 <Emphasis remap="it">target</Emphasis>+1
1393
<Emphasis remap="it">end</Emphasis> <Emphasis remap="it">target</Emphasis>+<Emphasis remap="it">end</Emphasis>-<Emphasis remap="it">start</Emphasis>
1396
For example, the line
1399
0x2121 0x215F 0x8140
1402
is an abbreviation for
1411
Codes not listed are assumed to map through the identity (<Emphasis remap="it">i.e.</Emphasis> to
1412
the same numerical value). In order to override this default mapping,
1413
you may specify a range of codes to be undefined by using an
1414
`<Literal remap="tt">UNDEFINE</Literal>' line:
1420
or, for a single code,
1429
PostScript mappings are different. Every line in a PostScript mapping
1430
maps a code to a glyph name
1438
and codes not explicitly listed are undefined.
1442
A mapping section ends with an <Literal remap="tt">ENDMAPPING</Literal> line
1448
After all the mappings have been defined, the file ends with an
1449
<Literal remap="tt">ENDENCODING</Literal> line
1458
In order to make future extensions to the format possible, lines
1459
starting with an unknown keyword are silently ignored, as are mapping
1460
sections with an unknown target.
1465
<Sect3 id="sec-symbol-fonts">
1466
<Title>Using symbol fonts </Title>
1469
Type 1 symbol fonts should be installed using the
1470
<Literal remap="tt">adobe-fontspecific</Literal> encoding.
1474
In an ideal world, all TrueType symbol fonts would be installed using
1475
one of the <Literal remap="tt">microsoft-symbol</Literal> and <Literal remap="tt">apple-roman</Literal> encodings. A
1476
number of symbol fonts, however, are not marked as such; such fonts
1477
should be installed using <Literal remap="tt">microsoft-cp1252</Literal>, or, for older fonts,
1478
<Literal remap="tt">microsoft-win3.1</Literal>.
1482
In order to guarantee consistent results (especially between
1483
Type 1 and TrueType versions of the same font), it is possible to
1484
define a special encoding for a given font. This has already been done
1485
for the <Literal remap="tt">ZapfDingbats</Literal> font; see the file
1486
`<Literal remap="tt">encodings/adobe-dingbats.enc</Literal>'.
1491
<Sect3 id="sec-incorrect-encoding" xreflabel="Incorrectly encoded fonts">
1492
<Title>Hints about using badly encoded fonts </Title>
1495
A number of text fonts are incorrectly encoded. Incorrect encoding
1496
is sometimes done by design, in order to make a font for an exotic
1497
script appear like an ordinary Western text font on systems which are
1498
not easily extended with new locale data. It is often the result of
1499
the font designer's laziness or incompetence; for some reason, most
1500
people seem to find it easier to invent idiosyncratic glyph names
1501
rather than follow the Adobe glyph list.
1505
There are two ways of dealing with such fonts: using them with the
1506
encoding they were designed for, and creating an <Emphasis remap="it">ad hoc</Emphasis> encoding
1511
<Title>Using fonts with the designer's encoding</Title>
1514
In the case of Type 1 fonts, the font designer can specify a
1515
default encoding; this encoding is requested by using the
1516
`<Literal remap="tt">adobe-fontspecific</Literal>' encoding in the XLFD name. Sometimes, the
1517
font designer omitted to specify a reasonable default encoding, in
1518
which case you should experiment with `<Literal remap="tt">adobe-standard</Literal>',
1519
`<Literal remap="tt">iso8859-1</Literal>', `<Literal remap="tt">microsoft-cp1252</Literal>', and
1520
`<Literal remap="tt">microsoft-win3.1</Literal>'. (The encoding `<Literal remap="tt">microsoft-symbol</Literal>' doesn't
1521
make sense for Type 1 fonts).
1525
TrueType fonts do not have a default encoding. However, most TrueType
1526
fonts are designed with either Microsoft or Apple platforms in mind,
1527
so one of `<Literal remap="tt">microsoft-symbol</Literal>', `<Literal remap="tt">microsoft-cp1252</Literal>',
1528
`<Literal remap="tt">microsoft-win3.1</Literal>', or `<Literal remap="tt">apple-roman</Literal>' should yield reasonable
1535
<Title>Specifying an <Emphasis remap="it">ad hoc</Emphasis> encoding file</Title>
1538
It is always possible to define an encoding file to put the glyphs
1539
in a font in any desired order. Again, see the
1540
`<Literal remap="tt">encodings/adobe-dingbats.enc</Literal>' file to see how this is done.
1546
<Title>Specifying font aliases</Title>
1549
By following the directions above, you will find yourself with a
1550
number of fonts with unusual names --- with encodings such as
1551
`<Literal remap="tt">adobe-fontspecific</Literal>', `<Literal remap="tt">microsoft-win3.1</Literal>' <Emphasis remap="it">etc</Emphasis>. In order
1552
to use these fonts with standard applications, it may be useful to
1553
remap them to their proper names.
1557
This is done by writing a `<Literal remap="tt">fonts.alias</Literal>' file. The format of this file
1558
is very simple: it consists of a series of lines each mapping an alias
1559
name to a font name. A `<Literal remap="tt">fonts.alias</Literal>' file might look as follows:
1562
"-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \
1563
"-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific"
1566
(both XLFD names on a single line). The syntax of the
1567
`<Literal remap="tt">fonts.alias</Literal>' file is more precisely described in the
1569
URL="mkfontdir.1.html"
1570
>mkfontdir(1)</ULink
1581
<Title>Additional notes about scalable core fonts</Title>
1584
The FreeType (libfreetype-xtt2) backend (module `<Literal remap="tt">freetype</Literal>',
1585
formerly known as <Emphasis remap="it">xfsft</Emphasis>) is able to deal with both TrueType and
1586
Type 1 fonts. This puts it in conflict with the X-TT and Type 1
1587
backends respectively.
1591
If both the FreeType and the Type 1 backends are loaded, the
1592
FreeType backend will be used for Type 1 fonts. If both the
1593
FreeType and X-TT backends are loaded, X-TT will be used for TrueType
1598
<Title>About the <Emphasis remap="it">FreeType</Emphasis> backend</Title>
1601
The <Emphasis remap="it">FreeType</Emphasis> (libfreetype-xtt2) backend (formerly <Emphasis remap="it">xfsft</Emphasis>)
1602
is a backend based on version 2 of the FreeType library (see <ULink
1603
URL="http://www.freetype.org/"
1604
>the FreeType web site</ULink
1606
the X-TT functionalities for CJKV support provided by the After X-TT
1608
URL="http://x-tt.sourceforge.jp/"
1609
>the After X-TT Project web site</ULink
1610
>). The <Emphasis remap="it">FreeType</Emphasis> module has support for the
1611
``fontenc'' style of internationalisation (see <XRef LinkEnd="sec-fontenc">). This backend supports TrueType font files
1612
(`<Literal remap="tt">*.ttf</Literal>'), OpenType font files (`<Literal remap="tt">*.otf</Literal>'), TrueType Collections
1613
(`<Literal remap="tt">*.ttc</Literal>'), OpenType Collections (`<Literal remap="tt">*.otc</Literal>') and Type 1 font
1614
files (`<Literal remap="tt">*.pfa</Literal>' and `<Literal remap="tt">*.pfb</Literal>').
1618
In order to access the faces in a TrueType Collection file, the face
1619
number must be specified in the fonts.dir file before the filename,
1620
within a pair of colons, or by setting the 'fn' TTCap option. For example,
1626
:1:mincho.ttc -misc-pmincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
1632
refers to face 1 in the `<Literal remap="tt">mincho.ttc</Literal>' TrueType Collection file.
1636
The new <Emphasis remap="it">FreeType</Emphasis> backend supports the extended
1637
`<Literal remap="tt">fonts.dir</Literal>' syntax introduced by X-TrueType with a number
1638
of options, collectively known as `TTCap'. A `TTCap' entry follows the
1651
and should be specified before the filename. The new <Emphasis remap="it">FreeType</Emphasis>
1652
almost perfectly supports TTCap options that are compatible with X-TT
1653
1.4. The Automatic Italic (`<Literal remap="tt">ai</Literal>'), Double Strike (`<Literal remap="tt">ds</Literal>') and
1654
Bounding box Width (`<Literal remap="tt">bw</Literal>') options are indispensable in CJKV.
1661
mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
1662
ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1990-0
1663
ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0208.1990-0
1664
ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0208.1990-0
1665
bw=0.5:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
1666
bw=0.5:ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0201.1976-0
1667
bw=0.5:ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0201.1976-0
1668
bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
1674
setup the complete combination of jisx0208 and jisx0201 using mincho.ttc
1675
only. More information on the TTCap syntax is found on <ULink
1676
URL="http://x-tt.sourceforge.jp/"
1677
>the After X-TT Project page</ULink
1682
The <Emphasis remap="it">FreeType</Emphasis> backend uses the <Emphasis remap="it">fontenc</Emphasis> layer in order to support
1683
recoding of fonts; this was described in <XRef LinkEnd="sec-fontenc"> and especially <XRef LinkEnd="sec-fontenc-freetype"> earlier in this document.
1688
<Sect3 id="sec-X-TT">
1689
<Title>About the <Emphasis remap="it">X-TrueType</Emphasis> TrueType backend </Title>
1692
The `X-TrueType' backend is a backend based on version 1 of the FreeType
1693
library. X-TrueType doesn't use the `fontenc' layer for managing font
1694
encodings, but instead uses its own database of encodings.
1698
Since the functionalities for CJKV support introduced by X-TT have been
1699
merged into the new <Emphasis remap="it">FreeType</Emphasis> backend, the X-TT backend will be
1700
removed from X11R's tree near the future. Therefore, the use of
1701
<Emphasis remap="it">FreeType</Emphasis> backend is preferred over the X-TT backend.
1705
General information on X-TrueType may be found at <ULink
1706
URL="http://x-tt.sourceforge.jp/"
1707
>the After X-TT Project page</ULink
1714
<Title>Delayed glyph rasterisation</Title>
1717
When loading a proportional fonts which contain a huge number of glyphs,
1718
the old <Emphasis remap="it">FreeType</Emphasis> delayed glyph rasterisation until the time at which
1719
the glyph was first used. The new FreeType (libfreetype-xtt2) has an
1720
improved `very lazy' metric calculation method to speed up the process when
1721
loading TrueType or OpenType fonts. Although the <Emphasis remap="it">X-TT</Emphasis> module also
1722
has this method, the "<Literal remap="tt">vl=y</Literal>" TTCap option must be set if you want to
1723
use it. This is the default method for <Emphasis remap="it">FreeType</Emphasis> when it loads
1724
multi-byte fonts. Even if you use a unicode font which has tens of
1725
thousands of glyphs, this delay will not be worrisome as long as you use
1726
the new <Emphasis remap="it">FreeType</Emphasis> backend -- its `very lazy' method is super-fast.
1730
The maximum error of bitmap position using `very lazy' method is 1 pixel,
1731
and is the same as that of a character-cell spacing. When the X-TT
1732
backend is used with the `<Literal remap="tt">vl=y</Literal>' option, a chipped bitmap is displayed
1733
with certain fonts. However, the new FreeType backend has minimal problem
1734
with this, since it corrects left- and right-side bearings using
1735
`italicAngle' in the TrueType/OpenType post table, and does automatic
1736
correction of bitmap positions when rasterisation so that chipped bitmaps
1737
are not displayed. Nevertheless if you don't want to use the `very lazy'
1738
method when using multi-bytes fonts, set `<Literal remap="tt">vl=n</Literal>' in the TTCap option to
1745
vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1
1751
Of course, both backends also support an optimisation for character-cell
1752
fonts (fonts with all glyph metrics equal, or terminal fonts). A font
1753
with an XLFD specifying a character-cell spacing `<Literal remap="tt">c</Literal>', as in
1759
-misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
1771
fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
1777
will not compute the metric for each glyph, but instead
1778
trust the font to be a character-cell font. You are
1779
encouraged to make use of this optimisation when useful, but be warned
1780
that not all monospaced fonts are character-cell fonts.
1789
<Sect1 id="sec-background" xreflabel="Appendix: Background">
1790
<Title>Appendix: background and terminology </Title>
1793
<Title>Characters and glyphs</Title>
1796
A computer text-processing system inputs keystrokes and outputs
1797
<Emphasis remap="it">glyphs</Emphasis>, small pictures that are assembled on paper or on a
1798
computer screen. Keystrokes and glyphs do not, in general, coincide:
1799
for example, if the system does generate ligatures, then to the
1800
sequence of two keystrokes <<Literal remap="tt">f</Literal>><<Literal remap="tt">i</Literal>> will typically
1801
correspond a single glyph. Similarly, if the system shapes Arabic
1802
glyphs in a vaguely reasonable manner, then multiple different glyphs
1803
may correspond to a single keystroke.
1807
The complex transformation rules from keystrokes to glyphs are usually
1808
factored into two simpler transformations, from keystrokes to
1809
<Emphasis remap="it">characters</Emphasis> and from characters to glyphs. You may want to think
1810
of characters as the basic unit of text that is stored <Emphasis remap="it">e.g.</Emphasis> in
1811
the buffer of your text editor. While the definition of a character
1812
is intrinsically application-specific, a number of standardised
1813
collections of characters have been defined.
1817
A <Emphasis remap="it">coded character set</Emphasis> is a set of characters together with a
1818
mapping from integer codes --- known as <Emphasis remap="it">codepoints</Emphasis> --- to
1819
characters. Examples of coded character sets include US-ASCII,
1820
ISO 8859-1, KOI8-R, and JIS X 0208(1990).
1824
A coded character set need not use 8 bit integers to index characters.
1825
Many early systems used 6 bit character sets, while 16 bit (or more)
1826
character sets are necessary for ideographic writing systems.
1831
<Sect2 id="sec-xlfd">
1832
<Title>Font files, fonts, and XLFD </Title>
1835
Traditionally, typographers speak about <Emphasis remap="it">typefaces</Emphasis> and
1836
<Emphasis remap="it">founts</Emphasis>. A typeface is a particular style or design, such as
1837
Times Italic, while a fount is a molten-lead incarnation of a given
1838
typeface at a given size.
1842
Digital fonts come in <Emphasis remap="it">font files</Emphasis>. A font file contains the
1843
information necessary for generating glyphs of a given typeface, and
1844
applications using font files may access glyph information in an
1849
Digital fonts may consist of bitmap data, in which case they are said
1850
to be <Emphasis remap="it">bitmap fonts</Emphasis>. They may also consist of a mathematical
1851
description of glyph shapes, in which case they are said to be
1852
<Emphasis remap="it">scalable fonts</Emphasis>. Common formats for scalable font files are
1853
<Emphasis remap="it">Type 1</Emphasis> (sometimes incorrectly called <Emphasis remap="it">ATM fonts</Emphasis> or
1854
<Emphasis remap="it">PostScript fonts</Emphasis>), <Emphasis remap="it">TrueType</Emphasis> and <Emphasis remap="it">OpenType</Emphasis>.
1858
The glyph data in a digital font needs to be indexed somehow. How
1859
this is done depends on the font file format. In the case of
1860
Type 1 fonts, glyphs are identified by <Emphasis remap="it">glyph names</Emphasis>. In the
1861
case of TrueType fonts, glyphs are indexed by integers corresponding
1862
to one of a number of indexing schemes (usually Unicode --- see below).
1866
The X11 core fonts system uses the data in a font file to generate
1867
<Emphasis remap="it">font instances</Emphasis>, which are collections of glyphs at a given size
1868
indexed according to a given encoding.
1872
X11 core font instances are usually specified using a notation known
1873
as the <Emphasis remap="it">X Logical Font Description</Emphasis> (XLFD). An XLFD starts with a
1874
dash `<Literal remap="tt">-</Literal>', and consists of fourteen fields separated by dashes,
1878
-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
1881
Or particular interest are the last two fields `<Literal remap="tt">iso8859-1</Literal>', which
1882
specify the font instance's encoding.
1886
A scalable font is specified by an XLFD which contains zeroes instead
1890
-adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
1896
X11 font instances may also be specified by short name. Unlike an
1897
XLFD, a short name has no structure and is simply a conventional name
1898
for a font instance. Two short names are of particular interest, as
1899
the server will not start if font instances with these names cannot be
1900
opened. These are `<Literal remap="tt">fixed</Literal>', which specifies the fallback font to
1901
use when the requested font cannot be opened, and `<Literal remap="tt">cursor</Literal>', which
1902
specifies the set of glyphs to be used by the mouse pointer.
1906
Short names are usually implemented as aliases to XLFDs; the
1907
standard `<Literal remap="tt">fixed</Literal>' and `<Literal remap="tt">cursor</Literal>' aliases are defined in
1910
/usr/X11R6/lib/X11/font/misc/fonts.alias
1918
<Title>Unicode</Title>
1922
URL="http://www.unicode.org"
1924
>) is a coded character
1925
set with the goal of uniquely identifying all characters for all
1926
scripts, current and historical. While Unicode was explicitly not
1927
designed as a glyph encoding scheme, it is often possible to use it as
1932
Unicode is an <Emphasis remap="it">open</Emphasis> character set, meaning that codepoint
1933
assignments may be added to Unicode at any time (once specified,
1934
though, an assignment can never be changed). For this reason, a
1935
Unicode font will be <Emphasis remap="it">sparse</Emphasis>, meaning that it only defines glyphs
1936
for a subset of the character registry of Unicode.
1940
The Unicode standard is defined in parallel with the international
1941
standard ISO 10646. Assignments in the two standards are always
1942
equivalent, and we often use the terms <Emphasis remap="it">Unicode</Emphasis> and
1943
<Emphasis remap="it">ISO 10646</Emphasis> interchangeably.
1947
When used in the X11 core fonts system, Unicode-encoded fonts should
1948
have the last two fields of their XLFD set to `<Literal remap="tt">iso10646-1</Literal>'.
1956
<Title>References</Title>
1959
X11R comes with extensive documentation in the form of manual
1960
pages and typeset documents. Before installing fonts, you really should
1962
URL="fontconfig.3.html"
1963
>fontconfig(3)</ULink
1966
URL="mkfontdir.1.html"
1967
>mkfontdir(1)</ULink
1968
> manual pages; other
1969
manual pages of interest include <ULink
1974
URL="Xserver.1.html"
1983
URL="xlsfonts.1.html"
1986
URL="showfont.1.html"
1988
>. In addition, you may want to read the X Logical
1989
Font Description document, by Jim Flowers, which is provided in the file
1990
`<Literal remap="tt">xc/doc/xlfd.PS.Z</Literal>'.
1995
URL="http://www.faqs.org/faqs/by-newsgroup/comp/comp.fonts.html"
1996
>comp.fonts FAQ</ULink
1998
which is unfortunately no longer being maintained, contains a wealth
1999
of information about digital fonts.
2003
Xft and Fontconfig are described on
2005
URL="http://www.fontconfig.org"
2006
>Keith Packard's Fontconfig site</ULink
2013
URL="http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/"
2014
>xfsft home page</ULink
2016
has been superseded by this document, and is now obsolete; you may
2017
however still find some of the information that it contains useful.
2019
URL="http://www.joerg-pommnitz.de/TrueType/xfsft.html"
2020
>Joerg Pommnitz' xfsft page</ULink
2022
is the canonical source for the `<Literal remap="tt">ttmkfdir</Literal>' utility, which is the
2023
ancestor of <Literal remap="tt">mkfontscale</Literal>.
2028
URL="http://www.pps.jussieu.fr/~jch/software/"
2029
>The author's software pages</ULink
2031
might or might not contain related scribbles and development versions
2036
The documentation of <Emphasis remap="it">X-TrueType</Emphasis> is available from <ULink
2037
URL="http://x-tt.sourceforge.jp/"
2038
>the After X-TT Project page</ULink
2043
A number of East-Asian CIDFonts are available from
2045
URL="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/"
2046
>O'Reilly's FTP site</ULink
2052
URL="http://www.unicode.org"
2053
>Unicode consortium site</ULink
2055
may be of interest, you are more likely to find what you need in
2056
Markus Kuhn's <ULink
2057
URL="http://www.cl.cam.ac.uk/~mgk25/unicode.html"
2058
>UTF-8 and Unicode FAQ</ULink
2063
The IANA RFC documents, available from a number of sites throughout
2064
the world, often provide interesting information about character set
2065
issues; see for example RFC 373.