Printing in Claws

Sylpheed-Claws’ current printing system sucks hard. It works with a command, so if you want to get something nice-looking, you’ve got to elaborate something like « txt2html %s | html2ps | lpr ». Quite user-friendly. If you just use « lpr %s », you’ll get a nice sheet of paper straight out the eighties, with wrapping in the middle of the words, nice utf-8 stuff instead of extended chars, and so on.

So, I spent a few hours googling for documentation on libgnomeprint and libgnomeprintui, found next to nothing. The API is not really straight-forward and an hello-world type example would have been nice to have.
This morning, probably after having googled for a magic combination, I found that Tomboy had a print plugin with an API that I liked at the first glance:

void gedit_print(GtkTextView *text);
void gedit_print_preview(GtkTextView *text);

After having taken the four relevant files from their CVS and modified our and, this worked perfectly nicely in less than one hour.

Thanks Gedit authors, thanks Tomboy authors!

As we’re in feature freeze, this will be commited later. If you want to try it sooner, I’ve put a patch there.

The obligatory screenshot