The K Desktop Environment

Next Previous Table of Contents

3. Usage

KFontinst should be run as root as it needs to alter system files, and create files within system directories.

Another way is to chmod a+s kfontinst so that the program is run with root privilages, although I don't recommend this as it means anyone can play about with the system files.

Before installing, or uninstalling fonts, make sure that the directory, and other, settings are OK for your system. To do this open the Settings dialog by selecting Settings... from the File menu. This dialog contains the following elements...

3.1 Installing a font

  1. Change to the required directory - either select Change Disk Directory from the File menu, or click on the folder icon in the main window.
  2. Highlight the required fonts in the Disk list.
  3. Right click in the Disk list and select Install from the pop-up menu. This will copy the font file to the Install directory. If a corresponding .afm file exists for the font, then this .afm file will be copied to font directory as well.
  4. Select Configure System from the File menu. (Note you only need to configure the system after you have finished installing and uninstalling all your fonts - it is not neccessary after

    each install/uninstall).

If you install a font with the same basic filename (i.e. excluding extension) as an already existing one of the other type - then the filename will be modified to have a _kfi suffix. e.g.

You install a file caled courbi.pfa, and you already have courbi.ttf installed. courbi.pfa will be renamed to courbi_kfi.pfa when it is installed. (This is needed as .afm files have the same basic name as the font file - and obviously a different .afm file is needed for each font.)

3.2 Uninstalling a font

  1. Highlight the required fonts in the Install list.
  2. Right click in the Installed list and select Uninstall from the pop-up menu. This will either delete the font file from the Install directory, or move it to the Uninstall directory - depending upon your chosen setting (refer to the Settings dialog.
  3. Select Configure System from the File menu. (Note you only need to configure the system after you have finished installing and uninstalling all your fonts - it is not neccessary after each install/uninstall).

3.3 Excluding a font from StarOffice

As mentioned in section 2.3 / NOTE 2 StarOffice is extremely fussy when it comes to its font handling. Some fonts will cause it to just crash for no stated reason. Because of this KFontinst gives you the ability to exclude a font from StarOffice - when you configure your system no entries for excluded fonts will be placed into X11.PS, this will then cause StarOffice to ignore the font. This feature is accessible by right clicking on the installed font list window. Excluded fonts will have an asterisk (*) placed to the left of the filename. Fonts should be marked for exclusion prior to configuring your system.

Before excluding a font, please try processing the .afm file (as described in section 3.5) first.

3.4 Configuring the system

The process of installing, or uninstalling, a font does not actually make it yet available to your system - it just copies, or deletes, the font file. To actually produce the configuration files needed by the various parts you need to select Configure system from the File menu. This will produce a dialog with various options:
  1. X - fonts.dir & fonts.scale. These must be created so that X knows about your fonts.
  2. X - Use XXXX encoding. X can be configured to perform a remapping of a fonts internal character mapping on the fly. What happens is that when you try to acces the pictorial representation (called a `glyph') of say character #123 - X will use the reencoding scheme to actually get the glyph of character (e.g.) #4321 instead. This allows you to have access to the hundreds of glyphs that fonts contain. If you select this option, then any fonts that have the ability to use this encoding will be noted as so in fonts.dir and fonts.scale.
    • Use exclusively. If this option is selected, then for any fonts that can be reencoded to use the selected encoding scheme - the entries in fonts.dir and fonts.scale will be for this encoding only (i.e. no other encodings will be listed). This is needed for StarOffice - which seems to always choose iso8859-1 instead of any other encoding if it is available. Basically if your going to use an extended encoding - then select this option as well.
    • Force AFM regeneration. If you have selected a new encoding scheme, then it is possible that your AFM files may be out of date. Selecting this option will force the AFM creator (if 'Generate AFMs' is selected) to create new AFM files for TrueType fonts.
    NOTES:
    • Extended encodings apply only to TrueType fonts - and will only work with an xfsft based font server (such as the one supplied with RedHat 6).
    • microsoft-cp1252 is the encoding scheme used in Windoze to access extra characters (Euro, smart-quotes, etc).
    • As of Kfontinst V0.7, the encoding selected here will also be used within any newly generated .afm files.
    • If you select "Unicode" as the extended encoding scheme, then AFM file generation will default to using the fonts default charset.
  3. AFMs. AFM (Adobe Font Metric) files are required by AbiWord, StarOffice, and possibly other apps.
    • Generate. KFontinst will create a .afm file for each of your installed fonts. The files themselves are created by either the afm.pl perl script, or pf2afm.ps (included in the archive). These programs can be quite slow, therefore when configuring the sytem, if a .afm file already exists for a font then a new one is not created.
    • Force TrueType regeneration. If you have selected a new encoding scheme, then it is possible that your AFM files may be out of date. Selecting this option will force the AFM creator to create new AFM files for TrueType fonts.
  4. StarOffice. To use the fonts with StarOffice, it must obviously be configured. You will notice that it is not possible to configure StarOffice without configuring X, AFM files, and Ghostscript - this makes sense as StarOffice can only use the fonts available to X, and they can only be printed if Ghostscript is configured - plus StarOffice requires a .afm files for each font file.
  5. Ghostscript. In order to print Ghostscript must know about your fonts - to accomplish this KFontinst creates a Fontmap.X11 file, and this is placed within your Ghostscript directory.

If KFontinst complains that it could not configure/create something - this probably means that you do not have write permission on the files/directories that KFontinst needs to create/alter. If this happens then KFontinst will not try to configure any other part. The ordering of configuration/creation is:

  1. X (fonts.dir & fonts.scale)
  2. Ghostscript (Fontmap.X11)
  3. AFM files
  4. StarOffice (psstd.fonts & X11.PS)

Therefore, if Ghostscript cannot be configured, then KFontinst will stop there - no AFM files will be created, and StarOffice will not be configured.

There is no configuration option for AbiWord - as it does not require any setup files to be produced.

3.5 Processing AFM files

As mentioned before, StarOffice is very fussy - especially when it comes to .afm files. When installing a font, if a .afm file exists in the Disk directory at install time - then this file is also copied to the Install directory, and a .afm file is not created when the system is configured. (Any .afm files created by KFontinst will automatically be processed). If you have problems with StarOffice, or any other app, it could be due to an error in the .afm file. To, hopefully, solve this problem you can select Process AFM file from the Installed list window.

3.6 Deleting AFM files

When the system is configured, .afm files are only created if they do not already exist within the X11 fonts directory. This is because the creation of the .afm files can be very slow. However, this has the problem that if you change the X11 font encoding (see section 3.4) that you want to use then the .afm files will not be updated to reflect this mapping. To cure this, if you delete the font's .afm file before configuring with a new encoding then a new .afm file will be created to match this new encoding. If you select some fonts in the installed list, and select the "Delete AFM file..." option, then the .afm files for each of the selected fonts shall be deleted (after you have answered "Yes" to the displayed message box). Please note - at present, the reencoding of .afm files only applies to those created for TrueType fonts. Another way around this is to select the Force TrueType Regeneration option in the Setttings/AFM dialog.

3.7 Editing a TrueType font's Postscript names table

TrueType fonts contain a maping of glyph (pictorial representation of a character) to postscript names. Unfortunately not all TTF files have the correct names - for example I found that times.ttf had the Euro glyph mapped to the postscript name uni20AC instead of Euro. This would cause problems with Ghostscript - which would rely upon correct PS names. Therefore I have provided an option to "fix" the PS names in TTF files. If you select some .ttf files in either the installed or disk list, and select the "Fix TTF postscript names..." option you may "fix" the postscript name table of a TrueType font. The list of Unicode to glyph names to "fix" is stored in a file called psnames - which may be found in <KDE Dir>/apps/kfontinst/. This file has the following format:-

<Unicode value> <Postscript name>

If you find any other incorrectly named values, then please let me know - and I will extend the psnames file in the distributed archive.

Next Previous Table of Contents