[cairo-bugs] [Bug 23364] Useless digits for float numbers in Cairo output
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Aug 21 05:46:52 PDT 2009
http://bugs.freedesktop.org/show_bug.cgi?id=23364
--- Comment #11 from Adrian Johnson <ajohnson at redneon.com> 2009-08-21 05:46:50 PST ---
If you really want to control the output precision now you can edit the
"#define SIGNIFICANT_DIGITS_AFTER_DECIMAL" at the top of
src/cairo-output-stream.c.
I don't think overloading the meaning of cairo_set_tolerance() to control
floating point precision in vector backends as well as the tolerance of curve
flattening in image backends and is good API design.
Using a tolerance in device units does not make sense for all the floating
point values emitted by the PDF backend. For example in PDF floats are used
for:
- coordinates
- colors
- Td operator for text
- pattern matrices
- function domains
Coordinates are already limited to 3 decimal places due to the use of
24.8 fixed point.
Controlling the precision of colors is not possible with a parameter in device
units. Users may wish to control the precision of color independently of
coordinates.
Neither does it make sense to use a value in device units to control the
precision of values in pattern matrices. These should be set using number of
significant figures.
The mesh gradient patches on my 'mesh' branch adds an additional complication
when making precision adjustable. The number of bits per coordinate and bits
per color component of coordinates and colors in the shading stream is
selectable.
There really isn't any way to control the output precision of all these
different floats with one paramater. Maybe the proposed debug environment
variable would be a good way to set the precision particularly as many
applications are unlikely to make available a user configurable setting for
output precision.
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the cairo-bugs
mailing list