How to Compile and Install
Ghostscript 6.0 + Japanese vflib patch

The advantage of this installation is that it is quite fast and doesn't need any other fonts installed. However you have to recompile the ghostscript to understand Japanese vflib. For other installations see the bottom of this page.

1. Environment:

Solaris 2.6/7,8, X11R6.3, gcc-2.8.x or better
(Note that gcc-2.7.2 or earlier may not compile some versions of ghostscript!)

2. Source:

The following packages from the original ghostscript distribution are required:
(Get these from any CTAN ftp archive near you.)
  • ghostscript-6.0.tar.gz
  • ghostscript-6.0jpeg.tar.gz
  • ghostscript-6.0zlib.tar.gz
  • ghostscript-6.0libpng.tar.gz

And these additional patch and vflib packages:

3. Installation Scripts/Guide:

  1. Compile and install vflib. Instructions may be found here.
  2. Compile and install ghostscript:
    Suppose that you want to have ghostscript binary and library files installed in
    respectively. The do the followings:
           % zcat ghostscript-6.0.tar.gz | tar xvf -
           % zcat ghostscript-6.0jpeg.tar.gz | tar xvf -
           % zcat ghostscript-6.0zlib.tar.gz | tar xvf -
           % zcat ghostscript-6.0libpng.tar.gz | tar xvf -
           % mv jpeg-6b gs6.0/jpeg
           % mv zlib-1.1.3 gs6.0/zlib
           % mv libpng-1.0.3 gs6.0/libpng
           % cd gs6.0
           % patch -p1 < SOME_PATH/gs-jpatch
           % patch -p1 < SOME_PATH/gs6.0-jpdf-exp.patch
           % cp src/unix-gcc.mak src/unix-gcc.mak.old
    Then edit unix-gcc.mak file and change the following points in it:
       bindir = $(exec_prefix)/bin/gs6.0vflib
       datadir = $(prefix)/lib
       gsdir = $(datadir)/gs
       EXTRALIBS= -lnsl -lsocket
       XLIBS=Xt SM ICE Xext X11
       VFLIBS=VFlib2 ttf
    Then do:
           % cd gs6.0
           % ln -s ./src/unixgcc.mak Makefile
           % make
           % make install
    Then go to /usr/local/lib/gs/6.0vflib and extract the following files:
  3. Now edit vfontcap with proper setting of the True Type fonts in it!! (see below)

    Don't have Japanese True Type fonts? As a hint, you may get them from the Japanese version of Windows 3.1 or 95/98/NT (please notice the copyrights of the Microsoft Co. and use them at your own risk.). All you need is the following files:
    msgothic.tti msmincho.tti
    msgothic.ttc msmincho.ttc

    Note that if you don't have tti files, you can easily generate them using ttindex utility that comes with VFlib source.

    Suppose that you save these font files in /usr/local/lib/vflib/ttf/ directory. Then all you need is to add these lines to the vfontcap file.

    ### TRUETYPE FONT (Windows fonts)
    min|MicroSoft mincho:\
    goth|Microsoft gothic:\

4. Results:



  • Remember to edit the /usr/local/bin/gs6.0vflib/ps2pdfwr file and add the -sPAPERSIZE=a4 to it, if you want to use A4 papers instead of default letter size PDF files. Edit it like this:

    exec gs $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=$outfile $OPTIONS -c save pop -f $infile

  • On a Solaris machine, remember to set the environment variable GS_LIB as follows: (using csh or tcsh)
    setenv GS_LIB /usr/openwin/lib/X11/fonts/Type1:/usr/openwin/lib/X11/fonts/Type3
    and then use the Fontmap.Sol instead of Fontmap.GS to get a better look of the PS files.
  • Remember to add /usr/local/bin/gs6.0vflib to your path before starting ghostscript.
  • You may need to edit the file PREFIX/lib/gs/6.0vflib/kanji/ and add new font aliases to it.
  • Get "ghostview" or "gv" and install it to have a fine user interface with ghostscript.

Other Notes on compiling and installing ghostscript:

Go to Japanese HTML & CGI Lecture page.

This page was created by B.H. Far.

far e-mail

(Last modified: )