Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Sep 26, 2020
Oct 4, 2020
Oct 10, 2020
Jul 6, 2020

README.md

lunasvg

lunasvg is a standalone c++ library to create, animate, manipulate and render SVG files.

svg2png generated PNG

example

#include <lunasvg/svgdocument.h>

using namespace lunasvg;

int main()
{
    SVGDocument document;
    document.loadFromFile("tiger.svg");
    
    Bitmap bitmap = document.renderToBitmap();
    
    // do something useful with the bitmap.
    
    return 0;
}

features

  • Basic Shapes : rect, circle, ellipse, line, polyline, polygon, path.
  • Paint Servers : solidColor, linearGradient, radialGradient, pattern.
  • Clipping, Masking and Compositing : clipPath, mask, group opacity.
  • Document Structures: defs, svg, g, use, symbol.
  • Coordinate Systems, Transformations and Units.
  • Markers.
  • Texts.
  • Animations (TODO) : animate, animateColor, animateMotion, animateTransform

depends

backends

build

Create a build directory.

mkdir build

Run cmake command inside build directory.

cd build
cmake ..

# build with cairo support

cmake -DLUNASVG_ENABLE_CAIRO=ON ..

Run make to build lunasvg.

make -j 2

To install lunasvg library.

make install

demo

While building lunasvg example it generates a simple SVG to PNG converter which can be used to convert SVG file to PNG file.

Run Demo.

svg2png [filename] [resolution] [bgColor]

support

If you like the work lunasvg is doing please consider a small donation:

Buy Me A Coffee

You can’t perform that action at this time.