summaryrefslogtreecommitdiff
path: root/dviware/psprint/unix/pswriter.h
blob: 25de3d095dae1245439717d5c08e80edc8a3a023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
(* PSWriter routines are used by PSDVI to create the PostScript output file.
   The following calling sequence is largely determined by the PostScript
   definitions that must be prepended to the output:

   OpenOutput
   if -h used then OutputHeader
   for each page selected do
      BeginPage
      if not conserving VM then
         for each new bitmap font do NewBitmapFont
         for each bitmap font used on this page do
            BeginBitmapFont
            for each new character do LoadBitmap
         end
      end
      OutputPage
      for each \special on this page do OutputSpecial
      for each font used on this page do
         if (conserving VM) and (not PostScript font) then SaveVM
         if PostScript font then BeginPostScriptFont else BeginBitmapFont
         if (conserving VM) and (not PostScript font) then
            for each character used do LoadBitmap
         end
         if PostScript font then
            for each character used do SetPostScriptChar
         else
            for each character used do SetBitmapChar
         end
         EndFont
         if (conserving VM) and (not PostScript font) then RestoreVM
      end
      for each rule on this page do SetRule
      EndPage
   end
   CloseOutput
*)

VAR PSfile : text;   (* LoadBitmap routine in FontReader requires access to
                        output file to write out PostScript char definitions. *)

FUNCTION  OpenOutput (name : string) : BOOLEAN;                        EXTERNAL;
FUNCTION  OutputHeader (name : string) : BOOLEAN;                      EXTERNAL;
PROCEDURE BeginPage (DVIpage : INTEGER);                               EXTERNAL;
PROCEDURE NewBitmapFont (VAR fontid : string);                         EXTERNAL;
PROCEDURE OutputPage (DVIpage : INTEGER);                              EXTERNAL;
FUNCTION  OutputSpecial (VAR name : string;
                         hpos, vpos : INTEGER) : BOOLEAN;              EXTERNAL;
PROCEDURE SaveVM (VAR fontid : string);                                EXTERNAL;
PROCEDURE BeginBitmapFont (VAR fontid : string);                       EXTERNAL;
PROCEDURE BeginPostScriptFont (VAR fontname : string;
                               scaledsize, mag : INTEGER);             EXTERNAL;
PROCEDURE SetBitmapChar (ch : CHAR; hpos, vpos, pwidth : INTEGER);     EXTERNAL;
PROCEDURE SetPostScriptChar (ch : CHAR; hpos, vpos, pwidth : INTEGER); EXTERNAL;
PROCEDURE EndFont;                                                     EXTERNAL;
PROCEDURE RestoreVM;                                                   EXTERNAL;
PROCEDURE SetRule (wd, ht, hpos, vpos : INTEGER);                      EXTERNAL;
PROCEDURE EndPage (DVIpage : INTEGER);                                 EXTERNAL;
PROCEDURE CloseOutput;                                                 EXTERNAL;