6

In Ghostscript, on a windows xp pc with an inkjet printer, how can I see a sample of the fonts available on my system? I need to know what they are called to invoke them, and it would be useful to know what substitutions are made.

1
  • 1
    Those 4 folks who voted to move the question to stackoverflow clearly had no clue about this question being PostScript related, or had no clue about PostScript's nature as a Turing-complete programming language.... :-( Jan 18 '12 at 18:41
7

(*) {==} 256 string /Font resourceforall will pipe a list of all the fonts available to stdout.

Instead of a simple {==} for the proc argument to resourceforall you could supply a more complex routine to print a page of output using the font. Eg:

%!
(*) {cvn findfont 20 scalefont setfont
10 10 moveto (ABCDEFGHIJKLMNOPQRSTUVWXYZ) show showpage}
256 string /Font resourceforall

Or even:

%!
(*) {dup cvn findfont 20 scalefont setfont
10 100 moveto show 
10 10 moveto (ABCDEFGHIJKLMNOPQRSTUVWXYZ) show showpage}
256 string /Font resourceforall

You can make it as pretty as you like, or until you get bored.....

2
  • how can one use this answer, by calling gs?
    – Ant6n
    Oct 10 '16 at 7:00
  • 1
    @Ant6n yes, just call gs -c '(*) {==} 256 string /Font resourceforall' or save the above codes into a ps file and run gs file.ps
    – kralyk
    Jan 8 '19 at 14:19
2

It is there in the book I am using, to learn from and as a reference: "Postscript by Example" by Henry McGilpin and Mary Campione, Addison Wesley, 1992; ISBN 0-201-63228-4, Chapter 14 page 553, which has a dozen or so pages, 6 plus programs, on this very subject.

I got a download of the programs from the site and the file labelled "FONTS6.PS" is exactly what I want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.