Annotation of Examples/PostScript/Level2Stars.eps, revision 1.1.1.1

1.1       root        1: %!PS-Adobe-2.0 EPSF-2.0
                      2: %%Title: Level2Stars.eps
                      3: %%Creator: Ali Ozer
                      4: %%CreationDate: Fri May 29 14:00:03 1992
                      5: %%BoundingBox: 0 0 600 200
                      6: %%DocumentFonts: Times-BoldItalic
                      7: %%EndComments
                      8: 
                      9: % First check to see if this device is Level II
                     10: 
                     11: /DeviceIsLevel2
                     12:     systemdict /languagelevel known {languagelevel 2 ge} {false} ifelse
                     13: def
                     14: 
                     15: DeviceIsLevel2 {       % A PostScript Level 2 device
                     16: 
                     17:     % Star code mostly from chapter 4 of the Second Edition
                     18:     % of the PostScript Language Reference Manual
                     19:     
                     20:     8 dict dup begin
                     21:        /PatternType    1 def
                     22:        /PaintType      1 def
                     23:        /TilingType     1 def
                     24:        /BBox           [0 0 40 40] def
                     25:        /XStep          40 def
                     26:        /YStep          40 def
                     27:        /star           {
                     28:            gsave 0 8 moveto 4 {144 rotate 0 8 lineto} repeat
                     29:            closepath fill grestore
                     30:        } def
                     31:        /PaintProc      {
                     32:            begin
                     33:            0.333 setgray 0 0 40 40 rectfill
                     34:            1.0 0.0 0.0 setrgbcolor 10 10 translate star
                     35:            0.0 1.0 0.0 setrgbcolor 0 20 translate star
                     36:            0.0 0.0 1.0 setrgbcolor 20 -20 translate star
                     37:            1.0 1.0 0.0 setrgbcolor 0 20 translate star
                     38:            end
                     39:        } def
                     40:     end
                     41:     matrix makepattern
                     42:     /starpattern exch def
                     43: 
                     44:     /setStarPattern {
                     45:         starpattern setpattern
                     46:     } def     
                     47: 
                     48: } {    % Not a PostScript Level 2 device!
                     49:     
                     50:     /setStarPattern {  % We have to fake the pattern
                     51:         0.5 setgray
                     52:     } def     
                     53: 
                     54: } ifelse
                     55: 
                     56: /centerText {  % (str) y w centerText -
                     57:     2 index stringwidth        % (str) y w wx wy
                     58:     pop sub 2 div      % (str) y (w-wx)/2
                     59:     exch moveto                % (str)
                     60:     show
                     61: } def
                     62: 
                     63: 0.333 setgray
                     64: /Times-BoldItalic findfont 24 scalefont setfont
                     65: (If the text below is filled with stars, then this is a) 170 600 centerText
                     66: (device) 10 600 centerText
                     67: 
                     68: setStarPattern
                     69: /Times-BoldItalic findfont 160 scalefont setfont
                     70: (Level 2) 40 600 centerText

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.