Created attachment 29967 [details]
The attached test case shows an apparent rasterizing of fonts when text is drawn on a group rather than on the bare context.
On Mac OS X (the only platform I have available for test at present), Preview renders the first line using sub-pixel interpolation. The second line uses basic anti-aliasing instead. And when the result is printed, the first line is crisp while the second line looks like.... well, a printed raster graphic.
I don't know if fonts are the only things being rasterized; paths seem to show similar symptoms.
We have been using this technique when drawing items that may need to be wrapped onto another page (draw it on a group, and if you run out of room, pop it, show page, then paint the group) for quite a while. I have PDFs generated with Cairo 1.4 that don't seem to exhibit this problem, though I haven't run this exact test case against an older Cairo to verify.
Created attachment 29973 [details]
Output from cairo 1.8.8
It works for me. This is the PDF output I get from 1.8.8. I tested it with evince, okular, and acroread.
It is probably a bug in Preview.
Created attachment 29974 [details]
Output from current git (1.9.3)
There have been some changes in the current git version in the way groups are written to PDFs. Cairo now avoids using PDF Patterns (which are really only intended for repeating patterns) for sources with CAIRO_EXTEND_NONE. This makes it easier for PDF viewers to render. One of the benefits is text in groups is now selectable.
Try this version and see if it works with Preview.
Created attachment 29980 [details]
Screenshot of preview showing 1.9.3 output
(In reply to comment #2)
> There have been some changes in the current git version in the way groups are
> written to PDFs. Cairo now avoids using PDF Patterns (which are really only
> intended for repeating patterns) for sources with CAIRO_EXTEND_NONE. This makes
> it easier for PDF viewers to render. One of the benefits is text in groups is
> now selectable.
Nice -- this definitely sounds like a step in the right direction.
> Try this version and see if it works with Preview.
I can select the text that was grouped, but curiously Preview still doesn't render it with sub-pixel smoothing. It may well be a bug in Preview, since Adobe Reader doesn't show the apparent issue on the 1.8.8 output, either on-screen (it always uses antialiasing anyway) or in print (preview's print output is "blurry", where Adobe's is clean).
Also, the leading "A" on "Arial" doesn't show up in Preview (see attached screenshot). It shows up in Adobe Reader on-screen but not when printed -- in fact, after printing, Adobe Reader shows the following:
> An error exists on this page. Acrobat may not display the page correctly.
> Please contact the person who created the PDF document to correct the problem.
Created attachment 29998 [details]
output from current git with bug fix
I've fixed the bugs causing the missing 'A' and acroread error message.
Try this version.
I can confirm that your fix makes the missing "A" reappear in Preview and in Acrobat's printed output) and that the error message is gone. Thanks!
I will see if I can report the Preview bug to Apple.