Contents 1. Introduction 2. pfa / pfb fonts 3. TTF fonts 4. Unicode peculiarities 5. Contact 1. Introduction --------------- AbiWord limits the fonts it makes available to the user to those located in /usr/local/AbiSuite/fonts directory (unless you chose different installation location) and in the locale-specific sub- directories of this directory (see the UnixLocale.txt document). A standard set of fonts is provided with AbiWord and these are located in this directory. If you wish to make an additional font available to AbiWord, you need to do the following: (1) Place the font into the fonts directory (or symlink it there, if it is located elsewhere on your machine). (2) Update the fonts.dir file. The detailed procedure for pfa/pfb fonts and for ttf fonts is slightly different and is descirbed below. 2. pfa / pfb fonts ------------------ If your font came with a vendor provided afm file, you should copy or symlink it alongside the pfa/pfb file. If not AW will generate the afm file automatically, but using a vendor provided afm file is preferable. To update the fonts.dir file, you should add an entry for the new font into fonts.scale and then either run mkfontdir, or add exactly the same to fonts.dir and increase the font count at the very top of the file accordingly. Your fonts probably came with a sample fonts.dir or fonts.scale file, but if you do not know what the entry in the fonts.scale should be, you can generate it using the utility ttmkfdir. If you are installing a font for a different encoding than iso8859-1, Things are slightly more complicated. When adding the entry for the font to fonts.scale (and fonts.dir) make sure that the last two parts of the line separated by a dash are set to adobe-fontspecific. Then you have to create a file called fonts.alias in where you alias the font to the actual encoding it is for. For instance if your font called BLAH is for iso8859-8, the entry in fonts.scale/fonts.dir should look something like: blah.pfa -...-BLAH-.........-adobe-fontspecific (the dots stand for whatever makes up your specific entry). The fonts.alias file should then contain the following line: -...-BLAH-.........-iso8859-8 -...-BLAH-.........-adobe-fontspecific Also, if the font name contains spaces, both parts of the alias line need to be enclosed in double quotes: "-...-BLAH-.........-iso8858-8" "-...-BLAH-.........-adobe-fontspecific" 3. TTF fonts ------------ ** As of the moment the ttf support only works for locales using encodings ** iso-8859-1 - 10, 13-16; utf-8 and koi8-r,u. Other encodings can be added ** on request. Your font server must support ttf fonts. Then, just as in the case of pfa fonts, you need to add an entry into fonts.scale, and you should use the same programme (ttmkfdir) to generate the entry from the font itself. Note, that in the case of ttf fonts, the utility will generate multiple entries, for a number of diferent encodings the font supports, just disregard those you do not need. Once fonts.scale is updated, run mkfontdir. The first time AW uses the new font, it will generate several support files, including a type 42 postscript font. IMPORTANT: if you decide to update a ttf font that you have used with AbiWord previously, you will need to remove the support files that AbiWord generated. If your font is called myfont.ttf, look for files myfont.afm, myfont.u2g and myfont.t42 and delete them, then install the updated ttf font. LOCALE ISSUES The type 42 PostScript font genrated by AW has to be coded to the correct encoding. When this font is generated by AW at run time, the encoding used will be that of the current locale. This can lead to potential problems if you use multiple locales. To avoid having your fonts encoded incorrectly, it is preferable to use the same procedure for installing fonts as described in the following note on multi-user environment. NOTE: TTF FONTS IN MULTI-USER ENVIRONMENT In order to be able to generate a PostScript output, AbiWord converts every ttf font it uses to a type 42 PostScript font and creates some additional support files. This is done automatically the very first time the font is used to print, but the user who is running AbiWord at that point MUST HAVE WRITE PERMISSION for the fonts directory. In an evironment where ordinary users do not have such a permission, the system administrator needs to ensure that the support files are created during the installation of the fonts. To do that, use the provided ttfadmin.sh script (located in AbiSuite/bin directory) to process all ttf fonts in an entire directory; use the directory as a command line parameter, for instance /usr/local/AbiSuite/bin/ttfadmin.sh /usr/local/AbiSuite/fonts/ ISO-8859-1 The second parameter is the required encoding. Supported encodings can be obtained by running `ttftool -e print`. (NB: do not move the ttfadmin.sh script, it expects to find the program ttftool in the directory where it is located.) 4. Unicode peculiarities ------------------------ If are using a UTF-8 locale, you need to install unicode fonts. To make XFree86 to treat a font as a Unicode font, you need to specify the encoding in the XLFD (the entry in the fonts.dir/fonts.scale file) as iso10646-1. To see if your font is treated as a Unicode font run `xlsfonts -ll -fn font_name'. This will dump out lot of information about your font, and somewhere among it should be values min_byte1 and max_byte1; if both of these are 0, then your font is being treated as 8-bit only font. In my experience it is not currently possible to use a pfa Type 1 or 2 font under XFree86 4.0.2 as a proper Unicode font; if you know how to make XFree treat a pfa font as a Unicode font, please let me know so that I can update this document. 5. Contact ---------- This file is part of AbiWord and was created and is maintained by .