Class | Prawn::Svg::Parser |
In: |
lib/prawn/svg/parser.rb
|
Parent: | Object |
Prawn::Svg::Parser is responsible for parsing an SVG file and converting it into a tree of prawn-compatible method calls.
You probably do not want to use this class directly. Instead, use Prawn::Svg to draw SVG data to your Prawn::Document object.
This class is not passed the prawn object, so knows nothing about prawn specifically - this might be useful if you want to take this code and use it to convert SVG to another format.
CONTAINER_TAGS | = | %w(g svg symbol defs) |
REQUIRED_ATTRIBUTES | = | { "line" => %w(x1 y1 x2 y2), "polyline" => %w(points), "polygon" => %w(points), "circle" => %w(r), "ellipse" => %w(rx ry), "rect" => %w(width height), "path" => %w(d) |
Construct a Parser object.
The data argument is SVG data.
bounds is a tuple [width, height] that specifies the bounds of the drawing space in points.
options can optionally contain the key :width or :height. If both are specified, only :width will be used.