r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[SVG Renderer] SVG rendering in Draw AGG

shadwolf
26-Jun-2005
[37x6]
I read most of the documentation but then make the link to AGG data 
structure is rather difficult
linearGradient for example are splitted the first one contain the 
coordonates systeme and tranfromation informations  the second one 
countains the colors involved and their order in the gradient
so you avac primitive(fill:url) ->LinearGRadient (coords) -> LinearGradient 
(colors order)
where do I plug the to-unit function ?
in svg-size
??
Ashley
26-Jun-2005
[43]
Yes, to-unit is called from svg-size; and also from "path d", stroke-width, 
fill-width, etc ... probably anywhere in SVG where we "expect" an 
integer or decimal! ;)
shadwolf
29-Jun-2005
[44]
okay good stuf in it Vincent and I are planning to use the xml-to-object.r 
script from Brian Wisti to enbetter and make a more sophisticate 
support for our actual work upon SVG parsing translation and rendering 
into a VID  window
BrianW
29-Jun-2005
[45]
shadwolf, I'm not the author - just a guy who made it available in 
the Rebol library :-)
shadwolf
29-Jun-2005
[46x3]
it says author hahah ;)
opkay so we are planning on the opportinity to use a REBOL tree object! 
structure to represente SVG datas :)
this in the goal to improve drastically the performance and be more 
performant  on some key issues like recursivity etc...
shadwolf
30-Jun-2005
[49x16]
I make a base code but now I have to find a good code to exploit 
the relevent datas from the object tree
this means to interogate the content of the objet a gived level
then construc path to get data then translate this data to a draw 
equivalent exploitable datas
and fill the draw block with this data
my point is to make a recursif capapble code
for example my object is set into xml global variable
I I want to interrogate the first shape description on the top level 
( out of group blocks) I have to build a path like that xml/svg/path/1/d
or maybe build the path xml/svg/path then attribute to a temporary 
var the foreach ob  xml/svg/path [ ob processing ]
so to build the path we start xml/svg "/ " g or path  if g we seek 
3 thing transform field and path field or sub g field
I give you the code maybe this will be more clear
shadwolf.free.fr/svg-demo-shad04.r
oups sorry
wrong adress
http://shadwolf.free.fr/svg-demo-shad03.r
in this file we have xml-to-object function load-svg function (mostly 
empty there is where to put the data conversion and draw block construction) 
and the widget that start the program
and the windows where the draw block is shown
shadwolf
1-Jul-2005
[65x2]
I solve this issue regarding object retriving information I will 
enhance this pont to make it recursif retriever
at this point code have not drastically change ... like 40% is the 
same code
shadwolf
2-Jul-2005
[67x13]
***************
I'm still working full time on the S VG renderer. I'm close to be 
at the same level than the previous code but as I'm working with 
objects the code seems to be more fast ...
the recursivity treatement for g block are also easier to do
I still not soleve my matrix problems so until now I don't implement 
it into  the actual code
I don't know how to treat linearGradient too
hum xpdf.svg file shows me a problem with the use of xml-to-object 
 ... if you have serveral g block at the same level all g block are 
compacted into the same reference
so in Rebol tree object the g block can be a bloc of sub object or 
an object  ;)
***********
Okay so here is the first version of my work on SVG to rebol objects 
tree structure
http://shadwolf.free.fr/svg-demo-shad04.r
try to load all the files that Ashley provides with his svg-demo
this script support recursive G block (objects /list) and path (object 
list)
what is not supported are radial / linear Gradient (content and border), 
transformations (local/global I'm still pending for informations 
on it) and all other shapes than path  (like rect  for example)
Ashley
2-Jul-2005
[80x2]
Good progress! If you change:

	"stroke-width" [line-width: to decimal! val]

to

	"stroke-width" [line-width: to-unit val]


then it'll run all your sample SVG icon files as well. Wish I knew 
the answers to your AGG questions, but like you I'm waiting on more 
documentation / examples.
I've spent quite a bit of time looking at Inkscape (http://www.inkscape.org/) 
and it seems to be the only / best SVG game in town (their command-line 
driven SVG to PNG conversion seems to be particularly well regarded). 
Looking forward to their 0.42 release as it supports OS/X as well.


The Clip Art site that they link to (http://www.openclipart.org/) 
is also a treasure trove of Public Domain files (which solves the 
GPL concerns I had with many of the dedicated KDE / Gnome icon sets). 
I'm also looking forward to their release 15 which seems to be just 
around the corner.


Lots of good news in the SVG world, I wonder how long before mainstream 
browsers start supporting it? (without plugins).
shadwolf
2-Jul-2005
[82x5]
Inkscape is the successor project of sodipodi (for example you can 
see reference to sodipodi into teh SVG output files ...) Sodipodi 
was abandonned by the dev team so some of them retakes it and continue 
the adventure with inkscape
All this to say that it doesn't fall from the sky  ;)
I like particularly the capability of generating light weight SVG 
files (plein text) the drawing tools are simple powerfull very well 
thinked and pretty good
I psent lot of time using it (more than 80 hours since this last 
weeks ) all SVG files that I could found exists
I like the XML  primitive draw explorer like a tree view of the compoun 
of your draw this is particularly good to write SVG renderer