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 170106 - Use of %g in gnome-print-pdf.c
Use of %g in gnome-print-pdf.c
Status: RESOLVED FIXED
Product: gnome-print
Classification: Deprecated
Component: PDF backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2005-03-12 22:25 UTC by Owen Taylor
Modified: 2005-03-15 19:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2005-03-12 22:25:29 UTC
gnome-print-pdf.c uses %g all over the place for printing doubles.
Now, this is sort of dubious because we generally want fixed precision
on the page, not a fixed number of significant digits.

But more importantly than that, if you end up with a number very
close to zero, then %g will give scientific notiation, which is
not supported in PDF.

I saw this for the text matrix due to a gnome_print_rotate (gpc, 90)
(producing an invalid PDF file that neither xpdf nor acroread would
load) but it can occur in almost any use of %g in gnome-print-pdf.c

All uses of %g need in the file should be replaced with %f, some will
likely need a precision specified.
Comment 1 Jody Goldberg 2005-03-15 19:13:31 UTC
patched.