How to make pictures using postscript programs (part 12) ----------------------------------------------------------------------------- To print text in postscript, you have first to declare which font you want to use. Onse you have set a font as current font, you just move to the cordinates where you want printing to start, give the string you want to print in parentheses, and give the command show. To select a font as current font, you neede first give the name of the font. Since this name is just a name and should not be evaluated, it must be started with a slash /Times-Roman findfont produces the Times-Roman font as current object, but before you can use it, it must be given a size, and set as the current font: /Times-Roman findfont 10 scalefont setfont sets your font for all printing to Times-Roman of height 10. Fonts available in the standard are Times-Roman, Times-Italic, Helvetica, Courier, as well as some variations like Helvetica-Oblique or Courier-Bold. Times-Roman is a standard roman font, like fonts in which books are printed. Times-Italic is an italics font: slightly slanted, and man characters, like f, extend below the baseline. Mathematical formulas are typically printed in italics (the f is an f that extends below). Helvetica is a sans-serif font, so it has a simple geometric structure without curls (serifs) at the end of the lines, and all lines of the characters are of the same thickness. Courier is a fixed-width font, like typewriters used to produce, in which all characters have the same width. If you print, e.g., programs, this is preferable, since it keeps alignments of characters in columns. Further fonts can be declared and included in the postscript documents, these are just the predefined fonts. ---------------------------Example27------------------------------------------ %!PS-Adobe-2.0 EPSF %%Title: Example of Text %%BoundingBox: 0.0 0.0 420 420 /Times-Roman findfont 40 scalefont setfont newpath 40 240 moveto (This is Important Text) show /Times-Roman findfont 13 scalefont setfont newpath 40 100 moveto (And some smaller text) show /Times-Roman findfont 3 scalefont setfont newpath 40 40 moveto (And something for those with really good eyes) show showpage ------------------------------------------------------------------------------ All printing is done relative to the current coordinate system ---------------------------Example28------------------------------------------ %!PS-Adobe-2.0 EPSF %%Title: Text, scaled and rotated %%BoundingBox: 0.0 0.0 420 420 210 210 translate /Times-Roman findfont 27 scalefont setfont 1 1 80 { newpath -34 180 moveto (Spiral) show -23 rotate 0.98 0.98 scale } for showpage