2008/05/14

The Labs.Com Graphic Lab PostScript
Last update 2001/10/04
The Labs - Design & Functionality For The Net

  1. GhostScript
  2. PostScript to Raster
  3. Fonts
  4. Tools
  5. Resources
  6. Bibliography
PostScript
1. GhostScript
IHMO PostScript wouldn't be that alive if GhostScript hadn't been written and shared publically. Download it and study its setup files (ps-source-files), and also most of the comprehensive .txt files enclosed in the distribution, they reveal profound PS knowledge.

PostScript
2. PostScript to Raster

The easiest solution is using GhostScript:

 gs -sDEVICE=ppmraw -q -r300 -dNOPAUSE -sOutputFile=output.ppm sample.ps 

Best you use netpbm (aka pbmplus), a toolset to handle pnm (ppm, pgm and pbm). Use ftpsearch to locate a copy of it, or FreeBSD there is a port in /usr/ports/graphics/netpbm/. You can also use PicArt to handle pnm-files.

GhostScript-3.33 and later provide many DEVICES. I usually use gs within perl to render PostScript, choose a high -r of 200 or 300 to have a good quality, too high resolution as 600 or higher create huge ppm files. PPM format is recommended as it's lossless true 24 bit color (RGB) and pretty simple format, otherwise PNG or TIFF are 24 bit lossless but compressed. Call

 gs --help 

GhostScript can be used to render Type 1 & Type 3 Fonts, but I would recommend nowadays to use the T1LIB. You require to write your own routines to write the picture though.

A simple Text to GIF rendering using perl:

 # assuming $font, $points, $dpi and $s are defined 
  
 $s =~ s/\(/\\(/g; 
 $s =~ s/\)/\\)/g; 
 open(F,">my.ps"); 
    print F "/$font findfont $points scalefont setfont\n"; 
    print F "($s) show  showpage quit\n"; 
 close(F); 
 `gs -sDEVICE=ppmraw -q -r$dpi -dNOPAUSE -sOutputFile=- my.ps |\ 
  pnmcrop | ppmquant 128 | ppmtogif > output.gif`; 

A cheap anti-aliasing you get by using pnmscale it with -xscale .5 and -yscale .5.

PostScript
3. Fonts

Internet Font Archives
O'Reilly has all the references, explore it.
TrueType/Type1 Fonts
Direct download zipped fonts
TrueType/Type1 Fonts [2]
Direct download zipped fonts, even more.
Warble: TrueType Archive
Highly recommended site to get fonts
The Font Archive
Our font-archive (aprx. 3000 downloadable fonts)

Links with require password to access them as they contain copyrighted material on our server and are only available for our customers.

PostScript
4. Tools

GhostScript
The must
T1LIB
PostScript Font Type1 Rasterizer
PSUTILS
Powerful toolset to handle ps-files
PSMERGE
Merge multiple ps-files into one.
TTF2Type1
TrueType Fonts converter to Type1 Postscript (local copy ttf2pt1-13feb98)

PostScript
5. Resources

Adobe Technical Notes
EPSF, PPD, AFM
Uni Zurich: PostScript Corner
Useful collection of ps-resources

PostScript
6. Bibliography

  • PostScript Language Reference Manual, First Edition, Adobe Systems Inc.
  • PostScript Language Tutorial and Cookbook, First Edition, Adobe Systems Inc.
  • PostScript Language Reference Manual, Second Edition, Adobe Systems Inc.
  •                                                                                                                                    

    Graphic LabSVG Lab

    Last update 2001/10/04

    All Rights Reserved - (C) 1997 - 2008 by The Labs.Com

    Top of Page

    The Labs.Com