After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636348 - Hex boxes are incorrectly scaled with non identity cairo scale
Hex boxes are incorrectly scaled with non identity cairo scale
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: cairo
unspecified
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2010-12-03 07:05 UTC by Adrian Johnson
Modified: 2010-12-28 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix hex box scale (929 bytes, patch)
2010-12-03 07:06 UTC, Adrian Johnson
needs-work Details | Review
win32 print surface with cairo scale =600/72 (129.07 KB, application/pdf)
2010-12-03 13:01 UTC, Adrian Johnson
  Details
win32 print surface with gdi scale =600/72 (160.85 KB, application/pdf)
2010-12-03 13:03 UTC, Adrian Johnson
  Details
hex-box-test.c (1.13 KB, text/x-csrc)
2010-12-04 00:07 UTC, Adrian Johnson
  Details
output when cairo unscaled (9.70 KB, application/pdf)
2010-12-04 00:09 UTC, Adrian Johnson
  Details
output when cairo scaled (9.09 KB, application/pdf)
2010-12-04 00:10 UTC, Adrian Johnson
  Details

Description Adrian Johnson 2010-12-03 07:05:14 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.
Comment 1 Adrian Johnson 2010-12-03 07:06:37 UTC
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.
Comment 2 Behdad Esfahbod 2010-12-03 07:15:07 UTC
Thanks Adrian.  Can you please include screenshots/photos of before/after?
Comment 3 Adrian Johnson 2010-12-03 13:01:05 UTC
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.
Comment 4 Adrian Johnson 2010-12-03 13:03:35 UTC
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.
Comment 5 Adrian Johnson 2010-12-03 13:07:05 UTC
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.
Comment 6 Behdad Esfahbod 2010-12-03 18:55:22 UTC
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.
Comment 7 Adrian Johnson 2010-12-04 00:07:29 UTC
Created attachment 175810 [details]
hex-box-test.c

Linux test case.
Comment 8 Adrian Johnson 2010-12-04 00:09:19 UTC
Created attachment 175811 [details]
output when cairo unscaled

Here's the output, "unscaled.pdf", from the Linux test case for cairo scale = identity.
Comment 9 Adrian Johnson 2010-12-04 00:10:36 UTC
Created attachment 175812 [details]
output when cairo scaled

Here's the test case output, "scaled.pdf", with a non identity cairo scale.
Comment 10 Behdad Esfahbod 2010-12-06 18:00:26 UTC
Thanks.  I'll track it down.
Comment 11 Behdad Esfahbod 2010-12-28 09:18:16 UTC
Fixed in master.