PureSVG - now with LoadSVG() !
Re: PureSVG (updated 27/Jan/10)
#Black and #White is not assigned with an value.
Using the pie chart demo it's terrible slow.
Anyhow i'm going to do some tests for how i wanted to use SVG. I want to read SVG stored from openstreetmap as i don't want an "web"browser in my software.
Using the pie chart demo it's terrible slow.
Anyhow i'm going to do some tests for how i wanted to use SVG. I want to read SVG stored from openstreetmap as i don't want an "web"browser in my software.
Re: PureSVG (updated 27/Jan/10)
Just a small trick for openstreetmap embedded in your application :
http://www.purebasic.fr/english/viewtop ... nstreetmap
http://www.purebasic.fr/english/viewtop ... nstreetmap
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureSVG (updated 27/Jan/10)
Sorry, I thought those constants came with PB.KGB_X wrote:#Black and #White is not assigned with an value.
How long does it take, roughly? I'm concentrating on stability just now, but speed is obviously important and will be worked on later.Using the pie chart demo it's terrible slow.
Ah, in that case PureSVG isn't what you need. It can't load SVGs. I may write a procedure for that in the future, but it would be necessary for PureSVG to handle the whole SVG spec for such a procedure to be reliable.I want to read SVG stored from openstreetmap
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureSVG (updated 27/Jan/10)
I used the Linux version. Anyhow not a big issue.Seymour Clufley wrote:Sorry, I thought those constants came with PB.KGB_X wrote:#Black and #White is not assigned with an value.
It's a very nice start so i don't complain.Seymour Clufley wrote:How long does it take, roughly? I'm concentrating on stability just now, but speed is obviously important and will be worked on later.Using the pie chart demo it's terrible slow.
[/quote]Seymour Clufley wrote:Ah, in that case PureSVG isn't what you need. It can't load SVGs. I may write a procedure for that in the future, but it would be necessary for PureSVG to handle the whole SVG spec for such a procedure to be reliable.I want to read SVG stored from openstreetmap
I can probably add this and even if your code doesn't support everything it's a start.
Re: PureSVG (updated 27/Jan/10)
yes but this requires the user to be online if i'm not wrong.Progi1984 wrote:Just a small trick for openstreetmap embedded in your application :
http://www.purebasic.fr/english/viewtop ... nstreetmap
I have not been able to run this example as : *LibCurl_NewMemory = AllocateMemory(MemorySize(*LibCurl_SharedMem)) always crash.
"The spesified '*MemoryID' is null"
Re: PureSVG (updated 27/Jan/10)
But you can activate the cache with SQLite.KGB_X wrote:yes but this requires the user to be online if i'm not wrong.Progi1984 wrote:Just a small trick for openstreetmap embedded in your application :
http://www.purebasic.fr/english/viewtop ... nstreetmap
Update your fonction like here : http://www.purebasic.fr/english/viewtop ... 81#p297281KGB_X wrote:I have not been able to run this example as : *LibCurl_NewMemory = AllocateMemory(MemorySize(*LibCurl_SharedMem)) always crash.
"The spesified '*MemoryID' is null"
Re: PureSVG (updated 27/Jan/10)
Ok then the user has to "visit" that area to use this cache. I was thinking of downloading different areas in advance.Progi1984 wrote:KGB_X wrote:Progi1984 wrote:Just a small trick for openstreetmap embedded in your application :
http://www.purebasic.fr/english/viewtop ... nstreetmapBut you can activate the cache with SQLite.Progi1984 wrote: yes but this requires the user to be online if i'm not wrong.
Update your fonction like here : http://www.purebasic.fr/english/viewtop ... 81#p297281KGB_X wrote:I have not been able to run this example as : *LibCurl_NewMemory = AllocateMemory(MemorySize(*LibCurl_SharedMem)) always crash.
"The spesified '*MemoryID' is null"
I'll see if i can use it like this.
It's probably easy to overlay a sprite on this.
I checked the "RW_LibCurl_InitData()" and its identical but i get the same error.
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureSVG (updated 31/Jan/10)
Another new version!
There are lots of new functions, mainly for retrieving element attributes and for editing all elements together as a "group".
I've also added the ability to store PB images inside the SVG. Until recently I didn't know this was possible. The image is converted with Base64 and this data stands in place of the "src=filename" tag. It's pretty cool as it reduces file dependency. You can do it with HTML pages as well. I don't know if it will be possible with other media types - video, audio, etc. - perhaps the size of these files would make it a bit ridiculous.
And some bug fixes:
Seymour.
There are lots of new functions, mainly for retrieving element attributes and for editing all elements together as a "group".
I've also added the ability to store PB images inside the SVG. Until recently I didn't know this was possible. The image is converted with Base64 and this data stands in place of the "src=filename" tag. It's pretty cool as it reduces file dependency. You can do it with HTML pages as well. I don't know if it will be possible with other media types - video, audio, etc. - perhaps the size of these files would make it a bit ridiculous.
And some bug fixes:
- Minus coordinates are now handled correctly
- Constants added for Linux
- I think SVG_SetVisiblePortion() now works
- Bezier curves are not correctly bound-checked
- Resizing a path that contains elliptical arcs will result in distortion
Seymour.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureSVG (updated 31/Jan/10)
This is a big update with lots of new features.
New stuff:
I am very pleased to announce the debut of this procedure:
LoadSVG()
It's not yet complete and there are likely to be bugs. So far it seems to correctly load any SVG previously made with PureSVG, except for patterns and metadata.
PureSVG does not accommodate element attributes such as translate and transform. However, the idea is that you could "import" any valid SVG element string and PureSVG would interpret it correctly. So, for example, if the element has a transform instruction, the transforming is done immediately and the instruction is discarded. A string you import may contain attributes I haven't yet taken care of, and if this happens please post about it so I can fix it.
Alongside LoadSVG() are some other new commands:
Elsewhere, an important bug with element opacity has been fixed. I had wrongly concluded that Opera and Firefox ignore opacity - in fact they need it denoted as a decimal rather than a percentage (which only Chrome understands).
I've been working on PureSVG for a month now and other projects need attention, so this will take a back seat. However since both PureBasic and SVG are (hopefully) going to be around for a long time and a native SVG library is unlikely, it'd be nice if PureSVG became a comprehensive bridge between PB and SVG, supporting as much of the specification as can be made "programmable".
The remaining large omissions are filters and animation. I'll probably add filters next. At present filters are only supported by Opera and Firefox, but I think they can be implemented more quickly than animation.
New stuff:
- masks
- the textpath element
- PB's Plot() command has been replicated, for convenience
- functions for handling comments
- loading/catching (see below)
- exporting/importing commands (see below)
I am very pleased to announce the debut of this procedure:
LoadSVG()
It's not yet complete and there are likely to be bugs. So far it seems to correctly load any SVG previously made with PureSVG, except for patterns and metadata.
PureSVG does not accommodate element attributes such as translate and transform. However, the idea is that you could "import" any valid SVG element string and PureSVG would interpret it correctly. So, for example, if the element has a transform instruction, the transforming is done immediately and the instruction is discarded. A string you import may contain attributes I haven't yet taken care of, and if this happens please post about it so I can fix it.
Alongside LoadSVG() are some other new commands:
- CatchSVG()
- LoadSVGFromString()
- SVG_ElementFromString() (see note about element attributes, above)
- SVG_GradientFromString()
- SVG_PathDataFromString()
- SVG_PolylineDataFromString()
- SVG_StyleFromString()
Elsewhere, an important bug with element opacity has been fixed. I had wrongly concluded that Opera and Firefox ignore opacity - in fact they need it denoted as a decimal rather than a percentage (which only Chrome understands).
I've been working on PureSVG for a month now and other projects need attention, so this will take a back seat. However since both PureBasic and SVG are (hopefully) going to be around for a long time and a native SVG library is unlikely, it'd be nice if PureSVG became a comprehensive bridge between PB and SVG, supporting as much of the specification as can be made "programmable".
The remaining large omissions are filters and animation. I'll probably add filters next. At present filters are only supported by Opera and Firefox, but I think they can be implemented more quickly than animation.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureSVG - now with LoadSVG() !
nice. i don't have time to test it this weekend but i get back when i have...
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: PureSVG - now with LoadSVG() !
This looks very promising, although the download link seems to be down. The is not available on that location,
does anyone here have a valid link for me or perhaps the include to attach?
I have always liked SVG, and have not found much support for PureBasic for it, so I'm thrilled now I do :p
Anyhow, Thanks for sharing Seymour!
does anyone here have a valid link for me or perhaps the include to attach?
I have always liked SVG, and have not found much support for PureBasic for it, so I'm thrilled now I do :p
Anyhow, Thanks for sharing Seymour!
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureSVG - now with LoadSVG() !
A new, more reliable version is now being kindly hosted by Idle. The link is in the OP.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureSVG - now with LoadSVG() !
Sorry, I didn't test it yet but people of the german forum say that the source isn't possible to use because of missing functions and stuff. Any ideas or comments?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PureSVG - now with LoadSVG() !
Please check the version on Idle's site, which is the latest version.
If it asks for a procedure called "R", this is it:
It's just a shortcut for reporting a message.
If anything else is missing, please let me know and I'll upload a new version.
If it asks for a procedure called "R", this is it:
Code: Select all
Macro R(t)
MessageRequester("Report",t,0)
EndMacro
If anything else is missing, please let me know and I'll upload a new version.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: PureSVG - now with LoadSVG() !
Hi
its not only procedure "R"
the version is "v6a"
Thanks
Torsten
its not only procedure "R"
orStructure not found:PointF
Structure not found:RectF
the version is "v6a"
Thanks
Torsten