If cupsRasterOpen fails, the most likely cause is that some earlier
filter didn't produce any output. If we output an error-level message
in this situation, we'll likely displace some earlier, more useful
message by the other filter.
PJL has a job name field. I don't think this is used for anything, but
just in case I want to put something human-readable there. But it's
also probably a good idea to keep this pure ASCII text.
Previously I used iconv() to convert the CUPS job name to ASCII. But:
- on FreeBSD, an explicit "-liconv" seems to be necessary (#10),
- there's an autoconf macro to deal with this, but it's tangled up
with gettext and it seems like a hassle,
- the //TRANSLIT//IGNORE feature I used seems to be a GNU extension
and probably won't work on other systems anyway.
So instead, let's just concatenate some job information together,
dropping any non-ASCII component. That's probably good enough.
The official Brother driver treats Tumble and NoTumble differently, adding &l2S and &l1S respectively to the header.
Unfortunately, for me this resulted in missing lines in NoTumble. By treating everything as Tumble and simply sending data rotated 180 for Tumble we get a good quality printout.