The KDE Control Center

# Font Installer

This module is responsible for installing (and uninstalling) fonts. The installer will configure X (XFree86), XRender, (anti-aliasing), Ghostscript (printing), KDE and StarOffice, for any TrueType (.ttf) and Type1 (.pfa, .pfb) fonts that you care to install - bitmap (.bdf, .pcf, .snf), and Speedo (.spd), fonts will also be installed, but these can only used by X.

When the module is started by a normal (non-root) user, then the settings will refer to their personal configuration, and installed fonts will be available to them only. For root, the settings will usually refer to the system-wide configuration, and as such any installed fonts should be available to all users.

The module has two main modes of operation:

- Advanced In this mode the complete X11 folder structure is represented, and the module has a 'file manager' like appearance. In this mode all installed fonts can be displayed, and all types may be installed.
- Basic In this mode the X11 folder structure is hidden from the user, and only TrueType1 and Type1 fonts are shown and can be installed.

The module has 3 main tabs, and these are described in detail below.

## Fonts Tab

This tab is where the process of installing/uninstalling fonts takes place.

Installing a font is simply a matter of selecting the desired font in the "Install From" list, and pressing the "Install" button. In "Basic" mode, the "Change Folder" button may be used to select a different folder to install from. In "Advanced" mode, you must select a destination folder before the fonts may be installed.

Un-installing a font, again is simply a matter of selecting the desired font in the "Install To" list, and pressing the "Remove" button. This will either delete the font, or move it to a predefined folder - the configuration of this is performed in the "Settings" tab.

After you have finished installing and uninstalling fonts, you should then press the "Apply..." button - this 'activates' the changes, by altering the configuration files for X, XRender, Ghostscript, and StarOffice (for the rest of this help file, this process is referred to as the "Configure System" process).

#### Advanced Mode

In this mode, folders that are in X's font path are shown in bold, and those which are marked as "unscaled" are shown in italic.

When in "Advanced Mode", there is extra functionality available within the "Install to" list. This is activated by right clicking on an entry in the list. The functionality is:

- Fix TTF postscript names This option will alter the "Postscript" names table contained within a TrueType font, fixing errors as described in the "Install/Uninstall" section below.
- Create new sub-folder
- Delete folder
- Add to X font path This will add a folder X's font path - enabling the fonts within
- Remove from X font path Removes the folder from X's font path - disabling the fonts within
- "Touch" folder Marks the folder as having been modified - so that the installer will configure this folder the next time "Apply..." button is pressed. Folders which have fonts installed to / uninstalled from will automatically be marked as modified
- Set unscaled Tells X to not scale the fonts within the folder - this is only really applicable to folders with bitmap fonts, as these can look very ugly when scaled
- Set scaled Removes the "unscaled" property

Also added is the ability to install/uninstall complete folders.

## Anti-Aliasing Tab

This section is only available if your system supports the XRender extension for anti-aliasing.

Changes made using this tab are saved either when the "Save Changes" button of this tab, or the "Apply..." button of the "Fonts" tab, are pressed.

The configurable options are:

- Configuration file Here you can specify the name and location of the XRender configuration file. For normal (non-root) users - this file is uslually located in the user's home directory, and named `.xftconfig`. For root - this file is usually located in `/usr/X11R6/lib/X11` and named `XftConfig`.
- Exclude range This option allows you to specify a range of font sizes that should not be anti-aliased. On most systems, fonts between 8 and 12 points are not anti-aliased.
- Use sub-pixel hinting This may be of use if you are using an LCD screen.

### Anti Alias - Advanced

The majority of the text in the following comes from a posting by Danny Tholen to KDE dot news

Xft Introduction

Xft is an interface to the freetype rasterizer written by Keith Packard, member of the XFree86 Project, Inc. It allows applications to use fonts from the new X render extension using a unified font naming scheme. In /etc/X11/XftConfig (or /usr/X11R6/lib/X11/XftConfig) you will find a configuration file which can be adapted to suit your personal taste. Each Xft config file is capable of including other files - e.g. the system Xft configuration file (mentioned previously), can include a personal Xft config file (~/.xftconfig), so that each user may customise Xft to suit their own needs. Xft has two methods of including other files:

- include "<file-name>" If a file included this way does not exist, then Xft will complain.
- includeif "<file-name>" Files included this way will only be used if they actually exist - and Xft will not complain if they don't.

In the rest of this document I will explain the syntax and demonstrate some things you can do with this file. Structure The basic structure revolves around a 'pattern'. A pattern is a set of name/valuelist pairs, each valuelist contains one or more typed values. A certain application requests a font, for example:

family: "Arial"

size: 12

encoding: "iso8859-1"

A size 12 arial font in latin-1 encoding. The Xft extension will now try to patch this pattern to all of the fonts available in the system. And selecting the one with the best score. Before the matching is done Xft looks in XftConfig. The requested pattern can here be extended before use. An example is:

match any family == "Arial" edit antialias = true;

This will enable antialiasing for all fonts of the family Arial.

Also, the X server is queried to list all of its fonts; the XLFD contains just enough information to match fonts roughly.

Here's a list of attributes used in matching fonts (in priority order, this may not be up to date anymore!):

- foundry font foundry (string, like ¨monotype¨)
- encoding font encoding (string, like ¨iso8859-1¨)
- spacing font spacing (integers or proportional (0), mono (100), charcell (110))
- bold is the font bold? (boolean)
- italic is the font italic? (boolean)
- antialias is the font antialiased? (boolean)
- family font family (string)
- size font size (double)
- style font style (string, like "Bold Italic")
- slant font slant (roman, italic, oblique)
- weight font weight ( integers or light, medium, (100),demibold, bold, black)
- rasterizer not yet used (probably "TrueType", "Type1", ...)

Edit can be any of the above, plus:

- pixelsize font size in pixels (integer)
- charspace characer space (integer)
- minspace minimal spacing (integer)
- rgba color hinting (string ¨rgb¨ or ¨bgr¨ and vertical hinting ¨vrgb¨ ¨vbgr¨)
- xlfd server font (string, type xlsfonts to see a list of your xlfd strings)
- file the font file (string)
- core use X core fonts? (boolean)
- render use render fonts? (boolean)
- index I have no idea what this does:)
- scalable is the font scalable (boolean)
- scale scale the font (integer)
- charwidth character width (integer)
- charheight character height (integer)
- matrix no idea (not really at least)

How do I make aliases for my fonts?

I noted that my KDE console asks for ´mono´ fonts when it is looking for a fixed font. ´console´ is used when I select ´linux´ in the font menu of the KDE konsole. Therefore, I used two aliases for fonts which are also named ´fixed´:

`match any family == "fixed" edit family =+ "mono";`
`match any family == "console" edit family =+ "mono";```

Antialiasing my fonts makes me dizzy!

Although there is a big fuz around AA in X, good fonts actually look better if they are not antialiased. The antialiasing blurs the fonts by adding grey pixels to the edges, and this may strain your eyes if you looking at them for a long time. (Your eyes will try to get the fonts sharper, which ofcourse is not working because they are blurred;) However, for very small fonts, antialiasing may increase the readability of the fonts, because with sharp edges, there are to little pixels available for your mind to figure out what it means. And for bigger fonts, the edges become very jagged when not anitaliased, so here you also might want to have aliased fonts. Ofcourse you can also turn off the antialiasing for specific fonts. In other operating systems, most truetype fonts are not antialiased between 8 and 12 pixels, while only large Type1 fonts are antialiased.

Use the following in your XftConfig to antialias only fonts of specific sizes:

`match`
`any size > 8`
`any size < 15`
`edit`
`antialias = false;`

My fixed fonts do not appear or look _very_ wrong in the KDE konsole or similar programs!

I noted that somehow a lot of fixed font do not tell Xft that they are fixed, and thus, mono spaced. Therefore only a part of the font is displayed. We can manually set the spacing for these fonts (this assumes you have fixed aliased with mono as in above):
`match`
`any family == "mono"`
`edit`
`spacing = mono;`

My Symbol, Webdings, etc. fonts do not show up!

For some reason some (symbol) fonts are not correctly recognized, and Xft will show your default font, or a font which has the closest match (which is generally not what you mean at all). For Adobe Symbol and MS-webdings I did the following to get them working:

`match`
`any family == "webdings"`
`edit`
`antialias = false;`
`encoding += "glyphs-fontspecific";`
`match`
`any family == "symbol"`
`edit`
`antialias = false;`
`encoding += "glyphs-fontspecific";`

A usefull way of figuring out these things is to activate debuging with

`export XFT_DEBUG=1024`

This will generate a lot of output, especially if you have many fonts, because it lists the properties and scores of every font available. You can also use other values. For a nice summary of what happens (requested font, XftConfig substitutions, x server additions and the finally matched font), you can use XFT_DEBUG=2.

Why do my KDE programs start now soooo slow?

Currently, the Xft mechanism in XFree 4.0.3 has to parse the XftConfig file each time a program is started. And the info of all these fonts has to be read. Newer versions (in CVS) will use a cache and are much faster. Especially if you have many fonts this can be a problem, and the only real solution is to upgrade to a CVS version of XFree.

I have a LCD screen, can I use subpixel hinting instead of normal antialiasing?

Yes you can. Subpixel hinting uses colors instead of grey pixels to do the AA. I do not have a LCD screen so I do not have any idea of how it looks but you can play with the rgba setting. Try

`match edit rgba=bgr;`

or use rgb if you have a different type of monitor. For vertical AA you can try vbgr and vbgr.

My fonts still look bad!

If you do not have some good truetype fonts, it is worth to go and look for them on the internet. Other reasons why your fonts still look bad can be because of your build of freetype2. Snapshots versions before 2.0.2 were compiled with an option that had some patent issues. Therefore, the standard 2.0.2 compiles without this option. To fix this, download the freetype2 source rpm and change in
include/freetype/config/ftoption.h line 314:
`#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER`

## Settings Tab

This tab is used to customise the look and operation of the font installer.

### Appearance

Here you can alter the look and operation of the "Fonts" tab.

- Mode This selects between the two modes of operation, as described in the introduction section above.
- Font Lists Here you can select whether the lists of install-able and installed fonts should be side-by-side, or top-bottom.
- Custom preview string enter any desired preview string here, the default is "AaBbCcDdEeFf..."

### Folders & Files

The installer needs to know the location of certain folders and files in order to function correctly, this section is where most of those may be entered/altered.

- X - Fonts folder This should be the location of the top-level fonts folder - e.g. `~/.kde/share/fonts/` for normal users, and `/usr/X11R6/lib/X11/fonts/` for root.
- X - Basic Mode Sub-Folders These two combo-boxes allow you to specify the sub-folders, of the top-level fonts folder, where TrueType and Type1 fonts will be installed to in "Basic" mode.
- X - Configuration file This file is used to list/control the font paths used by X to locate font files. For normal users this will usually be `~/.kde/share/fonts/fontpaths`. For root, this file should be either the system wide `XF86Config` file, or the system-wide xfs `config` file.
- X - Encodings folder If your system supports the .enc style encoding files (used to specify alternative encoding schemes such as cp1252), then enter the location of the folder here. As this module does not alter the files in this folder - the folder's location can be the same for both non-root and root users.
- Ghostscript, Fontmap file This should be the name and location of the "Fontmap" file used by Ghostscript to map X font names to physical font files stored on disk. For non-root users, this file will be `~/.kde/share/fonts/Fontmap` - and for root it will be somthing like `/usr/share/ghostscript/5.50/Fontmap`. (The checkbox is used to tell the "Configure System" process to alter this file, or not.)

### Install/Uninstall

This section is used to specify the options for installing and uninstalling fonts.

- Upon Install - Fix TrueType Postscript names table Some TrueType fonts have a broken Postscript table - this table is used to map from the Postscript name for a character, to its character number (for example "space" is the Postscript name for the 'space' character, which usually has the character number of 32). At present only the "Euro" symbol is checked and corrected for (some fonts have this listed as "uni20ac").
- To Uninstall Here you can specify if fonts should be deleted or moved (to the specified folder) when they are 'uninstalled'

### StarOffice

Here you can specify whether StarOffice (if you have it installed) should be configured.

- Configure This checkbox is used to tell the "Configure System" process to also alter the StarOffice configuration files.
- Folder Specify the top level StarOffice installation folder.
- Use printer file Select the printer file you wish to be altered - this should be the same as the printer that you use in StarOffice. Generally this will be "Generic Printer (SGENPRT.PS)"

Note: This only applies to StarOffice versions < 6 - and is not applicable to OpenOffice. (StarOffice v6 onwards, and OpenOffice, have much improved font handling.)

### System

This section is used to specify system configuration options.

- General - Configure X to only use ??? encoding If this checkbox is not enabled, then each font will be installed with every encoding that it is capable of using. The problem comes with applications such as StarOffice which do not let you select the encoding of a font - so if you wanted to use "microsoft-cp1252" (which is a modified Latin1 encoding which allows access to the "Euro" and "smart quotes") with StarOffice you would have to install only this encoding, then StarOffice is forced to use it. The encoding selected here will only be used if the font supports it, if it doesn't then the other encodings that the font does support will be used instead.
- Generate AFMs, with ??? encoding AFMs (Adobe Font Metrics) are extra files, associated with each font, that contain detailed information about the sizes of each character in a font - these are then used by programs such as StarOffice to allow correct positioning of the character on the displayed and printed page. AFMs however can only contain one encoding, so here you may specify which one is to be used. (Note: AFMs are required by StarOffice - it will not use any font which does not have a corresponding AFM).
  - TrueType Indicates that AFMs should be created for TrueType fonts. (Note: AFMs are not required for TrueType fonts in OpenOffice or StarOffice >= v6)
  - Type1 Indicates the AFMs should be created for Type1 fonts. (Note: AFMs are required by all known versions of OpenOffice and StarOffice.)
- Command to Refresh X's Font List After the "Configure System" process, the command selected/entered here will be used to tell X to refresh its list of fonts. The following options are available:
  - xset fp rehash If you are not using an X font server, then this will usually be the command you need to use.
  - /etc/rc.d/init.d/xfs restart This command is used for the restarting of an X font server.
  - Custom If neither of the above two work, then you may enter a custom command here - for example, it may be that the X font server restart command is in another directory (e.g. `/etc/init.d/xfs restart`)