home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Illustrator 3.0 & Fonts [NeXTSTEP]
/
AdobePlusPack_4.img
/
FontInstaller.app
/
fontdirectory.ps
< prev
next >
Wrap
Text File
|
1991-04-24
|
5KB
|
257 lines
%!
%%Title: fontsample.ps
%%CreationDate: Sat Nov 11 15:30:46 1989
% Copyright (C) 1987, 1991
% Adobe Systems Incorporated
% All Rights Reserved
% CreationDate: (4/23/91)
% use the real font in the sample, unless this boolean
% has been predefined to turn this off
/realfont where { pop }{
/realfont true def
} ifelse
realfont { %ifelse
/leading 18 def
/dumbfont /Times-Roman findfont 14 scalefont def
}{ %else
/leading 14 def
/dumbfont /Times-Roman findfont 12 scalefont def
} ifelse
/NextStepEncoding where { pop } { /NextStepEncoding false def } ifelse
/LeftStart 48 def
/MiddleStart 315 def
/Top 792 48 sub def
/Left LeftStart def
/lineadvance { %def
currentpoint exch pop leading sub Left exch moveto
currentpoint 48 lt { %ifelse
128 gt { %ifelse
showpage
/Left LeftStart store
}{ %else
/Left MiddleStart store
} ifelse
Left Top moveto
}{ %else
pop
} ifelse
} bind def
%
% Define a special findfont to use for making sure that local
% "on disk" fonts don't end up in memory on DPS machines
systemdict /shareddict known
{
/fNamBuffer 128 string def
fNamBuffer 0 (%font%) putinterval
/findfont {
dup SharedFontDirectory exch known
{
SharedFontDirectory exch get
}
{
dup FontDirectory exch known
{
FontDirectory exch get
}
{ % Run the file directly so it doesn't get put in either dir
dup
fNamBuffer 6 122 getinterval cvs length 6 add
fNamBuffer exch 0 exch getinterval
run
FontDirectory exch get
}
ifelse
} ifelse
} def
} if
/namebuff 512 string def
realfont { %ifelse
/PrintSample { %def
save exch
dup findfont 14 scalefont setfont
namebuff cvs
currentfont /Encoding get
dup dup StandardEncoding ne
exch NextStepEncoding ne and
exch 101 get /.notdef eq or
currentfont /FontName get /Machine eq or
currentfont /FontName get /Stencil eq or
currentfont /FontName get /AGaramond-Titling eq or {
currentfont
dumbfont setfont exch show (: )show
setfont
(AaBbCcDdEe) show
}{ show } ifelse
restore
lineadvance
} bind def
}{ %else
dumbfont setfont
/PrintSample { %def
% save exch
namebuff cvs show
% restore
lineadvance
} bind def
} ifelse
/buff 512 string def
/addfonttolist { %def
null def
} bind def
/$sort 20 dict def
% SortInit returns the root node of an empty binary tree.
/SortInit {
1 array
} def
% Insert expects a root node and string on the stack.
% inserts the string into the tree. It expect /compare
% to be defined, and to take two strings and return a boolian
% that tells if the first is greater than the second.
/compare {gt}def
/Insert
{exch dup 0 get type (nulltype) eq
{exch [ exch 1 array 1 array ] 0 exch put}
{aload pop aload pop 4 2 roll 2 copy compare
{pop 3 -1 roll pop Insert}
{pop exch pop Insert}
ifelse
}ifelse
}def
%PrefixWalk expects a root node and a proc body on the operand stack.
%For each element in the array, it executes the proc body.
/PrefixWalk
{$sort begin
cvx /!bt exch def bpwalk
end}def
/Sort {
$sort begin
% dictionary is on the stack
{ % forall
pop
buff cvs dup length string copy
tree exch Insert
} forall
end
} def
/Print {
$sort begin
tree { PrintSample } PrefixWalk
end
} bind def
$sort begin
/bpwalk
{dup 0 get type /nulltype eq
{pop}
{aload pop aload pop exch bpwalk exch !bt bpwalk}
ifelse
}def
end %end of $sort
/tree SortInit def
/memoryfonts 1000 dict def
/diskfonts 1500 dict def
%%EndProlog
%%BeginSetup
Left Top moveto
%%EndSetup
/Times-Italic findfont 14 scalefont setfont
(Fonts in Memory) show
lineadvance lineadvance
dumbfont setfont
memoryfonts begin
FontDirectory {
pop
buff cvs dup dup 0 get (|) 0 get eq { pop pop pop }{ %ifelse
dup (Screen-) anchorsearch {
pop pop pop pop
}{
pop pop addfonttolist
} ifelse
} ifelse
% addfonttolist
} bind forall
/SharedFontDirectory where {
pop
SharedFontDirectory {
pop
buff cvs dup dup 0 get (|) 0 get eq { pop pop pop }{ %ifelse
dup (Screen-) anchorsearch {
pop pop pop pop
}{
pop pop addfonttolist
} ifelse
} ifelse
} bind forall
} if
end %memoryfonts
memoryfonts Sort
Print
/tree SortInit def
diskfonts begin
% print "Fonts on Disk" at an appropriate place on the page
Left LeftStart eq { %ifelse
/Left MiddleStart store
}{ %else
currentpoint exch pop 300 le { %ifelse
showpage
/Left LeftStart store
}{ %else
lineadvance lineadvance
} ifelse
} ifelse
Left Top moveto
/Times-Italic findfont 14 scalefont setfont
(Fonts on Disk) show
lineadvance lineadvance
dumbfont setfont
/filenameforall where {
pop
(%font%*) {
dup length 6 sub 6 exch getinterval
% OK, now cover 2.0 bug where this returns the string
% <fontname>.font/<fontname> instead of just <fontname>
(.font/) search
{ % ifelse
pop pop
dup length string copy addfonttolist
}
{ addfonttolist }
ifelse
} 128 string filenameforall
(fonts/*) {
dup length 6 sub 6 exch getinterval
dup length string copy addfonttolist
} 128 string filenameforall
} if
end %diskfonts
diskfonts Sort
Print
showpage