[ANN] Ruby Vector Graphics 0.3.0

T

Tim Hunter

RVG is a library for drawing 2D graphics with an API based on the SVG
specification. RVG is a pure-Ruby add-on to RMagick, the binding for
ImageMagick and GraphicsMagick. Version 0.3.0 is available, as usual, at
RubyForge: http://rubyforge.org/projects/rvg/

Version 0.3.0 adds support for patterns. A pattern is a collection of
shapes, text, or raster images that can be used as a stroke or fill.

RVG supports the following SVG concepts:

o Structure: RVG, groups, defs, and use
o User-coordinate systems
o Coordinate system transformations (translate, rotate, etc.)
o Raster images
o Basic shapes: line, rectangle, circle, ellipse, polygon, polyline
o Styles: fill, stroke, opacity, font_size, etc.
o Paths
o Text
o Patterns
o Clipping paths
o Units conversions (cm, in, etc.)

RVG would be a good library to use if you're writing an application that
needs to programmatically generate drawings, such as a charting
application. You can see an example RVG program at
http://rvg.rubyforge.org. The tarball includes copious RDoc documentation
and examples.

RVG supports all the parts of SVG that ImageMagick/GraphicsMagick supports.
I've spent the last week or so converting and running 40+ tests from the
W3C SVG 1.1 Test Suite (http://www.w3.org/Graphics/SVG/Test/) to Ruby+RVG.
At this point I'm satisfied that RVG reasonably bug-free and complete.
Therefore this will be the last "alpha" release.

I'm going to hold back on integrating RVG into the RMagick library just yet.
I want to rewrite the RDoc to match RMagick's documentation, and that'll be
a big job. So there's still plenty of time for changes based on your
feedback before RVG "goes production" so please don't hesitate to give it a
try and let me know what you think!

Tim
 
L

Luke Galea

Hi Tim,

Do you know of any libraries for ruby to render SVG to a raster file (for
those who are SVG impaired ?? )

Thanks in advance
 
T

Tim Hunter

Luke said:
Hi Tim,

Do you know of any libraries for ruby to render SVG to a raster file (for
those who are SVG impaired ?? )

You can use RMagick (http://rmagick.rubyforge.org) to convert _some_ SVG
files to any raster format that ImageMagick supports. I say _some_ because
ImageMagick (upon which RMagick is based) supports only a subset of SVG.
For example, it doesn't support filters and gradients. If you have
questions about specific SVG elements let me know and I'll try to answer
them.

I'm told that ImageMagick's support for SVG is scheduled for major upgrades
very soon, though. RMagick and RVG will of course be updated to support all
the improvements as soon as they appear.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top