Note: all following instructions are designed for linux system, if you are using other systems, please only use them as an reference, as the process might be simular
Make sure you have
sfml(gui support),tinyxml2(raw info extract) and a proper c++ compiler installed.To build, run
bash make.bashin terminal in the root of the project folder.Note: designed for gcc compiler only, please write your own if you are using otherwise
Expect an executable be produced in the root of project folder named
svgviewerTo use, run
./svgviewer <path/to/your/file.svg>, then expect an gui.example screen shot:
./svgviewer ./svgs/flower.svg
Gui explaination:Right: graphic extracted from svg.
Left: point graph produced through function:
sl::pointgraph sl::simplify(pointgraph old,double minLen,double maxLen,double minAngle)
Make sure you have
tinyxml2installed, used for extract raw info from svg file, which is also part of xml family.Add
svglib.hppandsvglib.cpptogether to the folder you want (make sure they are in the same folder)Add
#inlcude <path/to/svglib.hpp>to your program file where you are going to implement itor just
#inlcude "svglib.hpp"if they are in the same folder with your program fileAs you can see in
svglib.hpp, all utility functions are stored in namespacesl, import the namespace and start coding XD!
svglib.hpp/svglib.cppIncluds all svg utilities provided, tested, and useable.main.cpp/view.hpp/view.cpp: A simple sfml program for displaying utilty results for testing purposes.svgtran.hpp/svgtran.cpp: Utilities for svg's transform attribute. Note: not implemented
A list of simple svg file collected that this library supports and can work with for testing purposes.
make.bash: Viewer program building command script for bash.To use, run
bash make.bashin terminal in the root of the project folder.svgviewer: Linux executable for viewer program.To use, run
./svgviewer <path/to/your/file.svg>, then expect an gui.LICENCE.txt: GPL Licence
As explained, all Transform attribute are unfortunaly not implemented.
In simple terms: I tried, and I failed...
For anyone who is willing to suggest/edit/improve on source code, I am more than wellcome
This project is GPL licenced.