These are example written in C for the PostScript library pslib.

How to run the examples
=======================

Run 'make <ps file>' to create a particular PostScript file.
<ps file> is one of the example names with extension '.ps'. To run the
example 2 just type 'make psclock.ps'. Alternatively, run 'make run'
to compile an run all examples.

How to compile the examples
===========================

Just type make to compile all examples.

How to get help
===============

Type 'make help' for a list of available make targets and a short
description.

Example 1: draw.c
=================

This is the most complete example demonstrating many aspects of
pslib. It contains of many single boxes, each presenting a feature
of pslib.

Example 2. psclock.c
====================

Those who know pdflib (TM) (see http://www.pdflib.com) will probably
know this example. It draws an analog clock on a single page showing the
current time. The same example is shipped with pdflib.
If you create several hundred pages then this example can somewhat
serve as a simple benchmark. Just count the pages between two
seconds. On my rather slow PowerPC 400 MHz it easily creates more than
400 pages a second.
The number of pages can be set in the variable numpages in the C source file.

Example 3. einstein.c
=====================

This is basically a three pages text document. It was written in german
bei Albert Einstein. I uses the font Schwabacher because of its many
ligatures which is a perfect way to show some of pslib's enhanced text output
features. The font itself does not contain any ligature information.
That's why the encoding file is provided. The encoding vector itself
is not used, but the ligatures in the head of the file. The font is
also very buggy because the ligatures do not even have propper names.
They are randomly placed all over the font replacing other glyphs.
This explains the strange names of the ligatures in the encoding file.
The text is set in two columns using hyphenation. Paragraphs are
separated by a carrige return on a single line. The first line of
a paragraph is indented. Paragraphs are also separated with extra
space.

Example 4. hyperlinks.c
=======================

pslib supports pdfmarks which allows to place code into the PostScript
document which is disregarded by the printer but will be evaluated by
Acrobat Distiller (TM) or Ghostscript when it is converted to PDF.
Such pdfmarks can preserve features only supported by PDF in a PostScript
document. This example is a two page document. The pages have different
size and both have a bookmark. Page one contains several links which
are displayed as boxes surrounded by a blue line when converted to PDF.

Example 5. hyphenation.c
========================

There isn't much to say about this example. It just takes a list of words
and outputs its possible hyphenations.

Example 6. fontsample.c
========================

This is a very handy program to output a page with a font sample for a
given font. It's been created to demonstrate font encoding and the
PS_symbol... functions. Font encoding is actually something you should
not have to care about very much. The font encoding vector tells the
PostScript engine which glyph is mapped to a char in the PostScript
document. The default font encoding used by pslib is TeXBase1 which
is also used by dvips.

Example 7. ligatures.c
========================

Output several ligatures of AlteSchwabacher which has a very strange
font encoding and needs some manual corrections in the encoding file.

Example 8. spotcolor.c
========================

Spot colors can be used with pslib almost as easy as colors in one of
the other available color spaces. This example shows five different spot
colors each with ten different tint values (10-100 %). Do not be
confused by the fact that the colors may not look exactly like you
would have expected them, when you view them on the screen or print
them on a regular printer. Each spot color has an alternative color,
which is what you see. This color can only be an approximation of what
the real color looks like. If the document is separated and profesionally
printed, you will get what you expect.

Example 9. overprint.c
========================

There is not much to tell about this example. It prints a small rectangle
on a larger rectangle. Both have different color. If you separate such
a file, the large rectangle will usually have a white spot where the small
rectangle is located because the color of the small rect will not overprint
the color beneath. This is different when you set overprint mode on. Then
the color beneath will be overprinted with the small rectancle. One would
like this behaviour with black text.

Example 10. shading.c
========================
This rather complex example shows many ways on how shading can be used.
It is quite impressing to see how easily a page can look nice with some
shading.

Example 11. image.c
========================
Image handling is something pslib is capable for some time. This example
concentrates on reading images in different formats.

Example 12. imagereuse.c
========================
Image can become very big, expecially when they are inserted into the
PostScript document. Something missing in pslib was the ability to reuse
images throughout the document. This was added in version 0.4.5 and became
the default behaviour. Beside a vast reduction in file size, processing
of the document is also speed up as seen on the pages 2 and 3 when displayed
with ghostscript.

Example 13. cmyk.c
========================
Color separation isn't neccessarily something you have to take care of
if you have a PostScript document printed. Anyway, this example demonstrate
how easily pslib can separate colors during the creation of the document.
The example produces 4 pages, one page for each process color. It is done
by calling the same page creation function four times after setting the
value 'separationcolor'.

Where can I get the fonts?
==========================

Alte Schwabacher and many more fonts can be downloaded at
http://www.moorstation.org/typoasis/designers/steffmann/

