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
30-Jun-2005
[57x8]
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
[82x7]
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
Handling SVG as REBOL object! tree makes it really really easier 
to set recursivity and code writing ( as all can be exploded into 
small fonctions I hope the resulting code once terminated won't be 
so deficult to read
but you know now my way to work I prefer easy and powerfull /flexible 
code than hudge monolitic code ;)
Ashley
2-Jul-2005
[89]
No argument here. ;)
shadwolf
2-Jul-2005
[90x4]
http://shadwolf.free.fr/svg-demo-shad04.r
now supports rect tag ;)
oups I make it only for groups ;)
hahaha ;)
Graham
2-Jul-2005
[94]
Firefox is supposed to be able to support SVG ( a subset at least 
) without plugins, but I couldn't get it to work.  I had to download 
Adobe's plugin.
shadwolf
2-Jul-2005
[95x3]
so we can see in my code 2 approch for retrieving information one 
for top level second for g tags (groups can be recursiv)
GRaham same for me adobe plugin works well with IE but not with firefox
maybe they saw a boggus open door in this plugin and disable it's 
support (this can be the case for a 1.0.4)
Graham
2-Jul-2005
[98]
I got the Adobe plugin to work with firefox eventually.
shadwolf
2-Jul-2005
[99x8]
so you have to remaining choice (3 in fact ) 1) using IE  but then 
your not my pal any more, 2) installing Inkscape and relate it to 
svg file 3) help me finishing the SVG viewer using REBOL !!! ;))
but what I need are high level information and formation on draw 
agg and this I know very little people that can respond in this point 
 :)
this could be a good promotion point to insert SVG rendering into 
the rebplug for firefox once it's completed and optimised ;)
my actual code is about  587 lines of code and it's not ended
still lot of work on it gradients  and transform handling can be 
very code consummer
I need to handle others drawing primitivs too
corrected  ;)
I improve some more the rendering now the file gnome-keyboard-dev.svg 
is fully and perfectly rendererd. I put a red pen-fill color for 
identify all primitives that needs fill:url related gradient