Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/memononen/nanosvg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Mononen <memon@inside.org>2013-10-05 19:03:07 +0400
committerMikko Mononen <memon@inside.org>2013-10-05 19:03:07 +0400
commite4f10ab851b1deee7b7f76e87dae51f722d19c99 (patch)
tree981ed226fc1be7a18c282dc46dd3f7d7cc9710bb /README.md
Initial commit.
Diffstat (limited to 'README.md')
-rw-r--r--README.md71
1 files changed, 71 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..16e305e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,71 @@
+Nano SVG
+==========
+
+![screenshot of some text rendered witht the sample program](/example/screenshot.png?raw=true)
+
+NanoSVG is a simple stupid single-header-file SVG parse. The output of the parser is a list of cubic bezier shapes.
+
+The library suits well for anything from rendering scalable icons in your editor application to prototyping a game.
+
+NanoSVG supports a wide range of SVG features, if somehing is missing, feel free to create a pull request!
+
+
+## Example Usage
+
+``` C
+// Load
+struct SNVGPath* plist;
+plist = nsvgParseFromFile("test.svg.");
+
+// Use
+for (NSVGPath* it = plist; it; it = it->next) {
+ for (i = 0; i < npts-1; i += 3) {
+ float* p = &pts[i*2];
+ drawCubicBez(p[0],p[1], p[2],p[3], p[4],p[5], p[6],p[7]);
+ }
+}
+
+// Delete
+nsvgDelete(plist);
+```
+
+## Using NanoSVG in your project
+
+In order to use NanoSVG in your own project, just copy nanosvg.h to your project.
+In one C/C++ define `NANOSVG_IMPLEMENTATION` before including the library to expand the NanoSVG implementation in that file.
+
+``` C
+#define NANOSVG_IMPLEMENTATION // Expands implementation
+#include "nanosvg.h"
+```
+
+By default, NanoSVG parses only the most common colors. In order to get support for full list of [SVG color keywords](http://www.w3.org/TR/SVG11/types.html#ColorKeywords), define `NANOSVG_ALL_COLOR_KEYWORDS` before expanding the implementation.
+
+``` C
+#define NANOSVG_ALL_COLOR_KEYWORDS // Include full list of color keywords.
+#define NANOSVG_IMPLEMENTATION // Expands implementation
+#include "nanosvg.h"
+```
+
+## Compiling Example Project
+
+In order to compile the demo project, your will need to install [GLFW](http://www.glfw.org/) to compile.
+
+NanoSVG demo project uses [premake4](http://industriousone.com/premake) to build platform specific projects, now is good time to install it if you don't have it already. To build the example, navigate into the root folder in your favorite terminal, then:
+
+- *OS X*: `premake4 xcode4`
+- *Windows*: `premake4 vs2010`
+- *Linux*: `premake4 gmake`
+
+See premake4 documentation for full list of supported build file types. The projects will be created in `build` folder. An example of building and running the example on OS X:
+
+```bash
+$ premake4 gmake
+$ cd build/
+$ make
+$ ./example
+```
+
+# License
+
+The library is licensed under [zlib license](LICENSE.txt) \ No newline at end of file