widget Signature to SVG pathdata

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

widget Signature to SVG pathdata

Post by istech »

Hi All,

I want to copy path data from a signature widget to a SVG widget. Is this possible? The path data appear to be in a different format. Is there a different process to follow?

Thanks
stam
Posts: 3209
Joined: Sun Jun 04, 2006 9:39 pm

Re: widget Signature to SVG pathdata

Post by stam »

Hi istech,

I'm far from an expert in SVG but have had success by just copying the path data into the path in the inspector of an SVG widget. I open the SVG in a text editor and just copy the path data (without the surrounding quotes, usually starts with an 'M') into the path data of an SVG widget's inspector.

SVG is a mixed bag as far as i can tell. The following lesson explains how to apply the above in more complex SVGs
https://lessons.livecode.com/m/33498/l/ ... -extension

Hope that helps,
Stam
bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 175
Joined: Tue Feb 23, 2010 10:53 pm

Re: widget Signature to SVG pathdata

Post by bobcole »

Copying the path from a Signature widget works but not very well. In fact, it doesn't look good at all.
I was curious about this so I created a sample stack with the best I could figure out.
Maybe someone else can figure out a better solution.
Bob
Signature to SVG.livecode.zip
(6.06 KiB) Downloaded 310 times
stam
Posts: 3209
Joined: Sun Jun 04, 2006 9:39 pm

Re: widget Signature to SVG pathdata

Post by stam »

Yes I find it doesn't always work - and depends largely on the type of SVG.
I more recently found that lesson on using Illustrator to modify the SVG before copying the path. I don't have illustrator sadly (i use Affinity Designer for vectors, but sadly doesn't seem to have the same functionality, or i don't know how to use it ;)

Do you have access to Illustrator to see if the advice in the lesson i linked above helps?
bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 175
Joined: Tue Feb 23, 2010 10:53 pm

Re: widget Signature to SVG pathdata

Post by bobcole »

I don't have Illustrator either.
Maybe there is an Open Source Software app that would help; Inkscape might be worth a try.
Sorry, I don't have any other ideas at the moment.
Bob
istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: widget Signature to SVG pathdata

Post by istech »

Thanks for your help all. I though there would be a straight forward way to do it and that maybe I was missing a command. That is not the case I suppose. :(

Saying that your stack is a great start to getting this working. It seems just the width and color data is missing for the svg widget. I'll see if it can be incorporated.

I must admit I only wanted to do it as the svg widget has some really cool features the signature widget does not have. Like setting the scaled width and height property which is not available on the signature widget.
Post Reply