GNOME Bugzilla – Bug 636348
Hex boxes are incorrectly scaled with non identity cairo scale
Last modified: 2010-12-28 09:18:16 UTC
When a non identity cairo scale is set, the ratio of the hex box size to the glyphs it is replacing is the same as the cairo scale. This is particularly noticeable with the cairo win32 printing surface. With this surface the device units = the printer dpi so after setting the cairo scale to eg 600/72 (for a 600dpi printer) the hex boxes are 600/72 larger than the surrounding text.
Created attachment 175759 [details] [review] Fix hex box scale Not sure if it is correct but this is the patch I've been using to fix the problem.
Thanks Adrian. Can you please include screenshots/photos of before/after?
Created attachment 175780 [details] win32 print surface with cairo scale =600/72 This PDF is of win32 printing output printed to a PDF printer. The cairo scale has been set to 600/72.
Created attachment 175781 [details] win32 print surface with gdi scale =600/72 THis PDF is also win32-print surface printed to a PDF printer. In this case the GDI ctm has been set to 600/72 and the cairo scale left as identity.
The patch in comment 1 is wrong. I was only testing with cairo scale = 2 and it was not immediately obvious that it was not working.
I reviewed the code, can't see anything wrong there. I wonder if it's a win32 only issue. Can you reproduce on linux? Or rather, 1. using normal PDF backend, 2. using the FreeType backend.
Created attachment 175810 [details] hex-box-test.c Linux test case.
Created attachment 175811 [details] output when cairo unscaled Here's the output, "unscaled.pdf", from the Linux test case for cairo scale = identity.
Created attachment 175812 [details] output when cairo scaled Here's the test case output, "scaled.pdf", with a non identity cairo scale.
Thanks. I'll track it down.
Fixed in master.