In an ideal world there would be no need to choose which printer driver to use, and all printers would use the same driver (or, say, one driver for raster images, and another for vectors). That’s the goal of IPP Everywhere. In the mean while, there is often a choice of different drivers to use. CUPS leaves this decidedly up to the user. The foomatic database contains a list of which drivers are “recommended” for each printer, although this is limited to old-style drivers that use the foomatic engine such as hpijs and built-in ghostscript drivers, and to PostScript PPD files. It cannot recommend native CUPS drivers such as those contained in Gutenprint and HPLIP (hpcups).
The Fedora printing configuration tool, system-config-printer, tries to make a best guess about which driver is likely to be the most useful, taking into account foomatic recommended drivers, native CUPS drivers, manufacturer-provided PPD files, and so on. It does this by having some rules of thumb hard-coded into the part that does driver selection. It isn’t very pretty, and it’s not very flexible. It isn’t very easy to modify because of its complexity.
To solve this problem I’ve been working on an XML-driven way of describing which drivers are “best”. It works across all drivers, not just the subset that foomatic knows about (although it can use foomatic’s knowledge of recommended drivers). It can have recommended drivers, and can blacklist drivers altogether for specific printers.
It works by classifying drivers into “driver types” based on regular expressions for the PPD attributes CUPS provides: its name, IEEE 1284 Device ID, make-and-model, product, etc. Printers can be matched by regular expressions for their make-and-model names and IEEE 1284 Device IDs.
See the source for a full explanation of how it works.
UPDATED: Explanation link now links to HEAD which includes some changes since this was written.