SFML community forums

General => Feature requests => Topic started by: rhaase on September 23, 2014, 01:08:34 am

Title: SVG Support
Post by: rhaase on September 23, 2014, 01:08:34 am
The image loading support for SFML with textures and sprites is good, but I would like to target variable size screens with pristine graphics :-)

I looked around and saw some suggestions in past posts for cairo or imagemagik, but it like something in the spirit of SimpleFast... and I think that the rest of the community could benefit as well.

Any ideas?
Title: Re: SVG Support
Post by: Nexus on September 23, 2014, 06:57:24 am
Any ideas?
Do you have any? :)

There have been discussions about vector graphics in the past, make sure you read all of them. I think some people have even written working extensions.
Title: Re: SVG Support
Post by: rhaase on September 25, 2014, 04:41:00 am
Not an easy idea.  I saw a couple implementations, but nothing super easy or light to drop in.  Asked my friend to help with more research.  I'll ask him to start with researching the forums more.  Thanks for the suggestion.
Title: Re: SVG Support
Post by: Mario on September 25, 2014, 09:49:38 pm
I guess the most tricky part here is most would expect "all or nothing" regarding specifications.

I've looked into this in the past myself, and there are subsets of SVG (like the Tiny spec), which would be more feasible to support for the start, but even then there are quite a few things that would get very tricky (like intersections).

Think having a complete spec would probably against "easy" and/or "light", but at the same time it would be nice being able to load svg graphics, even if we're talking about simple shapes and outlines only.
Title: Re: SVG Support
Post by: zsbzsb on September 25, 2014, 09:58:26 pm
Who said we would need to write the rasterizer ourselves? Just looking around I found this (https://github.com/memononen/nanosvg) which may be a good starting point.
Title: Re: SVG Support
Post by: rhaase on September 26, 2014, 12:42:04 am
that looks super promising.  I'll give it a shot
Title: Re: SVG Support
Post by: Turbine on November 17, 2014, 03:01:21 am
I think since the Android SFML port, SVG is a near-future necessity. Imagine having to provide a 1920x1080 image for a portion of a 2k Android screen, and then proving some smaller images just for the lower powered devices. It's only going to get worse as higher density screens kick in.