Demos · Utilities · Applications · Books · Links
Demos |
Utilities |
Here is a solution to your problem, if you work with Linux or some other Unix. A few scripts that generates a set of HTML files, listing examples of all your installed fonts, with links to demos of the full character set of individual fonts:
ps-mode.el (© Free Software Foundation, Inc.) is a GNU Emacs major editing mode for PostScript. It provides simple error handling, menus, syntax-highlighting, auto-indentation, and some usefull PostScript functions.
;; Set up autoloading and auto-mode (autoload 'ps-mode "ps-mode" "Major mode for editing PostScript" t) (setq auto-mode-alist (append '(("\\.[eE]?[pP][sS]$" . ps-mode)) auto-mode-alist))PostScript mode version 1.1 offers font-lock support. To switch on fontification, put this in your .emacs file (Emacs 20):
;; Turn on font lock, use lazy-lock for large PostScript files (setq font-lock-maximum-decoration t) (add-hook 'ps-mode-hook '(lambda () (make-local-variable 'font-lock-support-mode) (make-local-variable 'lazy-lock-defer-on-scrolling) (setq font-lock-support-mode 'lazy-lock-mode lazy-lock-defer-on-scrolling t) (turn-on-font-lock))) (add-hook 'ps-run-mode-hook '(lambda () (turn-on-font-lock)))
ps2ppm (© P. Kleiweg) is a Perl5 script for converting PostScript to color images such as GIF. It works under Unix, using ghostscript. You might have to modify the first line of the script to make it work.
Run ps2ppm without any arguments to list permitted options.
The only requirement a PostScript file has to fulfil to enable ps2ppm to handle it properly is that the %%BoundingBox comment is correctly defined.
ps2ppm can handle multi-page images as long as all pages have the same BoundingBox. This can be demonstrated with:
ps2ppm rshadow
The illusion of high resolution images can be created using the following steps:
ps2ppm -r 216 file
Or you can use command line utilities often found on Unix (pnmscale does blurring by default):
ps2ppm -r 216 file pnmscale .3333 file.01.ppmraw | cjpeg > file.jpg pnmscale .3333 file.01.ppmraw | ppmquant 256 | ppmtogif > file.gif
Another thing you could try is using the anti-aliassing capabilities of Ghostscript. You can switch them on with options -t (text) and/or -g (graphics). The results are sometimes good (even better with text), sometimes bad:
ps2ppm -t -g file cjpeg file.01.ppmraw > file.jpg ppmquant 256 file.01.ppmraw | ppmtogif > file.gif
ps2ppm obtains the best color rendering when converting to ppm or ppmraw (the default). Converting directly to gif8, might give imperfect results.
The standard PostScript fonts are intended to be used on a high-resolution output device (300dpi or more). Converting to a bitmap may result in text that is hardly readable.
A solution to this problem is to use one of the many X11 fonts. (If you don't have access to a X server, read on.) These are designed for a low resolution screen (about 75dpi) and will look good when converted to bitmaps. A program that performs this conversion, even for 16 bit character sets, is:
font2ps.c
A PostScript program fntst.ps can be used to test fonts created with font2ps.
When the font is created it is given the name XFont. To change this, search towards the end of the produced file for the line that reads:
/XFont exch definefont popThe usage of these fonts is slightly different from ordinary fonts. Compare these two examples:
/Times-Roman findfont 10 scalefont setfont (Xfont.psf) run /XFont findfont setfontThese fonts should not be scaled. Set the resolution of the output device to exactly 72dpi for accurate results.
For those who don't have access to an X server, here are some `precompiled' fonts:
Filename | PS fontname |
X11 fontname | |
Xbold.psf | XBold |
-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1 | |
Xfixed.psf | XFixed |
-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 | |
Xitalic.psf | XItalic |
-adobe-times-medium-i-normal--14-140-75-75-p-73-iso8859-1 | |
Xlarge.psf | XLarge |
-adobe-new century schoolbook-medium-r-normal--18-180-75-75-p-103-iso8859-1 | |
Xserif.psf | XSerif |
-adobe-times-medium-r-normal--14-140-75-75-p-74-iso8859-1 | |
Xserifb.psf | XSerif-Bold |
-adobe-times-bold-r-normal--14-140-75-75-p-74-iso8859-1 | |
Xsymbol.psf | XSymbol |
-adobe-symbol-medium-r-normal--14-140-75-75-p-85-adobe-fontspecific |
Here are some examples:
gs -r300 -sDEVICE=djet500 -sOutputFile=file.%03d -dNOPAUSE file.ps -c quitThis will produce files like file.001, file.002, etc.
Applications |
Books |
Teach yourself PostScript within a few hours:
Essential reference guide, not suited as a tutorial:
Links |