[cairo] line width = 0.0 ?
Keith Packard
keithp at keithp.com
Sat Jan 7 17:17:55 PST 2006
On Sat, 2006-01-07 at 21:05 +0100, Christian Krause wrote:
> Yes, the line width specification of pdf and of postscript are
> similiar. Both says that zero-width lines should be drawn as small as
> possible (so that they are still visible).
This spec comes from an era when 'as small as possible' was 1/300 of an
inch. As printers increased in resolution, people discovered that 'as
small as possible' was really smaller than they wanted. Imagine a
9600dpi typesetting machine...
The spec as written is not useful, so people kludge around it. There are
other parts of the PS spec which are equally hokey (PS implementations
don't actually use circular pens, for instance). However, the spec
hasn't been fixed, rather a practice of ignoring the broken parts and
making stuff up on the fly has taken hold. Sigh.
> Just a dumb question: Can I just use set this length with
> cairo_set_line_width(cairo, 1.0/300)
All cairo lengths are relative to the current CTM. The default CTM is
set to 1-1 pixels on a display and 1/72.0 of an inch for printers. So,
if you want to generate fine lines on both display and printers, you'll
want to use something like 72.0/300.0.
> I've not found it in the cairo API manual, but is it right that all
> kind of length values are in inches (and how many pixel are drawn
> depends on the dpi setting)?
I thought we had written this part down somewhere; we had rather lengthy
discussions about how the default CTM should be set up.
> Using 1.0/300 is line width seems to be too small for this purpose.
> Even with 300% zoom factor in evince the pdf "zero width line" is not
> visible.
oh yeah, that's 1/21600 of an inch...
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060107/512d1a4c/attachment.pgp
More information about the cairo
mailing list