PROforma Configuration

  1. Configuration file
  2. Dynamic configuration

Configuration file

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 ProWesS 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 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 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 printer driver. 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.

Dynamic configuration

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 August 3, 1996