Skip to content

Zero dependency JavaScript SVG parser based on a translation of the NanoSVG C code

Notifications You must be signed in to change notification settings

deanm/nanosvgjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

nanosvgjs is a zero dependency JavaScript SVG parser based on a translation of
the NanoSVG C code.  It can be used without any browser infrastructure.

https://github.com/deanm/nanosvgjs


nanosvgjs is a partially automatic and partially manual port of NanoSVG to
JavaScript.  The original C source is:

https://github.com/memononen/nanosvg

Most of the code was translated directly/automatically from the C code, so
there are comments of the original C types, etc.  This makes the code feel a
little bit foreign, but this will be gradually improved over time.

The port is pretty close to complete, but some things are unfinished, for
example handling of gradients.  Currently works for fine for tiger.svg, etc.

Extensions / changes from NanoSVG:
  - Basic class attribute and class based style sheet support.
  - Replaced color parser with css-color-parser-js.

See source code for more copyright and information.


(c) Dean McNamee <dean@gmail.com>, 2016.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

About

Zero dependency JavaScript SVG parser based on a translation of the NanoSVG C code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published