summaryrefslogtreecommitdiff
path: root/fonts/utilities/psposter/fontlist.ps
blob: 039148a6651a7822b83b6b43b7f6f65aba387618 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
%!PS-Adobe-3.0
%=======================================================================
% Send this file to a PostScript device to list the names of all of
% the resident fonts, in ascending order.
%=======================================================================
%%Title: fontlist.ps
%%CreationDate: Thu Dec 15 09:31:00 MST 1994
%%Creator: Nelson H. F. Beebe <beebe@sunrise>
%%For: Nelson H. F. Beebe <beebe@sunrise>
%%BoundingBox: 0 0 612 792
%%DocumentMedia: A 612 792 () () ()
%%DocumentData: Clean7Bit
%%DocumentFonts: font Courier Times-Bold
%%DocumentNeededResources: font Courier Times-Bold
%%DocumentSuppliedResources:
%%Orientation: Portrait
%%PageOrder: Ascend
%%Pages: 1
% NB: The number of pages depends on the number of resident fonts
%%EndComments
%=======================================================================
%%BeginProlog
/fontlistdict 50 dict def
fontlistdict begin

/inch { 72 mul } def

/PointSize 10 def

/ColumnWidth 3.24 inch def	% slightly less than (8.5 - 2)/2

/Courier findfont PointSize scalefont setfont

/BaselineSkip PointSize 1.2 mul def

/BottomOfColumn { y 1 inch lt } def

/Bubblesort % Here is the sorting routine, courtesy of ulfis@nada.kth.se
{ % Usage: array Bubblesort
  % This code may be used for arrays of strings and arrays of numbers
  /TheArray exch def
  /num TheArray length def
  num 1 gt 
  {
    1 1 num 1 sub
    {
      /localcount exch def
      num 1 sub -1 localcount
      {
        /innercount exch def
        /firststring TheArray innercount 1 sub get def
        /secondstring TheArray innercount get def
        firststring secondstring gt
        {
           TheArray innercount 1 sub secondstring put
           TheArray innercount firststring put
        } if
      } for
    } for
  } if
} def

/ColumnOffPage { x ColumnWidth add 7.5 inch gt } def

/NewColumn
{
    /x x ColumnWidth add def
    /y Y def
    ColumnOffPage { showpage NewPage } if
    x y moveto
} def

/NewLine
{
    /y y BaselineSkip sub def
    BottomOfColumn { NewColumn } if
    x y moveto
} def

/NewPage
{
    /x 1 inch def
    /y 10 inch def
    /Y y def
    x y moveto
} def

end % fontlistdict
%%EndProlog
%=======================================================================
%%BeginSetup
/#copies 1  def
fontlistdict begin

% Count the fonts available, while putting all of the font names on
% the stack.  We need to create a new string for each of them, because
% scratch gets reused on each loop iteration.
/n 0 def
systemdict /resourceforall known
  {				% Level 2 PostScript
    /scratch 256 string def
    (*) { /n n 1 add def dup length string cvs } scratch /Font resourceforall
  }
  { 				% Level 1 PostScript
    FontDirectory { pop /n n 1 add def dup length string cvs } forall 
  }
ifelse

% Make an array to hold the font names and then store them from the stack
/FontArray n array def
FontArray astore

% Sort the font array (astore left FontArray on the stack)
Bubblesort

end %fontlistdict
%%EndSetup
%=======================================================================
%%Page: 1 1
%%BeginPageSetup
fontlistdict begin
NewPage
end % fontlistdict
%%EndPageSetup

fontlistdict begin

% Display the sorted fonts: this make take several pages
/n 0 def
/nstr 10 string def
FontArray
{
    /n n 1 add def
    n   10 lt { ( ) show } if
    n  100 lt { ( ) show } if
    n 1000 lt { ( ) show } if
    n nstr cvs show
    (: ) show
    show
    NewLine
}
forall

/Times-Bold findfont PointSize scalefont setfont
(Total memory: ) show
vmstatus 40 string cvs show
NewLine

(Memory used: ) show
40 string cvs show
NewLine

pop				% discard 3rd vmstatus value

(Free memory: ) show
vmstatus exch sub 40 string cvs show
NewLine

pop				% discard 3rd vmstatus value

end % fontlistdict

showpage
%%PageTrailer
%=======================================================================
%%Trailer
%%EOF