PROforma Configuration
- Configuration file
- Dynamic configuration
PROforma reads the initial configuration information from a special file
called PROforma_cfg. You can specify the directory where this file
should be searched when executing PROforma.
Each line in the configuration file is interpreted as a configuration
command. Empty lines are discarded as comments. All the other lines are divided
in two types, commands and definitions of configuration constants. The lines
with a command have a fixed format : the first character is the actual command,
the second character should be a space, and the rest of the line is the
parameter. All lines which don't have a space as second character are
considered as configuration constants.
The configuration commands currently supported by PROforma are :
- '%' and ';'
- the line is considered as comment and is discarded.
- 'S'
- the parameter is now the searchpath for fonts. If the first
character of the new path is a plus sign, then the path will be added at
the end of the existing path.
- 's'
- to set the searchpath for drivers. If the first
character of the new path is a plus sign, then the path will be added at
the end of the existing path.
- 'D'
- will load the give PROforma driver.
It is not necessary to know what
kind of driver it is. The names of PROforma driver files normally end in
'_pfd'. The file will be searched on the current searchpath for
drivers (cfr 's').
- 'M'
- allow you to specify the maximum amount of memory which can be used
by PROforma as buffer to render a page in. If the amount given is negative,
then that is the amount of memory which has to remain free (both in bytes).
- 'C'
- specify the size of the
font cache. This consists of two
numbers, the actual size of the font cache, and the minimum number of
different font/size combinations that can be in the cache (one more
combination can be in the cache for each
gstate). Each combination of font & size
uses about 1.5kB of memory, so this number should not be too big, however,
if you use a large fontcache, this number should also be increased.
- 'c'
- Define the size for the colour cache. In PROforma each gstate keeps
a few colours which were last used to make sure that the pattern which is
used to estimate the colour does not have to be recalculated all the time.
This causes a very big speed increase in some operations, especially for
drawing pictures. You can choose how many colours are retained in the
colour cache. The value is restricted to stay inside the 1..256 range.
The default value is 8.
- 'R'
- load a font file as resident font.
A resident font will always remain in
memory (unless PROforma is removed).
The first resident font is considered to be the
builtin font (which is essential for
proper functioning). The characters from the builtin font are (also)
displayed when that character is not available in the current font. It is
therefore recommended that the builting font is as complete as possible.
The parameter is the name of the fontfile, which is searched on the
searchpath for fonts. If you also want to be able to choose the resident
fonts in te fontmap, then you should also include a 'P' command.
- 'P'
- this command adds a font to the
fontmap. The fontmap is a matching
between font names and their filename. The fontmap is also used to figure
out which fonts are available. The command has two parameters, separated
by a semicolon (';'), there should be no spaces before and after
the semicolon. The first parameter is the name of the font (which has to
be an exact match, including case). The second parameter is the name of
the font file. PROforma font files normally end in '_pff'.
- 'd'
- selects the default printer driver.
The driver can be given either as
the driverid number (in ASCII, this starts with a minus sign as driverid's
are negative) or as the full (case sensitive) printer driver name.
- 'v'
- this command should not be used in the PROforma configuration
file. The parameter is the minimum version number you want to use. An error
(ERR_ISYN) will be returned when the version of PROforma is older than the
version requested. An example of the use of this is v 1.14.
The configuration constants are only passed to the last loaded PROforma
printer driver (or if you just selected the
default printer driver, than that driver will get the configuration constants).
Most printer drivers will normally understand the following configuration
constants :
- DEFAULT-DEVICE
-
The parameter if the default device for the printer driver. Some examples
are ser1hr or pard. Note that PROforma only prints raw
data, so translates should be switched off, hence the 'r' in
ser1hr and the 'd' in pard.
- PRINTABLE-AREA-SIZE
-
Allows you to set the size of the printable area for your printer.
This is the area where output can be visible on the page. The parameters
are in typographical points, which has a unit if 1/72 inch or approx. .35
mm.
- PRINTABLE-AREA-ORIGIN
-
Allows you to set the origin of the printable area for your
printer, or to put it differently, the offset of the printable area from
the left and top of the page. The parameters are in typographical points,
which has a unit if 1/72 inch or approx. .35 mm.
PROforma can also be configured further while it is already active. PROforma
contains a special entry point which allows you to pass configuration lines
which are then processed.
The 'PROforma DLL' thing has a CNFG extension which is used for
this purpose. This extension accesses a function which accepts a character
array as parameter ("char *"). This string is handled as if it was a line in
the configuration file. It is thus possible (as mentioned in the previous
section) to add printer drivers or fonts, change the default driver etc.
The call to this routine can be done as follows :
#include "thing_h"
#include "PROforma_h"
...
Error err; /* the error returned by the config routine */
char *str; /* the config line which is passed */
...
err=THINGCall(PF_THING_NAME,PF_THING_CNFG,1,str);
if (err) ... /* error handling */
...
PROGS, Professional & Graphical Software
last edited 4 December, 1997