Cool strings example

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Cool strings example

Stuart Axon
I found this strings example:
http://www.siafoo.net/snippet/173

from here:
http://nodebox.net/code/index.php/Strings

I've only tested it in -dq where it shows up a couple of problems:  the output
doesn't appear to be stroked, also sometimes it seems to get the matrix is not
invertible error.

 S++



     
_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Reply | Threaded
Open this post in threaded view
|

Re: Cool strings example

Sebastian Oliva
On Sun, Oct 10, 2010 at 12:42 PM, Stuart Axon <[hidden email]> wrote:

> I found this strings example:
> http://www.siafoo.net/snippet/173
>
> from here:
> http://nodebox.net/code/index.php/Strings
>
> I've only tested it in -dq where it shows up a couple of problems:  the output
> doesn't appear to be stroked, also sometimes it seems to get the matrix is not
> invertible error.
>
>  S++
>

Fixed the textpath function, using a temporary CairoContext, it's
probably quite inefficient, but it works with this example and the one
with the Sewing.
Did not fixed the matrix non invertible error.
_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Reply | Threaded
Open this post in threaded view
|

Re: Cool strings example

Stuart Axon

--- On Mon, 10/11/10, Sebastian Oliva <[hidden email]> wrote:

> From: Sebastian Oliva <[hidden email]>
> Subject: Re: [shoebot-devel] Cool strings example
> To: [hidden email]
> Date: Monday, October 11, 2010, 6:49 PM
> On Sun, Oct 10, 2010 at 12:42 PM,
> Stuart Axon <[hidden email]>
> wrote:
> > I found this strings example:
> > http://www.siafoo.net/snippet/173
> >
> > from here:
> > http://nodebox.net/code/index.php/Strings
> >
> > I've only tested it in -dq where it shows up a couple
> of problems:  the output
> > doesn't appear to be stroked, also sometimes it seems
> to get the matrix is not
> > invertible error.
> >
> >  S++
> >
>
> Fixed the textpath function, using a temporary
> CairoContext, it's
> probably quite inefficient, but it works with this example
> and the one
> with the Sewing.
> Did not fixed the matrix non invertible error.

I haven't had a chance to look at the code yet, but:

Does it work when stroke is alpha and fill is set, or do you get a double outline?

If you get the double outline, have a look at how bezierpath does it's drawing - note it has special cases for if only stroke or fill are set that use fast paths (don't call pushgroup/popgroup which creates an intermediate context).

This is from memory, so I might be wrong.  RecordingSurface also gives an intermediate surface quite quickly, bit I think pushgroup/popgroup is the more Cairo way to do it.



> _______________________________________________
> Shoebot-devel mailing list
> [hidden email]
> http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
>


     
_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Reply | Threaded
Open this post in threaded view
|

Re: Cool strings example

Sebastian Oliva
On Mon, Oct 11, 2010 at 12:26 PM, Stuart Axon <[hidden email]> wrote:

>
> --- On Mon, 10/11/10, Sebastian Oliva <[hidden email]> wrote:
>
>> From: Sebastian Oliva <[hidden email]>
>> Subject: Re: [shoebot-devel] Cool strings example
>> To: [hidden email]
>> Date: Monday, October 11, 2010, 6:49 PM
>> On Sun, Oct 10, 2010 at 12:42 PM,
>> Stuart Axon <[hidden email]>
>> wrote:
>> > I found this strings example:
>> > http://www.siafoo.net/snippet/173
>> >
>> > from here:
>> > http://nodebox.net/code/index.php/Strings
>> >
>> > I've only tested it in -dq where it shows up a couple
>> of problems:  the output
>> > doesn't appear to be stroked, also sometimes it seems
>> to get the matrix is not
>> > invertible error.
>> >
>> >  S++
>> >
>>
>> Fixed the textpath function, using a temporary
>> CairoContext, it's
>> probably quite inefficient, but it works with this example
>> and the one
>> with the Sewing.
>> Did not fixed the matrix non invertible error.
>
> I haven't had a chance to look at the code yet, but:
>
> Does it work when stroke is alpha and fill is set, or do you get a double outline?
>
> If you get the double outline, have a look at how bezierpath does it's drawing - note it has special cases for if only stroke or fill are set that use fast paths (don't call pushgroup/popgroup which creates an intermediate context).
>
> This is from memory, so I might be wrong.  RecordingSurface also gives an intermediate surface quite quickly, bit I think pushgroup/popgroup is the more Cairo way to do it.
>

Yes, it works with alpha strokes and alpha fills, as I just return the
path object for drawpath to render.
I'm sure it could be more efficient, I'll look onto the
"RecordingSurface" method, or at least for a way to use the same
context used for the pre_rendering, as the current one works properly
and though I haven't had any performance issues yet, i think it can be
done faster.
_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
Reply | Threaded
Open this post in threaded view
|

Re: Cool strings example

Sebastian Oliva
On Mon, Oct 11, 2010 at 6:48 PM, Sebastian Oliva <[hidden email]> wrote:

> On Mon, Oct 11, 2010 at 12:26 PM, Stuart Axon <[hidden email]> wrote:
>>
>> --- On Mon, 10/11/10, Sebastian Oliva <[hidden email]> wrote:
>>
>>> From: Sebastian Oliva <[hidden email]>
>>> Subject: Re: [shoebot-devel] Cool strings example
>>> To: [hidden email]
>>> Date: Monday, October 11, 2010, 6:49 PM
>>> On Sun, Oct 10, 2010 at 12:42 PM,
>>> Stuart Axon <[hidden email]>
>>> wrote:
>>> > I found this strings example:
>>> > http://www.siafoo.net/snippet/173
>>> >
>>> > from here:
>>> > http://nodebox.net/code/index.php/Strings
>>> >
>>> > I've only tested it in -dq where it shows up a couple
>>> of problems:  the output
>>> > doesn't appear to be stroked, also sometimes it seems
>>> to get the matrix is not
>>> > invertible error.
>>> >
>>> >  S++
>>> >
>>>
>>> Fixed the textpath function, using a temporary
>>> CairoContext, it's
>>> probably quite inefficient, but it works with this example
>>> and the one
>>> with the Sewing.
>>> Did not fixed the matrix non invertible error.
>>
>> I haven't had a chance to look at the code yet, but:
>>
>> Does it work when stroke is alpha and fill is set, or do you get a double outline?
>>
>> If you get the double outline, have a look at how bezierpath does it's drawing - note it has special cases for if only stroke or fill are set that use fast paths (don't call pushgroup/popgroup which creates an intermediate context).
>>
>> This is from memory, so I might be wrong.  RecordingSurface also gives an intermediate surface quite quickly, bit I think pushgroup/popgroup is the more Cairo way to do it.
>>
>
> Yes, it works with alpha strokes and alpha fills, as I just return the
> path object for drawpath to render.
> I'm sure it could be more efficient, I'll look onto the
> "RecordingSurface" method, or at least for a way to use the same
> context used for the pre_rendering, as the current one works properly
> and though I haven't had any performance issues yet, i think it can be
> done faster.
>
Noticed a small oddity with the ones rendered by shoebot-dq, I was
missing the traslations, just fixed it now.
I'm starting to think on using the same context used for the
pre-rendering in order to measure all of the metrics (and path) and
then just changing the context in order to draw the text.
_______________________________________________
Shoebot-devel mailing list
[hidden email]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net