praeclarum / NGraphics

NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.
MIT License
705 stars 133 forks source link

SVGReader path parser is extremely incomplete #25

Open BlueRaja opened 9 years ago

BlueRaja commented 9 years ago

I'm talking about this. The specs are here. There are a lot of issues

Here is an example path which does not work. It draws the very simple Japanese character ノ (from KanjiVG)

M52.25,14c0.25,2.28-0.52,3.59-1.8,5.62c-5.76,9.14-17.9,27-39.2,39.88

Clancey commented 9 years ago

The SVG parser is pretty much for Sketch only. I would recommend sending a pull request with the SvgReader improvements.

A faster work around would be open all the SVG in Sketch and Export them as SVG. This has fixed any that I have had issues with.

Emasoft commented 9 years ago

Who cares about Sketch? Sketch is a relatively new tool, and it is not widely used by 2d artists because of its huge limitations. All the artists I worked with use Illustrator or Inkscape to draw SVG components for apps or web sites. Please support SVG 1.1 format correctly, or this library would be useless to the 99% of developers. I don't understand why some people take for granted that the SVG format can be implemented partially. Think about what would have happened if the various libraries had supported JPEG or PNG format partially. Programs like Photoshop would have never existed and the entire computer graphic scene would have never took off. Standards are not optional. Comply to those is mandatory to avoid fragmentation.

Clancey commented 9 years ago

If this was a paid tool I would completely agree with you. But it's not.

Frank has been gracious enough to share an amazing library he wrote, in his own time, that is what he needed for his own app development. After which he decided to share it with the rest of us completely free.

If it is useful to you in the current state, then amazing use it. If there is something you feel is missing go ahead and contribute. Take a stab at implementing what you need and send a pull request. If you do not have the skill or time to contribute by writing code, feel free to hire a developer to contribute.

But please do not belittle such an awesome and amazing library written by an equally amazing developer.

Emasoft commented 9 years ago

Sorry, but being this library used in Xamarin Forms for SVG rendering I was lead to believe that it was developed under the economical support of the Xamarin company. I'm a paying Xamarin client, and being troubled by the incomplete SVG support in the framework I was just reporting it. I'm wondering why Xamarin is not paying Frank for developing this awesome library, considering that the Xamarin.Forms framework uses it for such essential features (see: https://github.com/paulpatarinski/Xamarin.Forms.Plugins/tree/master/SVG ). I would not even consider Xamarin.Forms for my business if it would not have the support for a cross platform and resolution independent graphic format like SVG. And this support is available only thanks to NGraphics library. So if someone from Xamarin is listening: please support this project. You can't make cross platform applications without cross platform image formats.

Clancey commented 9 years ago

That project you are referencing also is a community run project.

Emasoft commented 9 years ago

Well, you cannot do much with Xamarin.Forms without the Xamarin.Forms.Plugins library. I hope somebody at Xamarin will start to realize that and start supporting economically the developers of those projects.

BlueRaja commented 9 years ago

There's also Xamarin.Forms Labs, which has a ton of stuff missing from the base Xamarin.Forms: https://github.com/XLabs/Xamarin-Forms-Labs

Emasoft commented 9 years ago

Xamarin.Forms.Labs doesn't support SVG or any other vector image format. It's useless for building UIs.

snboisen commented 8 years ago

Damn, that explains why none of our icons are rendering correctly.

Emasoft commented 8 years ago

This is arguably the most important library in the whole Xamarin ecosystem. And yet its development is lethargic at best. There is currently such a huge demand for SVG in app development that if a working commercial solution arises (really working, not like some slapped together wrapper libraries, slow and buggy as hell, you can find now in the xamarin store), it would sell like hotcakes.

damian-666 commented 8 years ago

Yes, the nuances in inkscape for me after years is the layers, offsets and scales. Layers are actually groups. (smells like poor design) . it might require some coordination with the inkscape source and tech leads. a file format without a canonical drawing reference is not much.

I have had to use two versions of inkscape in my workflow to to export xaml to my Silverlight and or wpf. if this product worked well it could be bought by MSFT. to be honest I haven't tried it but as soon as I find time to ditch Silverlight (not easy since I want osx support,14 man years of code, and there is a ton of " line of business" community UI code for it.

a scenegraph could make Inkscape an alternate to illustrator, and if a sponsor is found the code could go in inkscape first. the sponsor code be AutoDesk, MSFT..anyone who wants svg import.

the scenegraph is a basic starting point for a non trivial drawing program. I worked on viewers for AutoDesk for 10 years, maybe I could help . AutoCAD products have had real time pan zoom for decades, better than any Adobe product. Adobe has 3rd party plugins but I think they hate Inscape...

-----Original Message----- From: "Emasoft" notifications@github.com Sent: ‎7/‎14/‎2016 2:27 To: "praeclarum/NGraphics" NGraphics@noreply.github.com Subject: Re: [praeclarum/NGraphics] SVGReader path parser is extremelyincomplete (#25)

This is arguably the most important library in the whole Xamarin ecosystem. And yet its development is lethargic at best. There is currently such a huge demand for SVG in app development that if a working commercial solution arises (really working, not like some slapped together wrapper libraries, slow and buggy as hell, you can find now in the xamarin store), it would sell like hotcakes. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

AnanlaTech commented 7 years ago

Data Points are missing like g in the path - d in the path which is missing and It throws an exception as Not supported for path data.

Emasoft commented 7 years ago

@AnanlaTech Can you post a link to an svg file with an example of those missing path commands? I've already made a Pull Request for adding some commands, maybe I can do another for those ones.

AnanlaTech commented 7 years ago

@Emasoft Thanks for helping me. Here is the file Link : SVG