>>>> I tried making a really preliminary proof-of-concept cairo port. :-)
>>>> It's still rough and has several glitches/limitations, but at least
>>>> it can generate a "resolution-independent screenshot" PDF as
>>>> attached. Maybe I'll clean up the code this weekend and hopefully
>>>> post a patch.
>>> Here's the patch for the Emacs 23.0.92 pretest (not the trunk HEAD).
>>> * No configure support. The easiest way would be to compile it with
>>> the GTK+ support that is already linked with cairo libs. Add
>>> -DUSE_CAIRO to CFLAGS to activate the cairo code.
>>> * Currently, texts, rectangles (filling and stroking), and trapezoids
>>> for reliefs are drawn using cairo by hooking the corresponding
>>> drawing routine calls in xterm.c.
> This time, I combined the cairo drawing code with GTK+ print dialogs
> code, which is actually almost the same as examples in the GTK+
> reference. The added primitives are:
> (x-page-setup-dialog): Pop up a page setup dialog.
> (x-get-page-setup): Return the value of the current page setup.
> It returns an alist like
> ((orientation . portrait)
> (width . 559.2755905511812) (height . 783.5697637795276)
> (left-margin . 18.0) (right-margin . 18.0)
> (top-margin . 18.0) (bottom-margin . 40.32000000000001))
> (x-print-frames-dialog FRAMES): Pop up a print dialog to print the
> current contents of FRAMES.
> The last one is intended to be called after some pagination (in Lisp)
> that creates a frame per page. Below is a simple example.
> You can try printing with M-x test-print-buffer RET. Because the
> current cairo drawing routines are hooked onto those in xterm.c in
> order to minimize the change, you'll see the actual frames on screen.
> Moreover, you might get an incorrect printed result because your
> window manager may clip the frames to fit in the screen size.
> Nevertheless, I think you can get the basic idea with this sample