[cairo-bugs] [Bug 12031] New: Negated values in the matrices generated by the PostScript backend are badly rounded

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 16 12:04:50 PDT 2007


http://bugs.freedesktop.org/show_bug.cgi?id=12031

           Summary: Negated values in the matrices generated by the
                    PostScript backend are badly rounded
           Product: cairo
           Version: 1.5.1
          Platform: All
               URL: http://gitweb.freedesktop.org/?p=users/cloos/cairo.git;a
                    =commit;h=25708248d72901677c630ea7cfc6010b638cef9a
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: postscript backend
        AssignedTo: cworth at cworth.org
        ReportedBy: cloos at jhcloos.com
         QAContact: cairo-bugs at cairographics.org


When cairo outputs PostScript it currently creates matrices which are
slightly off due to rounding during negation.

As an example, this was found in output from evince:

   /CairoFont-1-0 findfont
   [ 9.9585 0 0 -9.958399 0 0 ] makefont
   setfont

This patch moves the negation from the C into the PostScript, so the
above will become:

   /CairoFont-1-0 findfont
   [ 9.9585 0 0 -9.9585 0 0 ] makefont
   setfont

In PostScript, -0 is the same as 0, so (compliant) PostScript
interpreters will Do The Right Thing should cairo emit a -0.

I’ll attach a patch; it can also be pulled from:

git://people.freedesktop.org/~cloos/cairo.git


(Incidently, the value 9.9585 above comes from a system that believes there are
72.3 points per inch, as compared to the 72.27 ΤεΧ uses, or the 72.0
PostScript and PDF use.  I also saw an instance — though I can’t seem to
find it — where an integer turned into a float value:  something like 9 and
-8.9975 or so.)


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the cairo-bugs mailing list