lights FAQ Forum   github.com/luapower/svg_parser
svg_parser

2D Graphics
path2d
affine2d
box2d
clipper
cairo
freetype
openvg
svg_parser
hpdf

svg_parser

SVG parser


local svg_parser = require'svg_parser'

A SVG 1.1 parser implemented in Lua.

Unlike other parsers, this one generates a cairo sceen graph object instead of directly rendering the SVG file on a canvas, which allows for manipulation of the graphics objects.

Included in the package is a handy collection of SVG files to test the parser with.

Some notable features are not yet implemented:

  • patterns
  • radial gradient has issues
  • text
  • markers
  • constrained transforms: ref(svg,[x,y])
  • external references
  • use tag

Low-priority missing features:

  • icc colors
  • css language

svg_parser.parse(source) -> object

Parses a SVG into a cairo scene graph object that can be rendered with sg_cairo.

  • source is an expat source.

Last updated: 18 months ago | Edit on GitHub

Pkg type:Lua+ffi
Version: dev-13-g61c70f1
Last commit:
License: PD
Requires: expat  glue  lpeg  luajit 
Required by: none

Top