The K Desktop Environment

Next Previous Table of Contents

2. Setup

Before using KFontinst, please make the neccessary changes to your system as detailed in this section.

Note: Item's within < & > are directory indicators - and you should (obviously) replace the usage of these with your particualr directory setup.

2.1 X

To configure X for KFontinst, do the following...

  1. Create a directory to contain the fonts to be managed by KFontinst - such as <X11 fonts>/Managed - on a RedHat system <X11 fonts> is /usr/X11R6/lib/X11/fonts
  2. Add this directory to /etc/X11/fs/config
  3. For XFree86 v4.0 you may need to perform a mkfontdir in this new directory, so that a fonts.dir with the value 0 is created. Apparently XFree86 v4 needs this even if the directory is empty.
  4. If you want KFontinst to be responsible for all TrueType and Type1 fonts, then remove their entries from the above file. Do not remove all entries from this file (/fs/config) however, as KFontinst only installs/manages TrueType and Type1 fonts - bitmap and Speedo fonts are not handled. However your system may rely upon some fonts within those directories - therefore it would not be a good idea to remove the directories containing bitmap or Speedo fonts.

To use TrueType fonts you must configure X for this. RedHat (v6.0 and later) include a modified version of xfs that has support for TrueType. XFree86 V4.0 also supports TrueType.

If you have decided to let KFontinst manage all your Type1 and TrueType fonts, and have removed their entries form fs/config - then you can re-install the fonts from these directories into your new directory by running KFontinst, and using the Type1 or TrueType directory as the disk directory, etc...

2.1.1 KDE/Qt

NOTE: If you're only concerned about StarOffice, and don't care about configuring KDE (or KOffice) for extended encodings, then ignore this section.

X can be made to use extended encoding schemes. However, Qt (at least in v1.44 & v2.1.0) has a pre-defined set of encoding schemes built in. It will allow you to access these on screen - but not in any PS generated output. Qt's preferred solution is that all fonts be installed as Unicode - however Qt does not print correctly using Unicode (note, this should be fixed for Qt2.2). However, if you enable your fonts for Unicode - so that they work for KWord, etc. - then you will not be able to acces the extended encoding schemes using StarOffice.

If you wish to use Unicode fonts with KWord (so that you can access symbols such as smart quotes, and the Euro), then I suggest you use KDE2's control centre to change the KDE fonts from "Helvetica" to "Arial". The reason for this is that KWord's character selection dialog only displays the system font - and the standard "Helvetica" font does not seem to include these extra symbols. Using KWord's character selection dialog - smart quotes, and the Euro, can be found in table 32.

2.2 Ghostscript

Ghostscript no longer needs any extra configuring, just select the appropriate "Fontmap" file within KFontinst's Settings dialog. Refer to Section 3

To use TrueType fonts with Ghostscript you may need to re-compile it.

2.3 StarOffice

(Note: This section refers often to <StarOffice xp3 directory>. For StarOffice 5.1a (and probably before), this directory will be in <Main StarOffice Dir>/xp3. Whereas for StarOffice 5.2 (and probably onwards), this is in <Main StarOffice Dir>/share/xp3.)

StarOffice requires a psstd.fonts file (which is similar, but not the same, as the fonts.dir & fonts.scale required by X), and a printer definition file. psstd.fonts will be edited by KFontinst to add entries for the fonts you install.

In order to use your fonts with StarOffice, KFontinst creates a file called X11.PS - this will be placed within <StarOffice xp3 directory>/ppds/. In order to use this you must add the following...

*Include: "./X11.PS"

...to the real printer file that you will be using. I use the SGENPRT.PS file, as this is for the generic postscript printer. I'm not 100% sure exactly where this Include line should be placed - but I place it above the lines in SGENPRT.PS containing Standard ROM. Printer definition files are located in <StarOffice xp3 directory>/ppds

(NOTE: This paragraph only applies to StarOffice versions before 5.2) If StarOffice has been setup as a network install - so that you can have multiple users, then each user will have their own copy of psstd.fonts (located in <User's StarOffice xp3 directory>/) - why I don't know, it seems very stupid to me, as the user can only access installed fonts anyway, so why bother????. You must, therefore, remove each user's psstd.fonts file and create a link to the real psstd.fonts file. (e.g. ln -s <StarOffice install xp3 dir>/psstds.fonts <User's StarOffice xp3 dir>/) This should be done as the user, so that they can remove their StarOffice directory should they chose to do so.

StarOffice requires .afm files to be located within <StarOffice xp3 directory>/fontmetrics/afm, to accomplish this KFontinst will create symbolic links from the real .afm files to this directory.

If you want to install StarOffice's supplied Type1 fonts using KFontinst - so that they are made available to all X apps, and Ghostscript - then you should (before running KFontinst) move the .afm files from <StarOffice xp3 directory>/fontmetrics/afm and the Type1 files from <StarOffice>/fonts/type1 to the same directory somewhere else. Then run KFontinst and install all of the fonts from your new directory (which can then be removed after successful installation).

When StarOffice prints, it attaches a file called xprinter.prolog to the start of the PS output. KFontinst comes (at present) with one modified version of this file:

If you decide to use the microsoft-cp1252 encoding scheme for X (so that you can access symbols such as the Euro), then upon system configuration - your existing xprinter.prolog will be renamed to xprinter.prolog.kfontinst_backup, and a symbolic link will be made from KFontinst's .xpp file to xprinter.prolog. If you later decide to use an encoding scheme for which there isn't a .xpp file, then xprinter.prolog.kfontinst_backup will be renamed back to xprinter.prolog.

microsoft-cp1252.xpp was produced by applying a patch, written by Michael Davis, to StarOffice's xprinter.prolog file.

If you want to use another X11 encoding scheme, then I'm sure it'd be possible to create a new .xpp file base upon this. (If you do, could you please Email me the file, and I'll include it in a later release of KFontinst - thanks.)

If you do decide to use one of these extra encodings - then please note when you come to select the characters in StarOffice's Autocorrect dialog, StarOffice seems to always just display the character map for "Times". If "Times" is not using the new encoding (and on my system it isn't) then you won't see your new characters! You can still however access them, and the required character codes are:

NOTE 1:

You do not need to do anything with StarOffice's spadmin to access your TrueType & Type1 fonts - simply installing them, and configuring your system for StarOffice, should be enough.

NOTE 2:

StarOffice is extremely, extremely fussy - it'll crash for the slightest little reason. For example if you try to access a font with a corrupt .afm file - instead of informing you so it'll just crash!. On my system I installed a Type1 Courier font - and StarOffice did not like this at all. When it crashed it gave the message (on the console) "SalFontStruct::Load !XLoadQueryFont( "-*-times-*-*-*--*-*-*-*-p-*-iso8859-1" ) ... please check your X11 installation" I'm not sure what this means, with repect to accessing a courier font, but I do know that both the times and the courier font were accessible to X. As it turned out, it was an error in the .afm file.

If you experience similar difficulties, please first of all process the .afm file of the font as described in section 3.6. If this does not solve the problem - then the only alternative is to exclude the font from StarOffice (refer to section 3.4).

2.4 AbiWord

AbiWord is still very much a work in progress - although it looks like it could be quite a good little word-processor (at least I hope it stays small!). Despite what it's documentation says it can be made to use TrueType fonts - all it needs is a .afm file (which KFontinst will create) for each .ttf file, and a little bit of hacking of the code...

When printing AbiWord will blat a copy of the font in to the PS output - this is OK for Type1 fonts, but not quite so good for TrueType fonts! I suggest you alter the AbiWord source code to disable embedding of fonts - to do this edit src/af/xap/unix/xap_UnixPSGraphics.cpp and remove the lines from if(!unixfont->openPFA()) to unixfont->closePFA(); (Note: This mod applies to AbiWord versions 0.7.8 & 0.7.9)

Also, AbiwWord needs an X font called "Times New Roman" to function correctly. To do this it supplies the Ghostscript fonts, and a fonts.dir/scale which has a different font mapped to "Times New Roman" - not a good idea in my opinion. If you have installed the real font for this (times.ttf) - then you're OK, otherwise you can't use KFontinst to handle the fonts for AbiWord. This is because KFontinst will only output the real names to the fonts.dir/scale files. You can always modify these files (fonts.scale & fonts.dir) by hand to provide this mapping - but KFontinst will overwrite your changes the next time it performs a system configuration.

To enable AbiWord to access the fonts installed with KFontinst...

  1. Remove <AbiSuite dir>/fonts directory. (Or rename it).
  2. ln -s <X11 fonts>/Managed <AbiSuite dir>/fonts

Next Previous Table of Contents