Skencil 0.6.x

Quick Installation and Basic Font Configuration Guide


SuSE Linux   (8.2, 9.0, 9.1 and 9.2)

A.   Notes:

This installation guide is an highly abridged version of a larger document I was working on. As an abridged document, it does not provide details needed to a fully understand the Skencil installation process and the Skencil font access mechanism. Thus, this document only serves as a overview of the Skencil installation process and basic font configuration.

Currently, this document only provides an overview of platform development environment setup, compiling PIL manually, Skencil installation (limited), and basic font configuration (accessing the default Type 1 fonts).


I.   The SuSE Development Environment for Skencil


Figure 1.
Use YaST's Selection filter to install the C/C++ compiler and all the development tools and utilities.


Figure 2.
Additional packages will be needed to install Skencil. YaST's Search filter can be used to install these select packages. YaST allows you search and select all the packages needed in one YaST session.

Below is a list of the required dependencies for running and compiling Skencil under the SuSE C/C++ development environment. Note that these dependencies themselves have dependencies (you should accept all these sub-dependencies when propted by YaST).

The names provided below are only "base" names. You can use these base names for the searching of packages in YaST. The prefix installation directory for each SuSE package is usually "/usr" (binaries in /usr/bin/ and libs in /usr/lib).

Note that SuSE 8.2 Linux users will need to download some of these packages for they are not on the SuSE 8.2 CD.

Python and Python development (required for Skencil):

  • python
  • python-tk
  • python-devel
  • python-xml   (optional)

Tcl/Tk and Tcl/Tk development (required for Skencil):

  • tcl   (pre-installed)
  • tk   (pre-installed)
  • tk-devel
  • tcl-devel

PIL (required for Skencil):

(Note SuSE 9.2 does not have python imaging. See next section of this document.)

  • python-imaging

Jpeg and Jpeg development (required for PIL):

  • libjpeg   (pre-installed)
  • libjpeg-devel

Zlib and Zlib development (required for PIL and X11 devel):

  • zlib   (pre-installed)
  • zlib-devel

X11 development (required for PIL):

  • xorg-x11-devel

Ghostscript (required for Skencil):

  • ghostscript-x11
  • ghostscript-library
  • ghostscript-fonts-std

Png and Png development (needed for X11 devel):

  • libpng   (pre-installed)
  • libpng-devel

Tiff and Tiff development (recommended):

  • libtiff   (pre-installed)
  • libtiff-devel

II.   Compiling PIL 1.1.4 Manually - Linux

Compiling the Python Imaging Library (PIL) is not necessary for SuSE Linux 8.2, 9.0 and 9.1. SuSE 8.2 to 9.1 provide a PIL package configured for the SuSE provided Python package (8.2 via download only). SuSE 9.2 Linux users will need to compile PIL. PIL can be compiled for the SuSE provided Python package as detailed by the instructions below. If you compiled Python from source you can still use the below instructions, but you may need to make the necessary path modifications to fit your installation.

The below instructions are for Linux only. There are some minor differences in the Makefile editing for other Unix systems (Solaris in specific). The below instructions use the manual method of PIL installation. It is my experience that this method is the most reliable method for installing PIL on different Unix systems. Note that others may have different experiences.

If you use PIL's setup.py file to install PIL, note that it does not copy the header files to the Python include directory. Installing the header files will still be a manual process. It is to my understanding that this is fixed with PIL 1.1.5.

The first step is to get the PIL tarball form the PIL web site. Use the below URL:

http://www.pythonware.com/products/pil/


Once you attain the PIL tarball, unpack it with gzip and tar utilities. The unpacked directory is called Imaging-1.1.4. Change from the current directory to the /Imaging-1.1.4/libImaging directory. This is the directory for making the imaging library.

# gzip -cd ./Imaging-1.1.4.tar.gz | tar -xvf -
# cd ./Imaging-1.1.4/libImaging/

Now run the "configure" script to generate the imaging Makefile. The X11, jpeg and zlib "lib" and "include" path should be the same for all SuSE Linux systems (for X11, jpeg and zlib are installed by default). If for some reason your paths are different make the necessary path changes.

# ./configure --prefix=/usr/local \
> --with-x --x-include=/usr/X11R6/include --x-libraries=/usr/X11R6/lib \
> --with-jpeg=/usr/lib --with-zlib=/usr/lib

Normally when the configure script is done, the make command is executed. Unfortunately, this is not the case. There are some paths in the generated Makefile that need to be modified. You can use any text editor that suites you. In the examples vi is used.

# vi ./Makefile

Make the following changes to the Makefile in libImaging directory.

FROM:
LIBS=           -lz  -ljpeg -lm
TO:
LIBS=           -L/usr/lib -lz -L/usr/lib -ljpeg  -lm

FROM:
JPEGINCLUDE=    /usr/local/include
TO:
JPEGINCLUDE=    /usr/include

FROM:
CFLAGS=         $(OPT) -I$(INCLDIR) -I$(JPEGINCLUDE) $(DEFS)
TO:
CFLAGS=         $(OPT) -I$(INCLDIR) -I$(JPEGINCLUDE)

The make command can be executed.

# make

The imaging library is now compiled. Now to compile the imaging-tk library. Change from the current directory to the parent directory. For some reason the "Setup.in" file is not writable when unpacked. Thus before attempting to edit the Setup.in, change its permissions. The Setup.in is now ready to be edited.

# cd ../
# chmod +w ./Setup.in
# vi +33 ./Setup.in

In the Setup.in make to following changes:

FROM:
#
# *** IJG JPEG library (libjpeg) location
        -I/usr/local/include -L/usr/local/lib -ljpeg \
#
# *** ZLIB (libz) location
        -I/usr/local/include -L/usr/local/lib -lz
[...]

_imagingtk  _imagingtk.c \
        -IlibImaging Tk/tkImaging.c \
        -I/usr/local/include -L/usr/local/lib -ltcl8.3 -ltk8.3 \
        -L/usr/X11R6/lib -lX11
TO:
#
# *** IJG JPEG library (libjpeg) location
        -I/usr/include -L/usr/lib -ljpeg \
#
# *** ZLIB (libz) location
        -I/usr/include -L/usr/lib -lz

[...] 

_imagingtk  _imagingtk.c \
        -IlibImaging Tk/tkImaging.c \
        -I/usr/include -L/usr/lib -ltcl8.4 -ltk8.4 \
        -L/usr/X11R6/lib -lX11

Like the Setup.in, the "Makefile.pre.in" is not writable and needs some modification to its promissions.

# chmod +w ./Makefile.pre.in
# vi +98 ./Makefile.pre.in

In the Makefile.pre.in make to following changes:

FROM:
CFLAGS=         $(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY) $(DEFS)
TO:
CFLAGS=         $(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY)

The Makefile is ready for the make command.

# make -f Makefile.pre.in boot
# make 

Again, this installation method is manual. This means that the installation directories will need to be created and the appropriate files copied to them. There is usually a link /usr/lib/python to the directory /usr/lib/python2.3 (or python2.4 depending on your installation). Here the actual directory is used, but you may use the link.

# mkdir /usr/lib/python2.3/site-packages/PIL
# mkdir /usr/include/python2.3/PIL

Finally copy all the files to the appropriate directory. The file "PIL.pth" is copied to the "site-packages" directory. all the shared libraries files (".so" files) in the current directory (Imaging-1.1.4) and all the files in the "/Imanging-1.1.4/PIL/" directory are copied to the PIL directory in the site-packages directory. Finally, copy all the header files (".h" files) in the "libImaging" directory to the PIL directory in the python include directory.

# cp ./PIL.pth /usr/lib/python2.3/site-packages/
# cp ./*.so ./PIL/* /usr/lib/python2.3/site-packages/PIL
# cp ./libImaging/*.h /usr/include/python2.3/PIL/


III.   Installing Skencil

The installing of Skencil is usually not difficult. It is the dependency programs that are usually the problem. In most cases, installing Skencil take three steps: "setup.py configure", "setup.py build" and "setup.py install".

Below is the usual sequence for installing Skencil:

# /usr/bin/python ./setup.py configure \
> --imaging-include=/usr/include/python/PIL
# /usr/bin/python /setup.py build
# /usr/bin/python ./setup.py install --prefix=/usr/local/skencil

In some cases the X11 and Tcl/Tk flags will need to be used. For SuSE Linux this should not be the case, unless the Tcl/Tk are installed in a location other that prefix "/usr" (/usr/lib and /usr/include). In those cases use "-I/your_path/include" and "-L/your_path/lib". In the example below the path is the usual "/usr/include" and "usr/lib" and Tcl/Tk version is 8.4.

/usr/bin/python ./setup.py configure \
> --tk-flags = "-I/usr/include  -L/usr/lib  -ltk8.4  -ltcl8.4 \
> -I/usr/X11R6/include  -L/usr/X11R6/lib  -lX11 -lXext"


IV.   Base System Font Configuration

Skencil uses a simple mechanism to access PostScript Type 1 fonts. This mechanism has two major components. The first component of the Skencil font access mechanism is an internal Python list that contains paths of directories that house PostScript Type 1 font files. This internal Python list is assigned the named font_path and is located in Skencil's config.py file. Global changes to the font_path list can be achieved by directly editing the items (paths) in the list or by appending new items to the list. Local changes to the font_path list (appending to the list only) can be achieved by issuing instructions in a user's userhooks.py file. The second component of the Skencil font access mechanism consists of one or more font database files which contain information about the PostScript Type 1 font files located in the directories specified by the font_path list. Each font database file must be located in at least one of the directories specified by the font_path list. Each Skencil font database file can be assigned any base name, but must have the extension ``.sfd''. A Skencil font database file can be created with the mkfontpath.py utility or manually with a text editor.

A detailed discussion of Skencil's sfd font database files (their format and data content) and the config.py file is beyond the scope of this "Quick Installation" document.


The config.py file

The config.py file holds Skencil's defaults on start up. Among the configuration parameters contained in the config.py are the number of steps in a gradient for display and output, the default number of steps for the blend menu and the default font. It is important to know that the data in the config.py file is the default used when skencil starts. Thus, it is important to have valid data. Hence, it is important to be careful when editing this data. Much of the data in the config.py file can be configured within skencil. But in many cases the data in the config.py file is appended to or over written by commands in the userhooks.py file and the preferences file in the users .sketch directory. The font configuration parameters of interest, in the config.py, are the font_path list and the default ruler fonts.

For the font paths (you can ignore the last entry): Line 64

FROM:

font_path = ['/usr/X11R6/lib/X11/fonts/Type1',
             '/usr/share/ghostscript/fonts',
             '/usr/lib/ghostscript/fonts']

TO:

font_path = ['/usr/X11R6/lib/X11/fonts/Type1',
             '/usr/X11R6/lib/X11/fonts/URW',
             '/usr/X11R6/lib/X11/fonts/skencil']

For the ruler fonts (line 380) :

FROM:

#ruler_font = '-*-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1'
ruler_font = '-misc-fixed-medium-*-*-*-11-*-*-*-*-*-iso8859-1'
#ruler_font = '-*-lucida-medium-r-*-*-11-*-*-*-*-*-iso8859-1'
ruler_text_type = 'rotated' # can be 'rotated', 'horizontal' or 'vertical'
#ruler_text_type = 'horizontal'
#ruler_font_rotated = '-*-helvetica-medium-r-*-*-[0 10 ~10 0]-*-*-*-*-*-is
o8859-1'
ruler_font_rotated = '-misc-fixed-medium-*-*-*-[0 11 ~11 0]-*-*-*-*-*-iso8
859-1'
#ruler_font_rotated = '-*-lucida-medium-r-*-*-[0 11 ~11 0]-*-*-*-*-*-iso88
59-1

TO:

ruler_font = '-urw-nimbus sans l-medium-r-normal-*-10-*-*-*-*-*-iso8859-1'
ruler_text_type = 'rotated' # can be 'rotated', 'horizontal' or 'vertical'
ruler_font_rotated = '-urw-nimbus sans l-medium-r-normal-*-[0 10 ~10 0]-*-
*-*-*-*-iso8859-1'

Quick Configuration Time Saver:

To save time, you may right-mouse down-load the below pre-configured config.py file. Simply copy the below config.py file to the directory [*]/lib/skencil-0.6.16/Sketch/Base. Note that this will clobber the existing config.py file in that directory. Here [*] is the path to Skencil. Common Skencil paths are /usr, /usr/local or /usr/local/skencil.

# cp ./config.py /usr/local/skencil/lib/skencil-0.6.16/Sketch/Base/

Pre-configured config.py file:


Skencil SFD font database files and the Fontmetrics directory

Thought not explicitly an item in the font_path list, the Fontmatrics directory path is automatically appended to font_path list by Skencil. Hence, the Fontmatrics is an internally supplied path for font files and Skencil font database files. By default, the Fontmatrics directory is endowed with AFM font files for the standard 35 Abode PostScript Type 1 fonts and default Skencil font database files (sfds). This ensures that Skencil has a database file for the 35 standard Abobe PostScript fonts and associated AFM font files if the OS vendor only provides PFB or PFA font files.

There are situations where the Fontmatics is not necessary and others where it is very useful. A detailed discussion of this is beyond the scope of this "Quick Installation" document.

In the case of SuSE Linux, the Fontmetrics directory is not necessary. Hence, all the files in the Fontmatrics directory should be deleted (Note that this must be done to use the below pre-configured files). The Fontmatrics directory can be found in the "/usr /lib /skencil-0.6.16 /Resources/" directory (if --prefix=/usr). Or "/usr /local /skencil /lib /skencil-0.6.16 /Resources/" if --prefix=/usr/local/skencil.

Because a detailed discussion of fonts is beyond the scope of this document, simply use the "time saver" below.

Quick Configuration Time Saver:

To save time, you may right-mouse down-load the below preconfigured Skencil SFD font database files.

Copy the below gs.sfd file to the directory /usr/X11R6/lib/X11/font/URW. Note that this directory is a symbolic link to XXX. Copy the file x11.sfd to the directory /usr/X11R6/lib/X11/font/Type1.

# cp ./gs.sfd /usr/X11R6/lib/X11/font/URW/
# cp ./x11.sfd /usr/X11R6/lib/X11/font/Type1/ 

The below files are for SuSE 9.1 and SuSE 9.2:

The below files are for SuSE 8.2 and SuSE 9.0:


V.   Know Platform Issues

Sorry, not yet.