<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Sure enough, Cairo seems to be culling zero-width lines
somewhere, so it doesn't matter whether or not I check for zero
here.</p>
<p>For now, I propose that I get rid of the zero-check in my patch,
so anything <= 1 device unit is drawn with a PS_COSMETIC pen.
This value gets rounded to an integer, so this approach is
consistent with the definition of a hairline being the smallest
thing a printer can print.</p>
<p>In the long run, it would be nice to track down where Cairo is
culling zero-width lines and allow them through, as I believe
postscript and pdf both treat zero-width lines as hairlines.</p>
<p>-Rick-<br>
</p>
<br>
<div class="moz-cite-prefix">On 2018-10-18 12:09, Bill Spitzak
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAL-8oAi8DWPDjuRMcJoN7QyYM90+Jwiv3EZpDZ4gLbrGfhj+mA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr">I suspect there is code in Cairo that assumes
zero-width strokes are invisible, so it may be difficult to fix
it for only this device.
<div><br>
</div>
<div>The main reason for using zero rather than any other number
is that it survives scaling, which is pretty important for a
magic value.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Oct 18, 2018 at 11:12 AM Rick Yorgason
<<a href="mailto:rick@firefang.com" moz-do-not-send="true">rick@firefang.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Including zero-width strokes makes sense to me. After
all, true hairlines are supposed to act as though they're
zero-width.<br>
<br>
The reason I implemented it this way it's because I was
worried about two use cases:<br>
<br>
1) Some applications might rely on zero-width lines being
invisible. (Imagine an artist who selects all the lines he
wants to hide and changes their line width to zero.)<br>
<br>
2) Maybe some CNC machines rely on zero-width lines?
PS_COSMETIC lines are always 1 unit wide, so there would be
no way to send zero-width lines to the printer any more.
This seems unlikely to be a problem, but it's possible.<br>
<br>
(1) can be fixed by the calling application, and (2) isn't
likely a real problem, and if we include zero-width strokes
it would make it easier for developers to make true
zero-width hairlines (since they don't need to know the
target device's minimum unit size), so I'm down for it.<br>
<br>
-Rick-<br>
<br>
<div class="gmail_quote">On October 18, 2018 9:10:07 AM PDT,
Carl Worth <<a href="mailto:cworth@cworth.org"
target="_blank" moz-do-not-send="true">cworth@cworth.org</a>>
wrote:
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<pre class="m_3658271408548538196k9mail">On Wed, Oct 17 2018, Rick Yorgason wrote:
<blockquote class="gmail_quote" style="margin:0pt 0pt 1ex 0.8ex;border-left:1px solid #729fcf;padding-left:1ex">With this patch, I can use Inkscape to set my stroke width to 0.001" and
it will cut through the material as expected.
</blockquote>
If we're going to have a magic value here, I think I'd be much happier
to have 0 be the magic value.
(I know that your code isn't actually making 0.001" be magic, but a
whole range of values. I think I would really prefer to have that range
include rather then exclude 0.0.)
Does anyone see any reason why a stroke width of 0 shouldn't be treated
this way?
I think that would make a much better way to be able to document
this. ("Use a value of 0 to get a PS_COSMETIC pen which is useful when
targeting devices such as laser cutters".)
And speaking of documentation, it seems this patch should also be
touching up the documentation, such as in cairo_set_line_width?
I know the code is specific to the Windows backend, but I think it's
reasonable to put a backend-specific note into the general documentation
in a case like this.
-Carl
</pre>
</blockquote>
</div>
<br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my
brevity.</div>
-- <br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org" target="_blank"
moz-do-not-send="true">cairo@cairographics.org</a><br>
<a
href="https://lists.cairographics.org/mailman/listinfo/cairo"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.cairographics.org/mailman/listinfo/cairo</a></blockquote>
</div>
</blockquote>
<br>
</body>
</html>