Files in this directory are test programs to render svg files using the MGRX
graphics library (http://mgrx.fgrim.com) and libmsvg of course.

They are not part of libmsvg really, some day they will be added to MGRX, but
you can use it as an example of how render svg files using libmsvg and a specific
graphics library.

To make the example programs you need both libmsvg and MGRX installed first.
MGRX version >= 1.35 is needed, because we need gradients, better use MGRX >= 1.43
to have multipolygons so we be able to fill paths with multiple subpaths at once.
Opacity is not taken into account by now.

Them do that:

Linux X11:
gcc -D__XWIN__ -c rendmgrx.c
gcc -D__XWIN__ -c pathmgrx.c
gcc -D__XWIN__ -o rsvg rsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrxX -lX11 -lm
gcc -D__XWIN__ -o gsvg gsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrxX -lX11 -lm
gcc -D__XWIN__ -o showsvg showsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrxX -lX11 -lm
gcc -D__XWIN__ -o svg2png svg2png.c rendmgrx.o pathmgrx.o -lmsvg -lmgrxX -lX11 -lm -lpng -lz

Linux console:
gcc -c rendmgrx.c
gcc -c pathmgrx.c
gcc -o rsvg rsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm
gcc -o gsvg gsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm
gcc -o showsvg showsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm
gcc -o svg2png svg2png.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm -lpng -lz

DOS (djgpp):
gcc -c rendmgrx.c
gcc -c pathmgrx.c
gcc -o rsvg.exe rsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm
gcc -o gsvg.exe gsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm
gcc -o showsvg.exe showsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm
gcc -o svg2png.exe svg2png.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm -lpng -lz

Win32 (mingw):
gcc -c rendmgrx.c
gcc -c pathmgrx.c
gcc -o rsvg.exe rsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm -mwindows
gcc -o gsvg.exe gsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm -mwindows
gcc -o showsvg.exe showsvg.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm -mwindows
gcc -o svg2png.exe svg2png.c rendmgrx.o pathmgrx.o -lmsvg -lmgrx -lm -lpng -lz -mconsole

There is a simple makefile for the X11 version, run it by:
    make -f makefile.x11

rsvg -> read test.svg and render it on screen.
gsvg -> generates a MsvgElemnt tree programmatically and render it on screen.
showsvg -> is a more elaborated svg visor that can zoomm and rotate,
           run it by: showsvg filename.svg [width height bpp]
           for example: showsvg ../svgpics/gtiger.svg
svg2png -> generates a png file from a svg one
           run it with: svg2png [-f|p|s] [-l|c|r] [-gd width height] [-z zoom]
                                [-rt angle] [-dp xdespl ydespl] file.svg file.png
           file.svg will be rendered to file.png
           options:
                -f|p|s => FIT, PAR(default) or SCOORD
                -l|c|r => LEFT(default), CENTER or RIGHT
                -gd width height => use the given dimensions for the output file,
                                    by default it uses the svg file dimensions
                -z zoom => apply a zoom before rendering
                -rt angle => apply a rotation before rendering
                -dp xdespl y despl => apply a displacement begore rendering
           example: ./svg2png ../svgpics/gtiger.svg gtiger.png

License
-------
rendmgrx.c, rendmgrx.h, pathmgrx.c and pathmgrx.h will be someday part of
the MGRX library, and are under the LGPL license, see copying.txt

rsvg.c, gsvg.c, showsvg.c and svg2png.c are libmsvg+MGRX tests programs, they
are in the public domain.
