Page 2 of 5
Re: PureSVG (updated 27/Jan/10)
Posted: Fri Jan 29, 2010 9:54 am
by KGB_X
#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.
Re: PureSVG (updated 27/Jan/10)
Posted: Fri Jan 29, 2010 10:39 am
by Progi1984
Just a small trick for openstreetmap embedded in your application :
http://www.purebasic.fr/english/viewtop ... nstreetmap
Re: PureSVG (updated 27/Jan/10)
Posted: Fri Jan 29, 2010 11:33 am
by Seymour Clufley
KGB_X wrote:#Black and #White is not assigned with an value.
Sorry, I thought those constants came with PB.
Using the pie chart demo it's terrible slow.
How long does it take, roughly? I'm concentrating on stability just now, but speed is obviously important and will be worked on later.
I want to read SVG stored from openstreetmap
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.
Re: PureSVG (updated 27/Jan/10)
Posted: Fri Jan 29, 2010 11:55 am
by KGB_X
Seymour Clufley wrote:KGB_X wrote:#Black and #White is not assigned with an value.
Sorry, I thought those constants came with PB.
I used the Linux version. Anyhow not a big issue.
Seymour Clufley wrote:
Using the pie chart demo it's terrible slow.
How long does it take, roughly? I'm concentrating on stability just now, but speed is obviously important and will be worked on later.
It's a very nice start so i don't complain.
Seymour Clufley wrote:
I want to read SVG stored from openstreetmap
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.
[/quote]
I can probably add this and even if your code doesn't support everything it's a start.
Re: PureSVG (updated 27/Jan/10)
Posted: Fri Jan 29, 2010 12:06 pm
by KGB_X
yes but this requires the user to be online if i'm not wrong.
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)
Posted: Fri Jan 29, 2010 12:38 pm
by Progi1984
KGB_X wrote:
yes but this requires the user to be online if i'm not wrong.
But you can activate the cache with SQLite.
KGB_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"
Update your fonction like here :
http://www.purebasic.fr/english/viewtop ... 81#p297281
Re: PureSVG (updated 27/Jan/10)
Posted: Fri Jan 29, 2010 2:57 pm
by KGB_X
Progi1984 wrote:
Progi1984 wrote:
yes but this requires the user to be online if i'm not wrong.
But you can activate the cache with SQLite.
KGB_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"
Update your fonction like here :
http://www.purebasic.fr/english/viewtop ... 81#p297281
Ok then the user has to "visit" that area to use this cache. I was thinking of downloading different areas in advance.
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.
Re: PureSVG (updated 31/Jan/10)
Posted: Sun Jan 31, 2010 11:38 pm
by Seymour Clufley
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:
- Minus coordinates are now handled correctly
- Constants added for Linux
- I think SVG_SetVisiblePortion() now works
Some remaining bugs:
- Bezier curves are not correctly bound-checked
- Resizing a path that contains elliptical arcs will result in distortion
Incidentally, I'm surprised no-one has commented on the SVGGadget code by PeterB. It works very well!
Seymour.
Re: PureSVG (updated 31/Jan/10)
Posted: Fri Feb 05, 2010 8:21 pm
by Seymour Clufley
This is a big update with lots of new features.
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()
In the course of writing LoadSVG() I wrote some sub-routines which can be used independently for "importing" SVG components. This enables you to assemble an SVG from different sources. The commands are:
- SVG_ElementFromString() (see note about element attributes, above)
- SVG_GradientFromString()
- SVG_PathDataFromString()
- SVG_PolylineDataFromString()
- SVG_StyleFromString()
Exporting can be done with "mirror" commands of the above, such as SVG_ElementToString().
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.
Re: PureSVG - now with LoadSVG() !
Posted: Sat Feb 06, 2010 6:50 am
by KGB_X
nice. i don't have time to test it this weekend but i get back when i have...
Re: PureSVG - now with LoadSVG() !
Posted: Mon Mar 29, 2010 8:45 am
by Crusiatus Black
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!
Re: PureSVG - now with LoadSVG() !
Posted: Thu Apr 01, 2010 8:39 pm
by Seymour Clufley
A new, more reliable version is now being kindly hosted by Idle. The link is in the OP.
Re: PureSVG - now with LoadSVG() !
Posted: Sat Jun 05, 2010 1:22 am
by c4s
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?
Re: PureSVG - now with LoadSVG() !
Posted: Sat Jun 05, 2010 1:31 am
by Seymour Clufley
Please check the version on Idle's site, which is the latest version.
If it asks for a procedure called "R", this is it:
Code: Select all
Macro R(t)
MessageRequester("Report",t,0)
EndMacro
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.
Re: PureSVG - now with LoadSVG() !
Posted: Sat Jun 05, 2010 1:53 am
by tmjuk
Hi
its not only procedure "R"
Structure not found:PointF
or
Structure not found:RectF
the version is "v6a"
Thanks
Torsten