lights FAQ Forum github.com/luapower/svg_parser
svg_parser

Unsupported
syscall
bnet
lfs
lanes
mmap WIP
stdio WIP
vararg
nanojpeg
blur WIP
openvg WIP
hpdf
svg_parser WIP
ffi_reflect
struct
pmurhash
murmurhash3
md4
crc32
oo
ringbuffer
dlist
obj_parser
glut
fbclient WIP
portaudio
libssh2 WIP
minizip
terra
llvm
utf8 WIP
ucdn
libunibreak
harfbuzz
fribidi
chipmunk
libvlc WIP
libvorbis WIP
libpng WIP

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: 2 years 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