7 X Version 11, Release 7.7
11 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
22 Configuring the core X11 fonts system
24 Fonts included with X11R7.7
27 The ClearlyU Unicode font family
28 Standard scalable fonts
29 The Bigelow & Holmes Luxi family
33 Core fonts and internationalisation
34 Additional notes about scalable core fonts
36 Appendix: background and terminology
39 Font files, fonts, and XLFD
46 This document describes the support for fonts in X11R7.7. Installing fonts is
47 aimed at the casual user wishing to install fonts in X11R7.7 the rest of the
48 document describes the font support in more detail.
50 We assume some familiarity with digital fonts. If anything is not clear to you,
51 please consult Appendix: background and terminology at the end of this document
52 for background information.
56 X11 includes two font systems: the original core X11 fonts system, which is
57 present in all implementations of X11, and the Xft fonts system, which may not
58 yet be distributed with implementations of X11 that are not based on either
59 XFree86 or X11R6.8 or later.
61 The core X11 fonts system is directly derived from the fonts system included
62 with X11R1 in 1987, which could only use monochrome bitmap fonts. Over the
63 years, it has been more or less happily coerced into dealing with scalable
64 fonts and rotated glyphs.
66 Xft was designed from the start to provide good support for scalable fonts, and
67 to do so efficiently. Unlike the core fonts system, it supports features such
68 as anti-aliasing and sub-pixel rasterisation. Perhaps more importantly, it
69 gives applications full control over the way glyphs are rendered, making fine
70 typesetting and WYSIWIG display possible. Finally, it allows applications to
71 use fonts that are not installed system-wide for displaying documents with
74 Xft is not compatible with the core fonts system: usage of Xft requires fairly
75 extensive changes to toolkits (user-interface libraries). While X.Org will
76 continue to maintain the core fonts system, toolkit authors are encouraged to
77 switch to Xft as soon as possible.
81 This section explains how to configure both Xft and the core fonts system to
82 access newly-installed fonts.
86 Xft has no configuration mechanism itself, it relies upon the fontconfig
87 library to configure and customise fonts. That library is not specific to the X
88 Window system, and does not rely on any particular font output mechanism.
90 Installing fonts in Xft
92 Fontconfig looks for fonts in a set of well-known directories that include all
93 of X11R7.7's standard font directories (“/usr/share/fonts/X11/*”) by default)
94 as well as a directory called “.fonts/” in the user's home directory.
95 Installing a font for use by Xft applications is as simple as copying a font
96 file into one of these directories.
98 $ cp lucbr.ttf ~/.fonts/
100 Fontconfig will notice the new font at the next opportunity and rebuild its
101 list of fonts. If you want to trigger this update from the command line, you
102 may run the command “fc-cache”.
106 In order to globally update the system-wide Fontconfig information on Unix
107 systems, you will typically need to run this command as root:
113 Fontconfig's behaviour is controlled by a set of configuration files: a
114 standard configuration file, “/etc/fonts/fonts.conf”, a host-specific
115 configuration file, “/etc/fonts/local.conf”, and a user-specific file called
116 “.fonts.conf” in the user's home directory (this can be overridden with the
117 “FONTCONFIG_FILE” environment variable).
119 Every Fontconfig configuration file must start with the following boilerplate:
121 <?xml version="1.0"?>
122 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
125 In addition, every Fontconfig configuration file must end with the following
130 The default Fontconfig configuration file includes the directory “˜/.fonts/” in
131 the list of directories searched for font files, and this is where
132 user-specific font files should be installed. In the unlikely case that a new
133 font directory needs to be added, this can be done with the following syntax:
135 <dir>/usr/local/share/fonts/</dir>
137 Another useful option is the ability to disable anti-aliasing (font smoothing)
138 for selected fonts. This can be done with the following syntax:
140 <match target="font">
141 <test qual="any" name="family">
142 <string>Lucida Console</string>
144 <edit name="antialias" mode="assign">
149 Anti-aliasing can be disabled for all fonts by the following incantation:
151 <match target="font">
152 <edit name="antialias" mode="assign">
157 Xft supports sub-pixel rasterisation on LCD displays. X11R7.7 should
158 automatically enable this feature on laptops and when using an LCD monitor
159 connected with a DVI cable; you can check whether this was done by typing
161 $ xdpyinfo -ext RENDER | grep sub-pixel
163 If this doesn't print anything, you will need to configure Render for your
164 particular LCD hardware manually; this is done with the following syntax:
166 <match target="font">
167 <edit name="rgba" mode="assign">
172 The string “rgb” within the “<const>”...“</const>” specifies the order of pixel
173 components on your display, and should be changed to match your hardware; it
174 can be one of “rgb” (normal LCD screen), “bgr” (backwards LCD screen), “vrgb”
175 (LCD screen rotated clockwise) or “vbgr” (LCD screen rotated counterclockwise).
177 Configuring applications
179 A growing number of applications use Xft in preference to the core fonts
180 system. Some applications, however, need to be explicitly configured to use
183 A case in point is XTerm, which can be set to use Xft by using the “-fa”
184 command line option or by setting the “XTerm*faceName” resource:
186 XTerm*faceName: Courier
190 $ xterm -fa "Courier"
192 For KDE applications, you should select “Anti-alias fonts” in the “Fonts” panel
193 of KDE's “Control Center”. Note that this option is misnamed: it switches KDE
194 to using Xft but doesn't enable anti-aliasing in case it was disabled by your
195 Xft configuration file.
197 Gnome applications and Mozilla Firefox will use Xft by default.
199 Configuring the core X11 fonts system
201 Installing fonts in the core system is a two step process. First, you need to
202 create a font directory that contains all the relevant font files as well as
203 some index files. You then need to inform the X server of the existence of this
204 new directory by including it in the font path.
206 Installing bitmap fonts
208 The X11R7.7 server can use bitmap fonts in both the cross-platform BDF format
209 and the somewhat more efficient binary PCF format. (X11R7.7 also supports the
210 obsolete SNF format.)
212 Bitmap fonts are normally distributed in the BDF format. Before installing such
213 fonts, it is desirable (but not absolutely necessary) to convert the font files
214 to the PCF format. This is done by using the command “bdftopcf”, e.g.
216 $ bdftopcf courier12.bdf
218 You may then want to compress the resulting PCF font files:
222 After the fonts have been converted, you should copy all the font files that
223 you wish to make available into a arbitrary directory, say “/usr/local/share/
224 fonts/bitmap/”. You should then create the index file “fonts.dir” by running
225 the command “mkfontdir” (please see the mkfontdir(1) manual page for more
228 $ mkdir /usr/local/share/fonts/bitmap/
229 $ cp *.pcf.gz /usr/local/share/fonts/bitmap/
230 $ mkfontdir /usr/local/share/fonts/bitmap/
232 All that remains is to tell the X server about the existence of the new font
233 directory; see Setting the server's font path below.
235 Installing scalable fonts
237 The X11R7.7 server supports scalable fonts in multiple formats, including
238 Type 1, TrueType, and OpenType/CFF. (Earlier versions of X11 also included
239 support for the Speedo and CID scalable font formats, but that is not included
240 in current releases.)
242 Installing scalable fonts is very similar to installing bitmap fonts: you
243 create a directory with the font files, and run “mkfontdir” to create an index
244 file called “fonts.dir”.
246 There is, however, a big difference: “mkfontdir” cannot automatically recognise
247 scalable font files. For that reason, you must first index all the font files
248 in a file called “fonts.scale”. While this can be done by hand, it is best done
249 by using the “mkfontscale” utility.
251 $ mkfontscale /usr/local/share/fonts/Type1/
252 $ mkfontdir /usr/local/share/fonts/Type1/
254 Under some circumstances, it may be necessary to modify the “fonts.scale” file
255 generated by mkfontscale; for more information, please see the mkfontdir(1) and
256 mkfontscale(1) manual pages and Core fonts and internationalisation later in
261 The CID-keyed font format was designed by Adobe Systems for fonts with large
262 character sets. The CID-keyed format is obsolete, as it has been superseded by
263 other formats such as OpenType/CFF and support for CID-keyed fonts has been
266 Setting the server's font path
268 The list of directories where the server looks for fonts is known as the font
269 path. Informing the server of the existence of a new font directory consists of
270 putting it on the font path.
272 The font path is an ordered list; if a client's request matches multiple fonts,
273 the first one in the font path is the one that gets used. When matching fonts,
274 the server makes two passes over the font path: during the first pass, it
275 searches for an exact match; during the second, it searches for fonts suitable
278 For best results, scalable fonts should appear in the font path before the
279 bitmap fonts; this way, the server will prefer bitmap fonts to scalable fonts
280 when an exact match is possible, but will avoid scaling bitmap fonts when a
281 scalable font can be used. (The “:unscaled” hack, while still supported, should
282 no longer be necessary in X11R7.7.)
284 You may check the font path of the running server by typing the command
288 Font path catalogue directories
290 You can specify a special kind of font path directory in the form catalogue:
291 <dir>. The directory specified after the catalogue: prefix will be scanned for
292 symlinks and each symlink destination will be added as a local font path entry.
294 The symlink can be suffixed by attributes such as 'unscaled', which will be
295 passed through to the underlying font path entry. The only exception is the
296 newly introduced 'pri' attribute, which will be used for ordering the font
297 paths specified by the symlinks.
299 An example configuration:
301 75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi
302 ghostscript:pri=60 -> /usr/share/fonts/default/ghostscript
303 misc:unscaled:pri=10 -> /usr/share/X11/fonts/misc
304 type1:pri=40 -> /usr/share/X11/fonts/Type1
305 type1:pri=50 -> /usr/share/fonts/default/Type1
307 This will add /usr/share/X11/fonts/misc as the first font path entry with the
308 attribute unscaled. This is functionally equivalent to setting the following
311 /usr/share/X11/fonts/misc:unscaled,
312 /usr/share/X11/fonts/75dpi:unscaled,
313 /usr/share/X11/fonts/Type1,
314 /usr/share/fonts/default/Type1,
315 /usr/share/fonts/default/ghostscript
317 Temporary modification of the font path
319 The “xset” utility may be used to modify the font path for the current session.
320 The font path is set with the command xset fp; a new element is added to the
321 front with xset +fp, and added to the end with xset fp+. For example,
323 $ xset +fp /usr/local/fonts/Type1
324 $ xset fp+ /usr/local/fonts/bitmap
326 Conversely, an element may be removed from the front of the font path with “
327 xset -fp”, and removed from the end with “xset fp-”. You may reset the font
328 path to its default value with “xset fp default”.
330 For more information, please consult the xset(1) manual page.
332 Permanent modification of the font path
334 The default font path (the one used just after server startup or after “xset fp
335 default”) may be specified in the X server's “xorg.conf” file. It is computed
336 by appending all the directories mentioned in the “FontPath” entries of the
337 “Files” section in the order in which they appear. If no font path is specified
338 in a config file, the server uses a default value specified when it was built.
340 FontPath "/usr/local/fonts/Type1"
342 FontPath "/usr/local/fonts/bitmap"
344 For more information, please consult the xorg.conf(5) manual page.
348 If you seem to be unable to use some of the fonts you have installed, the first
349 thing to check is that the “fonts.dir” files are correct and that they are
350 readable by the server (the X server usually runs as root, beware of
351 NFS-mounted font directories). If this doesn't help, it is quite possible that
352 you are trying to use a font in a format that is not supported by your server.
354 X11R7.7 supports the BDF, PCF, SNF, Type 1, TrueType, and OpenType font
355 formats. However, not all X11R7.7 servers come with all the font backends
358 On most platforms, the X11R7.7 servers no longer uses font backends from
359 modules that are loaded at runtime. The built in font support corresponds to
360 the functionality formerly provided by these modules:
362 ● "bitmap": bitmap fonts (“*.bdf”, “*.pcf” and “*.snf”);
364 ● "freetype": TrueType fonts (“*.ttf” and “*.ttc”), OpenType fonts (“*.otf”
365 and “*.otc”) and Type 1 fonts (“*.pfa” and “*.pfb”).
367 Fonts included with X11R7.7
369 Standard bitmap fonts
371 The Sample Implementation of X11 (SI) comes with a large number of bitmap
372 fonts, including the “fixed” family, and bitmap versions of Courier, Times,
373 Helvetica and some members of the Lucida family.
375 In X11R7.7, a number of these fonts are provided in Unicode-encoded font files
376 now. At build time, these fonts are split into font files encoded according to
377 legacy encodings, a process which allows us to provide the standard fonts in a
378 number of regional encodings with no duplication of work.
380 For example, the font file
382 /usr/share/fonts/X11/misc/6x13.bdf
386 -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
388 is a Unicode-encoded version of the standard “fixed” font with added support
389 for the Latin, Greek, Cyrillic, Georgian, Armenian, IPA and other scripts plus
390 numerous technical symbols. It contains over 2800 glyphs, covering all
391 characters of ISO 8859 parts 1-5, 7-10, 13-15, as well as all European IBM and
392 Microsoft code pages, KOI8, WGL4, and the repertoires of many other character
395 This font is used at build time for generating the font files
403 with respective XLFDs
405 -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
407 -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-15
408 -misc-fixed-medium-r-normal--13-120-75-75-c-60-koi8-r
410 The standard short name “fixed” is normally an alias for
412 -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
414 The ClearlyU Unicode font family
416 The ClearlyU family of fonts provides a set of 12 pt, 100 dpi proportional
417 fonts with many of the glyphs needed for Unicode text. Together, the fonts
418 contain approximately 7500 glyphs.
420 The main ClearlyU font has the XLFD
422 -mutt-clearlyu-medium-r-normal--17-120-100-100-p-101-iso10646-1
424 and resides in the font file
426 /usr/share/fonts/X11/misc/cu12.pcf.gz
428 Additional ClearlyU fonts include
430 -mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1
431 -mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-111-iso10646-1
432 -mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0
433 -mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0
435 The Alternate Glyphs font contains additional glyph shapes that are needed for
436 certain languages. A second alternate glyph font will be provided later for
437 cases where a character has more than one commonly used alternate shape (e.g.
440 The PUA font contains extra glyphs that are useful for certain rendering
443 The Arabic Extra font contains the glyphs necessary for characters that don't
444 have all of their possible shapes encoded in ISO 10646. The glyphs are roughly
445 ordered according to the order of the characters in the ISO 10646 standard.
447 The Ligature font contains ligatures for various scripts that may be useful for
448 improved presentation of text.
450 Standard scalable fonts
452 X11R7.7 includes all the scalable fonts distributed with X11R6.
454 Standard Type 1 fonts
456 The IBM Courier set of fonts cover ISO 8859-1 and ISO 8859-2 as well as Adobe
457 Standard Encoding. These fonts have XLFD
459 -adobe-courier-medium-*-*--0-0-0-0-m-0-*-*
461 and reside in the font files
463 /usr/share/fonts/X11/Type1/cour*.pfa
465 The Adobe Utopia set of fonts only cover ISO 8859-1 as well as Adobe Standard
466 Encoding. These fonts have XLFD
468 -adobe-utopia-*-*-normal--0-0-0-0-p-0-iso8859-1
470 and reside in the font files
472 /usr/share/fonts/X11/Type1/UT*.pfa
474 Finally, X11R7.7 also comes with Type 1 versions of Bitstream Courier and
475 Charter. These fonts have XLFD
477 -bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1
478 -bitstream-charter-*-*-normal--0-0-0-0-p-0-iso8859-1
480 and reside in the font files
482 /usr/share/fonts/X11/Type1/c*bt_.pfb
484 The Bigelow & Holmes Luxi family
486 X11R7.7 includes the Luxi family of scalable fonts, in both TrueType and Type 1
487 format. This family consists of the fonts Luxi Serif, with XLFD
489 -b&h-luxi serif-medium-*-normal--*-*-*-*-p-*-*-*
493 -b&h-luxi sans-medium-*-normal--*-*-*-*-p-*-*-*
495 and Luxi Mono, with XLFD
497 -b&h-luxi mono-medium-*-normal--*-*-*-*-m-*-*-*
499 Each of these fonts comes Roman, oblique, bold and bold oblique variants The
500 TrueType version have glyphs covering the basic ASCII Unicode range, the
501 Latin 1 range, as well as the Extended Latin range and some additional
502 punctuation characters. In particular, these fonts include all the glyphs
503 needed for ISO 8859 parts 1, 2, 3, 4, 9, 13 and 15, as well as all the glyphs
504 in the Adobe Standard encoding and the Windows 3.1 character set.
506 The glyph coverage of the Type 1 versions is somewhat reduced, and only covers
507 ISO 8859 parts 1, 2 and 15 as well as the Adobe Standard encoding.
509 The Luxi fonts are original designs by Kris Holmes and Charles Bigelow. Luxi
510 fonts include seriffed, sans serif, and monospaced styles, in roman and
511 oblique, and normal and bold weights. The fonts share stem weight, x-height,
512 capital height, ascent and descent, for graphical harmony.
514 The character width metrics of Luxi roman and bold fonts match those of core
515 fonts bundled with popular operating and window systems.
517 The license terms for the Luxi fonts are included in the file “COPYRIGHT.BH”,
518 as well as in the License document.
520 Charles Bigelow and Kris Holmes from Bigelow and Holmes Inc. developed the Luxi
521 typeface designs in Ikarus digital format.
523 URW++ Design and Development GmbH converted the Ikarus format fonts to TrueType
524 and Type1 font programs and implemented the grid-fitting "hints" and kerning
525 tables in the Luxi fonts.
527 For more information, please contact <design@bigelowandholmes.com> or <
528 info@urwpp.de>, or consult the URW++ web site.
530 An earlier version of the Luxi fonts was made available under the name Lucidux.
531 This name should no longer be used due to trademark uncertainties, and all
532 traces of the Lucidux name have been removed from X11R7.7.
534 More about core fonts
536 This section describes XFree86-created enhancements to the core X11 fonts
537 system that were adopted by X.Org.
539 Core fonts and internationalisation
541 The scalable font backends (Type 1 and TrueType) can automatically re-encode
542 fonts to the encoding specified in the XLFD in “fonts.dir”. For example, a
543 “fonts.dir” file can contain entries for the Type 1 Courier font such as
545 cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
546 cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2
548 which will lead to the font being recoded to ISO 8859-1 and ISO 8859-2
553 Two of the scalable backends (Type 1 and the FreeType TrueType backend) use a
554 common fontenc layer for font re-encoding. This allows these backends to share
555 their encoding data, and allows simple configuration of new locales
556 independently of font type.
558 Please note: the X-TrueType (X-TT) backend is not included in X11R7.7. That
559 functionality has been merged into the FreeType backend.
561 In the fontenc layer, an encoding is defined by a name (such as iso8859-1),
562 possibly a number of aliases (alternate names), and an ordered collection of
563 mappings. A mapping defines the way the encoding can be mapped into one of the
564 target encodings known to fontenc; currently, these consist of Unicode, Adobe
565 glyph names, and arbitrary TrueType “cmap”s.
567 A number of encodings are hardwired into fontenc, and are therefore always
568 available; the hardcoded encodings cannot easily be redefined. These include:
570 ● iso10646-1: Unicode;
572 ● iso8859-1: ISO Latin-1 (Western Europe);
574 ● iso8859-2: ISO Latin-2 (Eastern Europe);
576 ● iso8859-3: ISO Latin-3 (Southern Europe);
578 ● iso8859-4: ISO Latin-4 (Northern Europe);
580 ● iso8859-5: ISO Cyrillic;
582 ● iso8859-6: ISO Arabic;
584 ● iso8859-7: ISO Greek;
586 ● iso8859-8: ISO Hebrew;
588 ● iso8859-9: ISO Latin-5 (Turkish);
590 ● iso8859-10: ISO Latin-6 (Nordic);
592 ● iso8859-15: ISO Latin-9, or Latin-0 (Revised Western-European);
594 ● koi8-r: KOI8 Russian;
596 ● koi8-u: KOI8 Ukrainian (see RFC 2319);
598 ● koi8-ru: KOI8 Russian/Ukrainian;
600 ● koi8-uni: KOI8 “Unified” (Russian, Ukrainian, and Byelorussian);
602 ● koi8-e: KOI8 “European,” ISO-IR-111, or ECMA-Cyrillic;
604 ● microsoft-symbol and apple-roman: these are only likely to be useful with
605 TrueType symbol fonts.
607 Additional encodings can be added by defining encoding files. When a font
608 encoding is requested that the fontenc layer doesn't know about, the backend
609 checks the directory in which the font file resides (not necessarily the
610 directory with fonts.dir!) for a file named “encodings.dir”. If found, this
611 file is scanned for the requested encoding, and the relevant encoding
612 definition file is read in. The “mkfontdir” utility, when invoked with the “-e”
613 option followed by the name of a directory containing encoding files, can be
614 used to automatically build “encodings.dir” files. Please see the mkfontdir(1)
615 manual page for more details.
617 A number of encoding files for common encodings are included with X11R7.7.
618 Information on writing new encoding files can be found in Format of encoding
619 directory files and Format of encoding files later in this document.
621 Backend-specific notes about fontenc
625 For TrueType and OpenType fonts, the FreeType backend scans the mappings in
626 order. Mappings with a target of PostScript are ignored; mappings with a
627 TrueType or Unicode target are checked against all the cmaps in the file. The
628 first applicable mapping is used.
630 For Type 1 fonts, the FreeType backend first searches for a mapping with a
631 target of PostScript. If one is found, it is used. Otherwise, the backend
632 searches for a mapping with target Unicode, which is then composed with a
633 built-in table mapping codes to glyph names. Note that this table only covers
634 part of the Unicode code points that have been assigned names by Adobe.
636 Specifying an encoding value of adobe-fontspecific for a Type 1 font disables
637 the encoding mechanism. This is useful with symbol and incorrectly encoded
638 fonts (see Hints about using badly encoded fonts below).
640 If a suitable mapping is not found, the FreeType backend defaults to
643 Format of encoding directory files
645 In order to use a font in an encoding that the font backend does not know
646 about, you need to have an “encodings.dir” file either in the same directory as
647 the font file used or in a system-wide location (“/usr/share/fonts/X11/
648 encodings/” by default).
650 The “encodings.dir” file has a similar format to “fonts.dir”. Its first line
651 specifies the number of encodings, while every successive line has two columns,
652 the name of the encoding, and the name of the encoding file; this can be
653 relative to the current directory, or absolute. Every encoding name should
654 agree with the encoding name defined in the encoding file. For example,
657 mulearabic-0 /usr/share/fonts/X11/encodings/mulearabic-0.enc
658 mulearabic-1 /usr/share/fonts/X11/encodings/mulearabic-1.enc
659 mulearabic-2 /usr/share/fonts/X11/encodings/mulearabic-2.enc
661 The name of an encoding must be specified in the encoding file's
662 “STARTENCODING” or “ALIAS” line. It is not enough to create an “encodings.dir”
665 If your platform supports it (it probably does), encoding files may be
666 compressed or gzipped.
668 The “encoding.dir” files are best maintained by the “mkfontdir” utility. Please
669 see the mkfontdir(1) manual page for more information.
671 Format of encoding files
673 The encoding files are “free form,” i.e. any string of whitespace is equivalent
674 to a single space. Keywords are parsed in a non-case-sensitive manner, meaning
675 that “size”, “SIZE”, and “SiZE” all parse as the same keyword; on the other
676 hand, case is significant in glyph names.
678 Numbers can be written in decimal, as in “256”, in hexadecimal, as in “0x100”,
679 or in octal, as in “0400”.
681 Comments are introduced by a hash sign “#”. A “#” may appear at any point in a
682 line, and all characters following the “#” are ignored, up to the end of the
685 The encoding file starts with the definition of the name of the encoding, and
686 possibly its alternate names (aliases):
688 STARTENCODING mulearabic-0
691 The name of the encoding and its aliases should be suitable for use in an XLFD
692 font name, and therefore contain exactly one dash “-”.
694 The encoding file may then optionally declare the size of the encoding. For a
695 linear encoding (such as ISO 8859-1), the SIZE line specifies the maximum code
700 For a matrix encoding, it should specify two numbers. The first is the number
701 of the last row plus one, the other, the highest column number plus one. In the
702 case of “jisx0208.1990-0” (JIS X 0208(1990), double-byte encoding, high bit
707 In the case of a matrix encoding, a “FIRSTINDEX” line may be included to
708 specify the minimum glyph index in an encoding. The keyword “FIRSTINDEX” is
709 followed by two integers, the minimum row number followed by the minimum column
714 In the case of a linear encoding, a “FIRSTINDEX” line is not very useful. If
715 for some reason however you chose to include on, it should be followed by a
718 Note that in most font backends inclusion of a “FIRSTINDEX” line has the side
719 effect of disabling default glyph generation, and this keyword should therefore
720 be avoided unless absolutely necessary.
722 Codes outside the region defined by the “SIZE” and “FIRSTINDEX” lines are
723 understood to be undefined. Encodings default to linear encoding with a size of
724 256 (0x100). This means that you must declare the size of all 16 bit encodings.
726 What follows is one or more mapping sections. A mapping section starts with a
727 “STARTMAPPING” line stating the target of the mapping. The target may be one
730 ● Unicode (ISO 10646):
734 ● a given TrueType “cmap”:
736 STARTMAPPING cmap 3 1
738 ● PostScript glyph names:
740 STARTMAPPING postscript
742 Every line in a mapping section maps one from the encoding being defined to the
743 target of the mapping. In mappings with a Unicode or TrueType mapping, codes
750 As an abbreviation, it is possible to map a contiguous range of codes in a
751 single line. A line consisting of three integers
753 <it/start/ <it/end/ <it/target/
755 is an abbreviation for the range of lines
765 For example, the line
769 is an abbreviation for
776 Codes not listed are assumed to map through the identity (i.e. to the same
777 numerical value). In order to override this default mapping, you may specify a
778 range of codes to be undefined by using an “UNDEFINE” line:
782 or, for a single code,
786 PostScript mappings are different. Every line in a PostScript mapping maps a
793 and codes not explicitly listed are undefined.
795 A mapping section ends with an ENDMAPPING line
799 After all the mappings have been defined, the file ends with an ENDENCODING
804 In order to make future extensions to the format possible, lines starting with
805 an unknown keyword are silently ignored, as are mapping sections with an
810 Type 1 symbol fonts should be installed using the adobe-fontspecific encoding.
812 In an ideal world, all TrueType symbol fonts would be installed using one of
813 the microsoft-symbol and apple-roman encodings. A number of symbol fonts,
814 however, are not marked as such; such fonts should be installed using
815 microsoft-cp1252, or, for older fonts, microsoft-win3.1.
817 In order to guarantee consistent results (especially between Type 1 and
818 TrueType versions of the same font), it is possible to define a special
819 encoding for a given font. This has already been done for the ZapfDingbats
820 font; see the file “encodings/adobe-dingbats.enc”.
822 Hints about using badly encoded fonts
824 A number of text fonts are incorrectly encoded. Incorrect encoding is sometimes
825 done by design, in order to make a font for an exotic script appear like an
826 ordinary Western text font on systems which are not easily extended with new
827 locale data. It is often the result of the font designer's laziness or
828 incompetence; for some reason, most people seem to find it easier to invent
829 idiosyncratic glyph names rather than follow the Adobe glyph list.
831 There are two ways of dealing with such fonts: using them with the encoding
832 they were designed for, and creating an ad hoc encoding file.
834 Using fonts with the designer's encoding
836 In the case of Type 1 fonts, the font designer can specify a default encoding;
837 this encoding is requested by using the “adobe-fontspecific” encoding in the
838 XLFD name. Sometimes, the font designer omitted to specify a reasonable default
839 encoding, in which case you should experiment with “adobe-standard”,
840 “iso8859-1”, “microsoft-cp1252”, and “microsoft-win3.1”. (The encoding
841 “microsoft-symbol” doesn't make sense for Type 1 fonts).
843 TrueType fonts do not have a default encoding. However, most TrueType fonts are
844 designed with either Microsoft or Apple platforms in mind, so one of
845 “microsoft-symbol”, “microsoft-cp1252”, “microsoft-win3.1”, or “apple-roman”
846 should yield reasonable results.
848 Specifying an ad hoc encoding file
850 It is always possible to define an encoding file to put the glyphs in a font in
851 any desired order. Again, see the “encodings/adobe-dingbats.enc” file to see
854 Specifying font aliases
856 By following the directions above, you will find yourself with a number of
857 fonts with unusual names --- with encodings such as “adobe-fontspecific”,
858 “microsoft-win3.1” etc. In order to use these fonts with standard applications,
859 it may be useful to remap them to their proper names.
861 This is done by writing a “fonts.alias” file. The format of this file is very
862 simple: it consists of a series of lines each mapping an alias name to a font
863 name. A “fonts.alias” file might look as follows:
865 "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \
866 "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific"
868 (both XLFD names on a single line). The syntax of the “fonts.alias” file is
869 more precisely described in the mkfontdir(1) manual page.
871 Additional notes about scalable core fonts
873 About the FreeType backend
875 The FreeType backend (formerly xfsft) is a backend based on version 2 of the
876 FreeType library (see the FreeType web site) and has the X-TT functionalities
877 for CJKV support provided by the After X-TT Project (see the After X-TT Project
878 web site). The FreeType backend has support for the “fontenc” style of
879 internationalisation (see The fontenc layer). This backend supports TrueType
880 font files (“*.ttf”), OpenType font files (“*.otf”), TrueType Collections
881 (“*.ttc”), OpenType Collections (“*.otc”) and Type 1 font files (“*.pfa” and
884 In order to access the faces in a TrueType Collection file, the face number
885 must be specified in the fonts.dir file before the filename, within a pair of
886 colons, or by setting the 'fn' TTCap option. For example,
888 :1:mincho.ttc -misc-pmincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
890 refers to face 1 in the “mincho.ttc” TrueType Collection file.
892 The new FreeType backend supports the extended “fonts.dir” syntax introduced by
893 X-TrueType with a number of options, collectively known as “TTCap”. A “TTCap”
894 entry follows the general syntax
898 and should be specified before the filename. The new FreeType almost perfectly
899 supports TTCap options that are compatible with X-TT 1.4. The Automatic Italic
900 (“ai”), Double Strike (“ds”) and Bounding box Width (“bw”) options are
901 indispensable in CJKV. For example,
903 mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
904 ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1990-0
905 ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0208.1990-0
906 ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0208.1990-0
907 bw=0.5:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
908 bw=0.5:ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0201.1976-0
909 bw=0.5:ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0201.1976-0
910 bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
912 setup the complete combination of jisx0208 and jisx0201 using mincho.ttc only.
913 More information on the TTCap syntax is found on the After X-TT Project page.
915 The FreeType backend uses the fontenc layer in order to support recoding of
916 fonts; this was described in The fontenc layer and especially The FreeType
917 backend earlier in this document.
919 Delayed glyph rasterisation
921 When loading a proportional fonts which contain a huge number of glyphs, the
922 old FreeType delayed glyph rasterisation until the time at which the glyph was
923 first used. The new FreeType (libfreetype-xtt2) has an improved “very lazy”
924 metric calculation method to speed up the process when loading TrueType or
925 OpenType fonts. Although the X-TT module also has this method, the "vl=y" TTCap
926 option must be set if you want to use it. This is the default method for
927 FreeType when it loads multi-byte fonts. Even if you use a unicode font which
928 has tens of thousands of glyphs, this delay will not be worrisome as long as
929 you use the new FreeType backend -- its “very lazy” method is super-fast.
931 The maximum error of bitmap position using “very lazy” method is 1 pixel, and
932 is the same as that of a character-cell spacing. When the X-TT backend is used
933 with the “vl=y” option, a chipped bitmap is displayed with certain fonts.
934 However, the new FreeType backend has minimal problem with this, since it
935 corrects left- and right-side bearings using “italicAngle” in the TrueType/
936 OpenType post table, and does automatic correction of bitmap positions when
937 rasterisation so that chipped bitmaps are not displayed. Nevertheless if you
938 don't want to use the “very lazy” method when using multi-bytes fonts, set “vl=
939 n” in the TTCap option to disable it:
941 vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1
943 Of course, both backends also support an optimisation for character-cell fonts
944 (fonts with all glyph metrics equal, or terminal fonts). A font with an XLFD
945 specifying a character-cell spacing “c”, as in
947 -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
951 fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
953 will not compute the metric for each glyph, but instead trust the font to be a
954 character-cell font. You are encouraged to make use of this optimisation when
955 useful, but be warned that not all monospaced fonts are character-cell fonts.
957 Appendix: background and terminology
959 Characters and glyphs
961 A computer text-processing system inputs keystrokes and outputs glyphs, small
962 pictures that are assembled on paper or on a computer screen. Keystrokes and
963 glyphs do not, in general, coincide: for example, if the system does generate
964 ligatures, then to the sequence of two keystrokes <f><i> will typically
965 correspond a single glyph. Similarly, if the system shapes Arabic glyphs in a
966 vaguely reasonable manner, then multiple different glyphs may correspond to a
969 The complex transformation rules from keystrokes to glyphs are usually factored
970 into two simpler transformations, from keystrokes to characters and from
971 characters to glyphs. You may want to think of characters as the basic unit of
972 text that is stored e.g. in the buffer of your text editor. While the
973 definition of a character is intrinsically application-specific, a number of
974 standardised collections of characters have been defined.
976 A coded character set is a set of characters together with a mapping from
977 integer codes --- known as codepoints --- to characters. Examples of coded
978 character sets include US-ASCII, ISO 8859-1, KOI8-R, and JIS X 0208(1990).
980 A coded character set need not use 8 bit integers to index characters. Many
981 early systems used 6 bit character sets, while 16 bit (or more) character sets
982 are necessary for ideographic writing systems.
984 Font files, fonts, and XLFD
986 Traditionally, typographers speak about typefaces and founts. A typeface is a
987 particular style or design, such as Times Italic, while a fount is a
988 molten-lead incarnation of a given typeface at a given size.
990 Digital fonts come in font files. A font file contains the information
991 necessary for generating glyphs of a given typeface, and applications using
992 font files may access glyph information in an arbitrary order.
994 Digital fonts may consist of bitmap data, in which case they are said to be
995 bitmap fonts. They may also consist of a mathematical description of glyph
996 shapes, in which case they are said to be scalable fonts. Common formats for
997 scalable font files are Type 1 (sometimes incorrectly called ATM fonts or
998 PostScript fonts), TrueType and OpenType.
1000 The glyph data in a digital font needs to be indexed somehow. How this is done
1001 depends on the font file format. In the case of Type 1 fonts, glyphs are
1002 identified by glyph names. In the case of TrueType fonts, glyphs are indexed by
1003 integers corresponding to one of a number of indexing schemes (usually Unicode
1006 The X11 core fonts system uses the data in a font file to generate font
1007 instances, which are collections of glyphs at a given size indexed according to
1010 X11 core font instances are usually specified using a notation known as the X
1011 Logical Font Description (XLFD). An XLFD starts with a dash “-”, and consists
1012 of fourteen fields separated by dashes, for example:
1014 -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
1016 Or particular interest are the last two fields “iso8859-1”, which specify the
1017 font instance's encoding.
1019 A scalable font is specified by an XLFD which contains zeroes instead of some
1022 -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
1024 X11 font instances may also be specified by short name. Unlike an XLFD, a short
1025 name has no structure and is simply a conventional name for a font instance.
1026 Two short names are of particular interest, as the server will not start if
1027 font instances with these names cannot be opened. These are “fixed”, which
1028 specifies the fallback font to use when the requested font cannot be opened,
1029 and “cursor”, which specifies the set of glyphs to be used by the mouse
1032 Short names are usually implemented as aliases to XLFDs; the standard “fixed”
1033 and “cursor” aliases are defined in
1035 /usr/share/font/X11/misc/fonts.alias
1039 Unicode (http://www.unicode.org) is a coded character set with the goal of
1040 uniquely identifying all characters for all scripts, current and historical.
1041 While Unicode was explicitly not designed as a glyph encoding scheme, it is
1042 often possible to use it as such.
1044 Unicode is an open character set, meaning that codepoint assignments may be
1045 added to Unicode at any time (once specified, though, an assignment can never
1046 be changed). For this reason, a Unicode font will be sparse, meaning that it
1047 only defines glyphs for a subset of the character registry of Unicode.
1049 The Unicode standard is defined in parallel with the international standard
1050 ISO 10646. Assignments in the two standards are always equivalent, and we often
1051 use the terms Unicode and ISO 10646 interchangeably.
1053 When used in the X11 core fonts system, Unicode-encoded fonts should have the
1054 last two fields of their XLFD set to “iso10646-1”.
1058 X11R7.7 comes with extensive documentation in the form of manual pages and
1059 typeset documents. Before installing fonts, you really should read the
1060 fontconfig(3) and mkfontdir(1) manual pages; other manual pages of interest
1061 include X(7), Xserver(1), xset(1), Xft(3), xlsfonts(1) and showfont(1). In
1062 addition, you may want to read the X Logical Font Description document by Jim
1065 The comp.fonts FAQ, which is unfortunately no longer being maintained, contains
1066 a wealth of information about digital fonts.
1068 Xft and Fontconfig are described on the Fontconfig site.
1070 The xfsft home page has been superseded by this document, and is now obsolete;
1071 you may however still find some of the information that it contains useful.
1072 Joerg Pommnitz' xfsft page is the canonical source for the “ttmkfdir” utility,
1073 which is the ancestor of mkfontscale.
1075 The author's software pages might or might not contain related scribbles and
1076 development versions of software.
1078 The documentation of X-TrueType is available from the After X-TT Project page.
1080 While the Unicode consortium site may be of interest, you are more likely to
1081 find what you need in Markus Kuhn's UTF-8 and Unicode FAQ.
1083 The IETF RFC documents, available from a number of sites throughout the world,
1084 often provide interesting information about character set issues; see for