| SkFontMngr Script Manual |
The skFont Manager (skFontMngr.py) is a stand alone Python/Tkinter and Pmw script that automates the Skencil font installation and removal process. Because font installation methods and utilities differ between all the flavors of Unix, the skFont Manager script is OS specific. In this case, SuSE Linux 8.2 and above specific (as indicated by the "(SuSE)" in the title.).
The skFont Manager script accepts PostScript Type 1 fonts (PFB and PFA) and True Type fonts (TTF) for installation. The AFM files for the PFB and PFA files are generated via Ghostscript's pf2afm script. The TTF files are converted to PFB, with associated AFM, via the ttf2pt1 program (SuSE RPM provided on this site).
The skFont Manager script runs the SuSEconfig font module to generate a fonts.dir and fonts.scale and other SuSE fontconfig specific font database files. Hence, the fonts installed are available to all applications that use the SuSE fontconfig setup. The final Skencil SFD font database file is created from the SuSEconfig generated fonts.dir file and a temporary Skencil SFD database file created by the mkfontdb_a.py Python script. This method of generating the Skencil SFD font database file ensures that the XLFD font names for X11 match that of Skencil. Lastly, the skFont Manager script creates a Ghostscript Fontmap sub-file via the mkfontdb_a.py Python script; making the fonts available to Ghostscript and the gv PS viewer. (mkfontdb_a.py is a slightly modified version of the mkfontdb.py script - also included in the Skencil RPM.)
The current skFont Manager script is version 0.1. This version is simply a "proof of concept"/"test" script. It is good enough to use, but is not intelligently written and is not easily modified to other Unix systems.
To fully integrate the Skencil font directory into the SuSE font system, select configuration files need to be altered. The following files are modified by the Skencil RPM:
For each configuration file the Skencil font directory path is added. For added assurance, a back up of each file is made before it is modified (the RPM "%post" script). The backup files are: XF86Config.before.skencil, config.before.skencil and Fontmap.before.skencil. The files are located in their respective directories.
On the removal of the Skencil binaries, the RPM "%postun" script will remove the lines added from the installation script. Again, a back up of each file is made before it is modified. The backup files are: XF86Config.after.skencil, config.after.skencil and Fontmap.after.skencil. The files are located in their respective directories.
You are free to delete these files if you don't like cruft on your system. The files are simply made for assurance.
Note: The Skencil font path for new fonts (the above 16 not include) is /usr/X11R6/lib/X11/fonts/skencil. Though all the configuration files relect this path (including Skencil's config.py), it is actualy a link to /usr/share/skencil/fonts. The Ghostscript URW fonts have a similar set up on SuSE linux.
Because font installation on Unix machines requires root privileges, skFont Manager must be run as root. It is possible to set the skFont Manager script with SUID permissions and run it as a non-root user Skencil script (This was originally done). But for security reasons, doing this may not be a good idea. (especially when I am not an experienced Python programmer!) In addition to the security issues, font changes do not take effect until X11 is restarted. So little is gained from running skFont Manager from Skencil as a non-root user. (This is the logic behind the final decision to run skFont Manager as stand alone.)
Font file utilities have the tendency to hang when a unfamiliar file is encountered. To avoid these hangs, skFont Manager contains a command line wrapper that times out the executed utility. This time out feature makes skFont Manager more Fault tolerant (it should not hang on a bad font). But it should be noted that timing out a process can produce less performance in certain situations (see next section).
Each font has 20 seconds to be converted (TTF) or copied to the Skencil font directory and an AFM created (PFB). SuSEconfig has 120 seconds to create the fonts.scale, fonts.dir and any other files SuSE Linux requires. The mkfontdb_a.py script has 60 seconds to make temporary SFD file and a Fontmap.skencil file. The final SFD file has not time limit.
The font conversion and processing times will differ between computers. The examples below were achieved on a 600MHz Celeron PC with 256MB of RAM. Computers with slower CPUs or lower RAM will obviously produce lesser results.
A good test for adding PostScript Type 1 fonts is to add all 78 of the ftp.gimp.org freefonts at once. The results are listed in Table 1 (below).
Note that 1 minute plus of the total time of installation was used timing out or dealing with bad fonts (almost half of total time). Four fonts fail the installation process because they are not identified as iso8859-1 or adobe-fontspecific by SuSEconfig (skFontManger also needed to go back a delete them.). These are the two valid encodings for fonts usable by Skencil.
| Total Time | Fonts Installed | Fonts Failed |
| 3 minutes | 74 (~ 1 min. 40 sec.) | 4 (~ 1 min. 20 sec. loss) |
Table 1 - Adding 78 PFBs results.
A good test for adding True Type fonts is to add all 389 of the True Type freefonts in the /usr/X11R6/lib/X11/fonts/truetype directory at once (provided by the SuSE 9.2 package free-ttf-fonts-1.0-158. KDE systems do not include this package.). The results are listed in Table 2 (below).
Note that about 20 minutes of the total installation time was used timing out bad fonts (estimate 20 seconds for each bad font. The vast majority of the failed fonts timed out.). This constitutes about 80% of the total time! Most fonts will take about 2 to 5 seconds to be converted. But, some fonts will take about 10 - 15 seconds to convert (this is especially true for slower CPUs), so 20 seconds is not too bad for a time-out duration. Unfortunately, it can dramatically slow down the total processing time if many fonts are installed at once.
| Total Time | Fonts Installed | Fonts Failed |
| 25 minutes | 331 (~ 5 min. 40 sec.) | 58 (~ 19 min. 20 sec. loss) |
Table 2 - Adding 389 TTFs results.
There are many sites on the World Wide Web that provide fonts. But, I don't think it is out of line to assume that most Skencil users want FREE fonts ;-) . The sites provided below are not endorsements! Rather, they are starting points for finding free fonts that I am aware of. You can do a simple Google or Yahoo search on "free fonts" to find wed sites that provide free fonts.
PostScript Type 1 Fonts:
1. The Gimp ftp site:
Use the files freefonts-0.10.tar.gz and sharefonts-0.10.tar.gz. The urw-fonts and urw-adobe tarballs are the Ghostscript URW PostScript fonts already installed by SuSE and accessed by Skencil - you don't need these files. Read the shareware font licenses so you understand the terms of use.
Not all the free and share fonts will function under every the versions of SuSE Linux (or any Unix system for that matter). In the case of SuSE 8.2 and SuSE 9.0 some fonts will even crash Skencil. SuSE 9.1 and 9.2 do not have this problem at all. Note that there are about two to three fonts of the 74 fonts that will not convert to curve - the rest do.
Below are lists of the Gimp ftp fonts to avoid for each SuSE version:
SuSE 8.2 and SuSE 9.0
These fonts will crash Skencil, and should not be installed (or removed if installed).
Free Fonts not to install (16 of 74):
| brahc___.pfb | calig___.pfb | dos_____.pfb | elann___.pfb |
| genoaita.pfb | genoarom.pfb | linotext.pfb | mazama.pfb |
| old_town.pfb | postanti.pfb | shaloold.pfb | shf_____.pfb |
| capri.pfb | tekton.pfb | vitoria.pfb | igloolas.pfb |
Share Fonts not to install (5 of 21):
| apollo.pfb | bu______.pfb | perrygot.pfb | romeo.pfb |
| sumdumgo.pfb |
SuSE 9.1 and 9.2
These fonts will not crash Skencil, but should still be removed.
Free Fonts not to install (2 of 74):
| linotext.pfb | old_town.pfb |
The font Old_Town (font file old_town.pfb) conflicts with the font file oldtwn_r.pfb which has the same font name. The font linotext (font file linotext.pfb) does not display correctly. (Note: linotext does not display correctly under Solaris or RedHat.)
Share Fonts not to install (0 of 21):
All 21 fonts function.
True Type Fonts:
1. 1001 Free Fonts web site:
Watch out when you click the above URL. It opens two windows. One for free fonts, the other for a $10 CD purchase. Quess which one opens as the top window? ;-)
Use the Windows versions of the True Type fonts offered - I know these to work. There are many quality fonts available. Note that some fonts are unfinished or experimental (not all the letters are implemented). Make sure to read the license that accompanies the font you download. Not all of the fonts are free (as advertised). Some are shareware and require payment for some uses. Most of the for pay fonts are $5.
From my experience, about 85% to 90% of the fonts I've downloaded convert to PFB without a any problems (under Solaris 8. I find that Linux gets even better results.). The ttf2pt1 font utility does an excelent job converting True Type fonts!
2. Freeware Fonts web site:
This web site is a launching point to other free True Type font web sites.
3. SuSE 9 CD (YaST2)
The SuSE package free-ttf-fonts-1.0-158 contains hundreds of True Type fonts. You can use YaST2 to install them. To be honest, most of the fonts are not very appealing (many are low quality). Some users may not find it worth adding hundreds of fonts to only install a few. Note that the converted PFBs and AFMs will be in the /usr/share/skencil/fonts directory. Thus once you add the fonts you want, you will no longer need the TTFs (the free-ttf-fonts-1.0-158 package).
Before you launch skFont Manager, you need to get and unpack fonts in a directory. True Type fonts will need to be unzipped, so make sure you have the unzip utility installed. The skFont Manager will only read files in a directory that have the extensions: pfa/PFA, pfb/PFB and ttf/TTF. If other files in the directory exist, they will not show up in the font selection list. (this can be useful for there is no need to delete all the other files that are unpacked with the font).
Fig. 1 - Start skFontMngr.py as root user..
To launch skFont Manager you need to open a terminal and login as root user. Note that you must use the su "-m" option. Without the "-m" option, skFont manager will not launch (Fig. 1 - above).
Fig. 2 - Open a directory to install fonts.
To access the font files select the "Add" drop menu and then the "Open Font Directory" option (Fig. 2, above). This action will open a directory file selection menu (Fig. 3, below). Note that there are other options to the "Add" drop menu. The first is the "Rebuild DB Files" option. This options will rebuild the font database files for all the font files currently in the Skencil font directory. This option is useful in a situation were an installation is aborted and not all the data base files are created or are incomplete. The second option simply allows you to save the content of the "Status/Log" window.
Fig. 3 - Select a directory that has PFB/A or TTF fonts.
The Directory selection menu only lists directories. Select the directory that houses the font files and click "OK" (Fig. 3, above).
Fig. 4 - Select the font files to add.
Once the list is loaded, you may select the font files to install. To select individual font files in a discontinuous manor, hold down the "Ctrl" key while selecting. To select a individual ranges, click the first font file, hold down the "Shift" and select the second font file above or below the first font selected. You can also drag out a selection range (Fig 4 - above).
To start the installation process simply click the "Add" button.
Fig. 5 - When done, a summary is printed to the log.
As the font installation process starts, the status of each step is recorded in the "Status/Log" window. A progress bar is also started. The progress bar reads each font conversion/installation as a single unit of progress (each 20 sec. max.) and the creating of a DB file as a single unit of progress (each from 60 sec. to 120 sec.). Thus the progress bar is not linear (The last steps, creating the DB files, are the longest unit wise).
Before the fonts can be used by Skencil (and other applications), you must log out of your current X session. At the KDE start menu simply select "Logout..." and "Login as different user" (SuSE 8.2 and 9.0) or "End Current Session" (SuSE 9.1 and 9.2). This sequence will return you to the login prompt. Log back in to your KDE session. The installed fonts are now available to Skencil.
Fig. 6 - After restarting the X session, the fonts are available to Skencil.
Once the user X session is restarted, the installed fonts are accessible to Skencil. Simply, start Skencil and check the Fonts menu ("Windows" -> "Font..."). See Fig. 6, above.
Fig. 1 - List the installed fonts.
To see the installed fonts select from the "Remove" drop menu the "List Installed Fonts" option. This option will list the fonts installed in the Skencil font directory (Note that this does not include the standard 16 font families). The list of fonts is not listed alphabetically, but rather are listed in order of installation. The top font is the first font installed and the bottom of the list is the last installed.
Another option to the "Remove" drop menu is the "Save Remove Log to File" option. This saves the content of the "Status/Log" window.
Fig. 2 - Select the fonts to remove.
Once the list of installed fonts is loaded to the selector, simply select the fonts to remove. The same selection rules for the "Add" font selection menu apply. The fonts are listed by the font name and style and the font file name separated by a colon. Hence, it is possible to remove a font if the font name or the file name is known. (Note that the "pfb" extension of the font file is omitted.)
To remove the selected font, simply click the "Remove" button (Fig. 2, above).
Fig. 3 - When done, a summary is printed to the log.
When the font removal process begins each step is recorded to the "Status/Log" window and a progress bar is started (Fig.3, above). Once the fonts are removed, select the "List Installed Fonts" option in the "Remove" drop menu to update the list. The fonts removed should vanish from the list. There is no need to restart the X session when a font is remove for Skencil. Note that this may not apply to other applications that use the fonts in the Skencil font directory.