~ubuntu-branches/ubuntu/precise/graphviz/precise-security

« back to all changes in this revision

Viewing changes to plugin/core/ps.txt

  • Committer: Bazaar Package Importer
  • Author(s): David Claughton
  • Date: 2010-03-24 22:45:18 UTC
  • mfrom: (1.2.7 upstream) (6.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100324224518-do441tthbqjaqjzd
Tags: 2.26.3-4
Add patch to fix segfault in circo. Backported from upstream snapshot
release.  Thanks to Francis Russell for his work on this.
(Closes: #575255)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%BeginProlog
 
2
/DotDict 200 dict def
 
3
DotDict begin
 
4
 
 
5
/setupLatin1 {
 
6
mark
 
7
/EncodingVector 256 array def
 
8
 EncodingVector 0
 
9
 
 
10
ISOLatin1Encoding 0 255 getinterval putinterval
 
11
EncodingVector 45 /hyphen put
 
12
 
 
13
% Set up ISO Latin 1 character encoding
 
14
/starnetISO {
 
15
        dup dup findfont dup length dict begin
 
16
        { 1 index /FID ne { def }{ pop pop } ifelse
 
17
        } forall
 
18
        /Encoding EncodingVector def
 
19
        currentdict end definefont
 
20
} def
 
21
/Times-Roman starnetISO def
 
22
/Times-Italic starnetISO def
 
23
/Times-Bold starnetISO def
 
24
/Times-BoldItalic starnetISO def
 
25
/Helvetica starnetISO def
 
26
/Helvetica-Oblique starnetISO def
 
27
/Helvetica-Bold starnetISO def
 
28
/Helvetica-BoldOblique starnetISO def
 
29
/Courier starnetISO def
 
30
/Courier-Oblique starnetISO def
 
31
/Courier-Bold starnetISO def
 
32
/Courier-BoldOblique starnetISO def
 
33
cleartomark
 
34
} bind def
 
35
 
 
36
%%BeginResource: procset graphviz 0 0
 
37
/coord-font-family /Times-Roman def
 
38
/default-font-family /Times-Roman def
 
39
/coordfont coord-font-family findfont 8 scalefont def
 
40
 
 
41
/InvScaleFactor 1.0 def
 
42
/set_scale {
 
43
       dup 1 exch div /InvScaleFactor exch def
 
44
       scale
 
45
} bind def
 
46
 
 
47
% styles
 
48
/solid { [] 0 setdash } bind def
 
49
/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
 
50
/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
 
51
/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
 
52
/bold { 2 setlinewidth } bind def
 
53
/filled { } bind def
 
54
/unfilled { } bind def
 
55
/rounded { } bind def
 
56
/diagonals { } bind def
 
57
 
 
58
% hooks for setting color 
 
59
/nodecolor { sethsbcolor } bind def
 
60
/edgecolor { sethsbcolor } bind def
 
61
/graphcolor { sethsbcolor } bind def
 
62
/nopcolor {pop pop pop} bind def
 
63
 
 
64
/beginpage {    % i j npages
 
65
        /npages exch def
 
66
        /j exch def
 
67
        /i exch def
 
68
        /str 10 string def
 
69
        npages 1 gt {
 
70
                gsave
 
71
                        coordfont setfont
 
72
                        0 0 moveto
 
73
                        (\() show i str cvs show (,) show j str cvs show (\)) show
 
74
                grestore
 
75
        } if
 
76
} bind def
 
77
 
 
78
/set_font {
 
79
        findfont exch
 
80
        scalefont setfont
 
81
} def
 
82
 
 
83
% draw text fitted to its expected width
 
84
/alignedtext {                  % width text
 
85
        /text exch def
 
86
        /width exch def
 
87
        gsave
 
88
                width 0 gt {
 
89
                        [] 0 setdash
 
90
                        text stringwidth pop width exch sub text length div 0 text ashow
 
91
                } if
 
92
        grestore
 
93
} def
 
94
 
 
95
/boxprim {                              % xcorner ycorner xsize ysize
 
96
                4 2 roll
 
97
                moveto
 
98
                2 copy
 
99
                exch 0 rlineto
 
100
                0 exch rlineto
 
101
                pop neg 0 rlineto
 
102
                closepath
 
103
} bind def
 
104
 
 
105
/ellipse_path {
 
106
        /ry exch def
 
107
        /rx exch def
 
108
        /y exch def
 
109
        /x exch def
 
110
        matrix currentmatrix
 
111
        newpath
 
112
        x y translate
 
113
        rx ry scale
 
114
        0 0 1 0 360 arc
 
115
        setmatrix
 
116
} bind def
 
117
 
 
118
/endpage { showpage } bind def
 
119
/showpage { } def
 
120
 
 
121
/layercolorseq
 
122
        [       % layer color sequence - darkest to lightest
 
123
                [0 0 0]
 
124
                [.2 .8 .8]
 
125
                [.4 .8 .8]
 
126
                [.6 .8 .8]
 
127
                [.8 .8 .8]
 
128
        ]
 
129
def
 
130
 
 
131
/layerlen layercolorseq length def
 
132
 
 
133
/setlayer {/maxlayer exch def /curlayer exch def
 
134
        layercolorseq curlayer 1 sub layerlen mod get
 
135
        aload pop sethsbcolor
 
136
        /nodecolor {nopcolor} def
 
137
        /edgecolor {nopcolor} def
 
138
        /graphcolor {nopcolor} def
 
139
} bind def
 
140
 
 
141
/onlayer { curlayer ne {invis} if } def
 
142
 
 
143
/onlayers {
 
144
        /myupper exch def
 
145
        /mylower exch def
 
146
        curlayer mylower lt
 
147
        curlayer myupper gt
 
148
        or
 
149
        {invis} if
 
150
} def
 
151
 
 
152
/curlayer 0 def
 
153
 
 
154
%%EndResource
 
155
%%EndProlog
 
156
%%BeginSetup
 
157
14 default-font-family set_font
 
158
1 setmiterlimit
 
159
% /arrowlength 10 def
 
160
% /arrowwidth 5 def
 
161
 
 
162
% make sure pdfmark is harmless for PS-interpreters other than Distiller
 
163
/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
 
164
% make '<<' and '>>' safe on PS Level 1 devices
 
165
/languagelevel where {pop languagelevel}{1} ifelse
 
166
2 lt {
 
167
    userdict (<<) cvn ([) cvn load put
 
168
    userdict (>>) cvn ([) cvn load put
 
169
} if
 
170
 
 
171
%%EndSetup