The following information is provided as is, and the authors take no responsibility for the correctness.
The printer language ESC/P was originally developed by Epson for use with their early dot-matrix printers. Today it is supported also by Epson inkjet and laser printers as well as by many other dot-matrix printers in the market. ESC/P2 is an enhancement of ESC/P, i.e. it has new functions for font scaling, raster graphic printing, etc.
As with many printer languages, ESC/P or ESC/P2 on printers from different manufacturers may differ slightly in their functionality. Normally the differences are additional functions not provided with the original version from Epson, so beware of using them if you want to support all ESC/P or ESC/P2 compatible printers.
Information about ESC/P and ESC/P2 may be found in the printer manuals of the respective manufacturer. Sometimes it is only a short listing of all available functions (hopefully!) sometimes the functions are declared in depth with examples in BASIC. Character set tables and font width tables may be found there too.
Epson sells the “ESC/P2 Reference Manual”, which includes both ESC/P and ESC/P2, as well as a complete description of the differences in commands supported by each printer. The newest version is dated December 1997, and includes Stylus Color commands.
Project Gutenprint (Gimp-Print) also includes some information in the Developer's Manual.