<div dir="ltr">I don't know if is useful in this case, but I had a problem<div>related to the way the borders and fill of the shapes and was solved using </div><div>push_group and pop_group_to_source.</div><div>I don't know if that apply to pdf files neither.</div><div>Examples here <a href="http://godiard.blogspot.com.ar/2013/05/nice-cairo-trick-to-draw-transparent.html">http://godiard.blogspot.com.ar/2013/05/nice-cairo-trick-to-draw-transparent.html</a> <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 24, 2015 at 12:56 PM, David Kastrup <span dir="ltr"><<a href="mailto:dak@gnu.org" target="_blank">dak@gnu.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Andreas Lobinger <<a href="mailto:lobingera@gmail.com">lobingera@gmail.com</a>> writes:<br>
<br>
> Hello colleague,<br>
><br>
> first to your question, if it would be possible to detect the case;<br>
> closely looking at the rendering model which consecutively puts paint<br>
> onto a surface it think it would be hard to do. The detection would<br>
> need to look at consecutive stroke and fill operations and delaying<br>
> the rendering until decision.<br>
><br>
> Traditionally the concept of stroke adjustment is considered in<br>
> rendering lines and in the first place i'd rather try to find a path<br>
> construction of stems that is essentially a line stroked, that would<br>
> have the bonus that you can at least ask the PDF viewer to apply<br>
> stroke adjustment and see what it tries to forward to cairo path<br>
> construction.<br>
<br>
</span>Shrug.  Because of the antialiasing behavior of Cairo, we can only do a<br>
single stroke over the whole rectangle width.  In order to get the<br>
rounded corners, there needs to be a clipping path set that will round<br>
out the corners from this large stroke.  The clipping path needs to cut<br>
off top and bottom but must not "accompany" the gist of the stroke in<br>
order not to interfere with its stroke adjustment and aliasing.<br>
<br>
The rounded corners are still bumpy since obviously the border of the<br>
stroke is stroke-adjusted while the clipping path for rounding the<br>
corners isn't.  So they don't join up perfectly.<br>
<br>
Also the PDF file tends to be about 5 times the size compared to not<br>
doing this.  Probably acerbated by us writing PostScript and using<br>
Ghostscript's ps2pdf for converting to PDF.  But that's supposed to<br>
leave stuff in a rather similar state regarding the rendering model.<br>
<span class="im HOEnZb"><br>
>> I encountered the problem in the past that note stems in LilyPond<br>
>> render rather inconsistently and generally too thick in PDF viewers<br>
>> using Cairo.<br>
>><br>
>> Now the stems are rounded rectangles, and they are unsurprisingly<br>
>> done by stroking a closed rectangle with a circular pen (or rather<br>
>> with a given line thickness and rounded corners) and then filling the<br>
>> path.<br>
<br>
</span><div class="HOEnZb"><div class="h5">--<br>
David Kastrup<br>
<br>
--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" rel="noreferrer" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Gonzalo Odiard<br><br><div>SugarLabs - Software [for | by] children learning <br></div></div></div></div></div>
</div>