Article View: comp.lang.postscript
Article #3060Print all fonts
From: David Berman
Date: Tue, 04 Sep 1990 06:42
Date: Tue, 04 Sep 1990 06:42
112 lines
3995 bytes
3995 bytes
In article <41652@sequent.UUCP>, calvin@sequent.UUCP (Calvin Goodrich) writes:
> In article <1990Aug30.115009.16513@msuinfo.cl.msu.edu> delong@frith.msu.edu (Keith Delong) writes:
> >Does anyone have a postscript program that will print a short sample
> >of all the fonts that my printer has? We have several postscript printers
> >Keith
> >delong@frith.egr.msu.edu
>
> i was kinda curious too. i saw in one of the books that there were scads of
> font types so i came up with a quick and dirty sampler.
> calvin.
I had a similar problem, and so I hunted around, and found a dictionary with
all of the font names in it. If the code is poor, forgive me. If you like it,
mail me. I did it as an etude...
%!%%%%%%%%%%%%%%%%%%%%%%%%%%%%% the gillotine cuts here %%%%%%%%%%%%
%!
% testfont.ps 90 july 23
%
% use this after copying anyfont.ps to your postscript printer
% to confirm it is working. -Dave Berman
%
% tested using GoScript interactively
%
% let me know what happens on other printers...
%
/inch {72 mul} def
/setxy {.5 inch 10 inch moveto currentpoint /y exch def /x exch def} def
setxy
/nl {/y y fsize 3 add sub def y 0 lt {showpage setxy} if
x y moveto} def
/buffer 75 string def
/dKB (%stdin) (r) file def
(\007\015\012\015\012TESTFONT: Which font to print with? )
print dKB buffer readline
pop
cvn /TheFont exch def
/fsize 40 def
TheFont findfont [40 0 0 fsize 0 0] makefont setfont
(This is ) show
TheFont buffer cvs show nl
/fsize 30 def
TheFont findfont [20 0 0 fsize 0 0] makefont setfont
(abcdefghijklmnopqrstuvw) show ( ABCDEFGHIJKLMNOPQRSTUVW) show nl
(xyz XYZ 1234567890) show ( ~!@#$%^&*()_-+`--={}[]:) show (;'"<>?,./) show nl
/fsize 20 def
TheFont findfont [15 0 0 fsize 0 0] makefont setfont
FontDirectory /FontDirectory load
{ pop buffer cvs show nl } forall
%/fsize 90 def
%TheFont findfont [80 0 0 fsize 0 0] makefont setfont
%
%(Enjoy!) show nl
%(Dave Berman daveb@comspec.uucp) show nl
showpage
% did it work?
quit
/IncLine {line lh sub /line exch def
lines 1 add dup pl ge
{pop 0 fspage /line sl def} if /lines exch def} def
/create {lm line moveto shbuf IncLine} def
/dRead { readline pop dup (\013) search { pop = pop pop
/buffer 2000 string def
input buffer readline pop } { pop } ifelse } def
%was /al {input buffer readline pop dup = create} def
/al {input buffer dRead dup = create} def
%was /input (%stdin) (r) file def
/*start { d* propf /line sl def /lines 0 def #P
propf /#s sv /s# findfont 10 ckh /ptsize 10 def
{al} loop } def
/d* {
/dKB (%stdin) (r) file def
(\007\015\012\015\012Enter the [next] file to process: )
print dKB buffer readline
pop /dFName exch def
/input dFName (r) file def
} def
*start
I believe that this undocumented command exists
in most printers, but it does not work to well. (at least in my
experience you lose total control of the machine, and there apears to
be no way to recover control.) I experimented with this quite a bit
and wound up abandoning it. Perhaps I just didnot understand it well
enough. You can find this, by dumping serverdict and/or
statusdict....
in interactive mode:
serverdict statusdict
/serverdict load {== ==} forall
/statusdict load {== ==} forall
--
Dave Berman
436 Perth Av #U-907 daveb@comspec.UUCP Computer at work
Toronto Ontario uunet!mnetor!becker!comspec!daveb
Canada M6P 3Y7 416-785-3668 Fax at work
Technical Details
Message-ID:
<1990Sep4.064200.15940@comspec.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!censor!comspec!davebReferences:
<1990Aug30.115009.16513@msuinfo.cl.msu.edu> <41652@sequent.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!censor!comspec!daveb
From: daveb@comspec.uucp (David Berman)
Newsgroups: comp.lang.postscript
Subject: Print all fonts
Summary: This prints all the fonts' names by
accessing the Font Dictionary.
Message-ID: <1990Sep4.064200.15940@comspec.uucp>
Date: 4 Sep 90 06:42:00 GMT
References: <1990Aug30.115009.16513@msuinfo.cl.msu.edu> <41652@sequent.UUCP>
Organization: Comspec Communications Inc., Toronto Ontario Canada
Lines: 112