Shapes library for Prawn
Available thus far:
-
star
-
half_star
-
arc
-
pie_slice
-
half_circle
-
quarter_circle
Usage
require 'prawn/graphics/star'
pdf.star([x, y], :radius => r)
require 'prawn/graphics/arc'
pdf.arc_around([x, y], :radius => r, :start_angle => 30, :end_angle => 60)
pdf.pie_slice([x, y], :radius => r, :start_angle => 45, :end_angle => 135)
pdf.half_circle([x, y], :radius => r, :side => :left)
pdf.quarter_circle([x, y], :radius => r, :quadrant => 3)
The built in prawn magic works:
pdf.stroke_star([x, y], :radius => r)
pdf.fill_star([x, y], :radius => r)
pdf.fill_and_stroke_star([x, y], :radius => r)
See the examples directory for further usage examples.
Examples
stars: mindlev.wordpress.com/files/2009/12/star.pdf
arcs and pies: mindlev.wordpress.com/files/2009/12/arc1.pdf
Changelog
2009-12-15 - renamed semi_circle to half_circle because it seems more of a kind with quarter_circle
2011-02-14 - fixed syntax for Ruby 1.9. incorporated Bundler
2011-04-05 - added gemspec and published as prawn_shapes. requires Prawn 0.11.1