GIMP-Print - printers.xml

Go to the first, previous, next, last section, table of contents.

## D.1 ``printers.xml'`

``printers.xml'` is an XML-like file (there's no formal DTD) that contains very simple printer definitions. A typical definition follows:

    <printer name="EPSON Stylus Color 1500" driver="escp2-1500">
    <color>
    <model value=2>
    <gamma value=0.597>
    <density value=1.0>
    <language value=escp2>
    </printer>

There are other tags that may be present. The only ones that are mandatory are ``<printer>'`, ``<color>'`, ``<model>'`, and ``<language>'`. The other optional parameters (gamma and density in this case) can be used to adjust control settings. This is probably not the right place for them; the printer drivers themselves should contain this information. There's probably no good reason for anything but gamma and density to be in here. Gamma refers to the printer's gamma factor; density is the desired base ink density for the printer. The Epson driver contains the density information for each printer at each resolution internally. An even better driver would adjust density and possibly even gamma for paper type. All the more reason not to have that information here.

If you really are curious about what tags are permitted, please see ``printdefl.l'`. I deliberately want to make this obscure.

Anyway, here's the definition of the tags that do matter:

``printers.xml'` tag: `<printer name="longname" driver="drivername">`
  This starts the definition of a printer. The longname should be something human readable; the drivername should consist of alphanumerics and hyphens, and be fairly short. The longname is what will appear in the GUI listing of printers; the drivername is what is actually used to key into the list of printers. It is legal to have multiple printers with the same driver name.

``printers.xml'` tag: `<color>`
``printers.xml'` tag: `<nocolor>`
  Indicates that this printer is capable of color, or is not capable of color respectively

``printers.xml'` tag: `<model value=int>`
  This defines a model number. This is passed into the driver, which may do whatever it cares to with it--index into a table, compute on, or whatever. This need not be unique.

``printers.xml'` tag: `<language value=type>`
  This defines what driver module this printer uses. type should be ``escp2'`, ``pcl'`, ``canon'`, or ``ps'`.

``printers.xml'` tag: `</printer>`
  This, of course, closes off a printer definition.

This is handled very ad-hoc. It's ugly. But it's reasonably easy to extend, and it's buzzword-compliant.

Go to the first, previous, next, last section, table of contents.