Any compilable svg renderer for flash?

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

Any compilable svg renderer for flash?

hortom
Hi!

Anyone has a good compilable svg renderer in HaXe?
I tried the xinf (0.5, 0.6), svgweb, and tried to import calsses from some as3 swfs.
No success.
For the first 2 give compile errors (Haxe 2.07, and r3826 too). :(
At the others swfmill gives unknown errors.

I needed linked image, and system font rendering capacity, and maybe normalizing.

Any idea? (I don't want to write a new svg lib. :) )

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Zjnue Brzavi
On Thu, Jun 23, 2011 at 1:56 PM, hortom <[hidden email]> wrote:

Anyone has a good compilable svg renderer in HaXe?
I tried the xinf (0.5, 0.6), svgweb, and tried to import calsses from some
as3 swfs.
No success.
For the first 2 give compile errors (Haxe 2.07, and r3826 too). :(
At the others swfmill gives unknown errors.

I needed linked image, and system font rendering capacity, and maybe
normalizing.

Hi,

The github version of xinf should be fine with haXe 2.07 : https://github.com/dturing/xinf
Besides that there is also SVG support in gm2d : http://code.google.com/p/gm2d/
Sample 2 shows usage, though it still needs to be sync's with recent NME build changes:
http://code.google.com/p/gm2d/source/browse/trunk/samples/2-Svg/Svg.hx

Zjnue

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

MarcWeber
In reply to this post by hortom
The easiest thing you can do is load it using a flash xmml or such and
reuse that in HaXe. [1]


There may also be some SVG libraries..


[1]:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="horizontal"
    viewSourceURL="srcEmbeddingSvgFiles/index.html"
>
    <mx:Script>
    <![CDATA[
            [Embed(source="Splash_Text.svg")]

            [Bindable]
            public var SvgFrog:Class;            
        ]]>
    </mx:Script>

        <mx:Image id="largeFrog" source="{SvgFrog}"/>
</mx:Application>

compile that using mxmlc, use -swf-lib Svg.swf  after having used --hx-gen-classes on that swf.

Then you can create and use that class containing the svg.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Dion Whitehead Amago

> The easiest thing you can do is load it using a flash xmml or such and
> reuse that in HaXe. [1]
>
> Then you can create and use that class containing the svg.
>

The internal svg->DisplayObject conversion is not very good: it's
missing a lot of the SVG spec, e.g. a lot of gradients don't work.  So
you end up wasting a lot of time checking if your svgs look like crap in
the compiled form.

Dion

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

jlm@justinfront.net
Ok not really renderer but some ways to get svg into swf ( if haXe  
ones don't work )

probably does not help but illustrator should work well.

also found his:

http://robla.net/1996/svg2swf/

and this

http://technoargia.free.fr/swftools/

you can also use flex sdk see below some of my old code.

package

{

     import flash.display.Sprite;

     import flash.text.TextField;

        import flash.display.Sprite;

        import flash.display.DisplayObject;

       

     [SWF( backgroundColor='0xFFFFFF', frameRate='30', width='200',  
height='200')]

     public class Main extends Sprite

     {

         private var textField: TextField;

                [Embed(source='circle.svg', mimeType='image/svg')]

                protected const EmbeddedSVG:Class;



                public function Main()

         {



             textField = new TextField();

             textField.text = "Test2.";

                        var svgDisplayObject = DisplayObject( new EmbeddedSVG() );

                        addChild(svg);

             addChild(textField);



         }

     }



}
On 23 Jun 2011, at 16:40, dionjw wrote:

>
>> The easiest thing you can do is load it using a flash xmml or such  
>> and
>> reuse that in HaXe. [1]
>>
>> Then you can create and use that class containing the svg.
>>
>
> The internal svg->DisplayObject conversion is not very good: it's  
> missing a lot of the SVG spec, e.g. a lot of gradients don't work.  
> So you end up wasting a lot of time checking if your svgs look like  
> crap in the compiled form.
>
> Dion
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Dion Whitehead Amago
In reply to this post by hortom


hortom wrote:
> Hi!
>
> Anyone has a good compilable svg renderer in HaXe?
> I tried the xinf (0.5, 0.6), svgweb, and tried to import calsses from some
> as3 swfs.
> No success.
> For the first 2 give compile errors (Haxe 2.07, and r3826 too). :(
> At the others swfmill gives unknown errors.
>

The latest haxelib version of hydrax has an SVGComponent that uses
svgweb on flash, and canvg and native svgs on js, so it looks the same
on both platforms.

Check out the example in hydrax/demo/svgui

Dion

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Franco Ponticelli
Do you have the compiled examples for hydrax accessible somewhere? Not all of them are that obvious to compile.

Franco

On Thu, Jun 23, 2011 at 10:22 AM, dionjw <[hidden email]> wrote:


hortom wrote:
Hi!

Anyone has a good compilable svg renderer in HaXe?
I tried the xinf (0.5, 0.6), svgweb, and tried to import calsses from some
as3 swfs.
No success.
For the first 2 give compile errors (Haxe 2.07, and r3826 too). :(
At the others swfmill gives unknown errors.


The latest haxelib version of hydrax has an SVGComponent that uses svgweb on flash, and canvg and native svgs on js, so it looks the same on both platforms.

Check out the example in hydrax/demo/svgui

Dion


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Dion Whitehead Amago


Franco Ponticelli wrote:
> Do you have the compiled examples for hydrax accessible somewhere? Not
> all of them are that obvious to compile.
>
> Franco

I assumed a *.hxml somewhere means that you should point the haxe
compiler at it, but I can see that maybe it's not obvious.

The svg UI examples you can see here:  http://dionamago.net/?p=426
Or just the examples:
http://dionamago.net/content/demos/svgui/flash/index.xhtml
http://dionamago.net/content/demos/svgui/canvas/index.xhtml
http://dionamago.net/content/demos/svgui/css/index.xhtml

The demo is not just for Svgs, but also for showing how you can
construct user interfaces from svg building blocks or flash MovieClips.
  The svgs are parsed, and the anchor positions extracted to know where
to place the children.


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Franco Ponticelli
Thank you for the examples ;)

On Thu, Jun 23, 2011 at 11:25 AM, dionjw <[hidden email]> wrote:


Franco Ponticelli wrote:
Do you have the compiled examples for hydrax accessible somewhere? Not
all of them are that obvious to compile.

Franco

I assumed a *.hxml somewhere means that you should point the haxe compiler at it, but I can see that maybe it's not obvious.

The svg UI examples you can see here:  http://dionamago.net/?p=426
Or just the examples:
http://dionamago.net/content/demos/svgui/flash/index.xhtml
http://dionamago.net/content/demos/svgui/canvas/index.xhtml
http://dionamago.net/content/demos/svgui/css/index.xhtml

The demo is not just for Svgs, but also for showing how you can construct user interfaces from svg building blocks or flash MovieClips.  The svgs are parsed, and the anchor positions extracted to know where to place the children.



--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

hortom
Thanks for the replies!

I need to load the svg from files, so the conversion is not an option. I will try the xinf from git and the gm2d, tomorrow - and post any success.
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

hortom
I tried gm2d SVG support. It draws more precise the thin lines (use opacity), than the others as3 version, but some needed feature is lacking yet, or I did not find them.
And I also tried svg4hx by Go2ghana. It is more robust by me, but needed some fix (in format library) to compile with the latest HaXe.
Thanks for them!
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

go2ghana
Am 24.06.2011 23:59, schrieb hortom:

> I tried gm2d SVG support. It draws more precise the thin lines (use opacity),
> than the others as3 version, but some needed feature is lacking yet, or I
> did not find them.
> And I also tried svg4hx by Go2ghana. It is more robust by me, but needed
> some fix (in format library) to compile with the latest HaXe.
> Thanks for them!
>
> --
> View this message in context: http://haxe.1354130.n2.nabble.com/Any-compilable-svg-renderer-for-flash-tp6508215p6513583.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
Hi,
I'd like to know what needs to be fixed with svg4hx format lib.
Did you use the format lib included there or the std?

Cordially,
Axel

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

hortom
I used with the std version, not the inculded. TFont tag is missing from format lib.
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

go2ghana
Am 29.06.2011 16:07, schrieb hortom:
> I used with the std version, not the inculded. TFont tag is missing from
> format lib.
Yes - therefore I included the version which handles the font tag -
useful for runtime font import.

> --
> View this message in context: http://haxe.1354130.n2.nabble.com/Any-compilable-svg-renderer-for-flash-tp6508215p6529100.html
> Sent from the Haxe mailing list archive at Nabble.com.
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

hortom
But 1 thing: the online svg4hx.swf is can handle the juanmontoya_lingerie.svg, but the compiled is not perfectly. :s
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

go2ghana
Am 30.06.2011 16:02, schrieb hortom:
> But 1 thing: the online svg4hx.swf is can handle the
> http://go2ghana.net/flashDevel/svgScreen.php?svgURL=svgweb/svg-files/juanmontoya_lingerie.svg
> juanmontoya_lingerie.svg , but the compiled is not perfectly. :s
> http://haxe.1354130.n2.nabble.com/file/n6533355/lingerie.jpg
>
> --
That's weird - how did you produce this one?
Still not absolutely correct but much better though the result I get .
http://go2ghana.net/flashDevel/lingerie.jpg
> View this message in context: http://haxe.1354130.n2.nabble.com/Any-compilable-svg-renderer-for-flash-tp6508215p6533355.html
> Sent from the Haxe mailing list archive at Nabble.com.
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

hortom
I use the svn trunk version (r101), and nor haxe 2.07, neither latest nightly build haxe can't compile. Just give some errors...
Which haxe version do you use to compile it?

HaXe 2.07 gives this:
../../lib/me/cunity/ui/Frame.hx:387: lines 387-396 : Field removeChildren should be declared with 'override' since it is inherited from superclass

The newer gives more errors:
../../lib/me/cunity/ui/Frame.hx:187: characters 20-62 : Cannot access to private field getElementWithAttVal
../../lib/me/cunity/ui/Copy.hx:47: lines 47-49 : Cannot access to private field copy
../../lib/me/cunity/ui/Frame.hx:387: lines 387-396 : Field removeChildren should be declared with 'override' since it is inherited from superclass

I didn't know how to fix this. Any idea?
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Jan_Flanders
Related thread for the removeChildren issue:
http://haxe.1354130.n2.nabble.com/require-flash11-td6284484.html

Jan
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

go2ghana
In reply to this post by hortom
Am 01.07.2011 15:32, schrieb hortom:

> I use the svn trunk version (r101), and nor haxe 2.07, neither latest nightly
> build haxe can't compile. Just give some errors...
> Which haxe version do you use to compile it?
>
> HaXe 2.07 gives this:
> ../../lib/me/cunity/ui/Frame.hx:387: lines 387-396 : Field removeChildren
> should be declared with 'override' since it is inherited from superclass
>
> The newer gives more errors:
> ../../lib/me/cunity/ui/Frame.hx:187: characters 20-62 : Cannot access to
> private field getElementWithAttVal
> ../../lib/me/cunity/ui/Copy.hx:47: lines 47-49 : Cannot access to private
> field copy
> ../../lib/me/cunity/ui/Frame.hx:387: lines 387-396 : Field removeChildren
> should be declared with 'override' since it is inherited from superclass
>
> I didn't know how to fix this. Any idea?
>
> --
> View this message in context: http://haxe.1354130.n2.nabble.com/Any-compilable-svg-renderer-for-flash-tp6508215p6537781.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
Hi - fortunately the removeChildren method seems to be unused so I
commented it out for now.
The other errors point to static functions  which are used with using -
no idea why this has compiled earlier - solved
now by declaring the functions public.
Tested successfully with r_3872

C., Axel

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Any compilable svg renderer for flash?

Tarwin Stroh-Spijer
Added some of the things listed here to http://haxe.org/doc/libraries (not sure if that's the best place but trying to keep some of the things that are talked about here on the documentation).

So, help out. Edit the wiki. Have fun :P


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Sat, Jul 2, 2011 at 4:42 AM, Axel Huizinga <[hidden email]> wrote:
Am 01.07.2011 15:32, schrieb hortom:

I use the svn trunk version (r101), and nor haxe 2.07, neither latest nightly
build haxe can't compile. Just give some errors...
Which haxe version do you use to compile it?

HaXe 2.07 gives this:
../../lib/me/cunity/ui/Frame.hx:387: lines 387-396 : Field removeChildren
should be declared with 'override' since it is inherited from superclass

The newer gives more errors:
../../lib/me/cunity/ui/Frame.hx:187: characters 20-62 : Cannot access to
private field getElementWithAttVal
../../lib/me/cunity/ui/Copy.hx:47: lines 47-49 : Cannot access to private
field copy
../../lib/me/cunity/ui/Frame.hx:387: lines 387-396 : Field removeChildren
should be declared with 'override' since it is inherited from superclass

I didn't know how to fix this. Any idea?

--
View this message in context: http://haxe.1354130.n2.nabble.com/Any-compilable-svg-renderer-for-flash-tp6508215p6537781.html
Sent from the Haxe mailing list archive at Nabble.com.

Hi - fortunately the removeChildren method seems to be unused so I commented it out for now.
The other errors point to static functions  which are used with using - no idea why this has compiled earlier - solved
now by declaring the functions public.
Tested successfully with r_3872

C., Axel


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
12