0.02
No commit activity in last 3 years
No release in over 3 years
Adds additional vector shapes to Prawn
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Shapes library for Prawn

Available thus far:

  • star
  • half_star
  • arc
  • pie_slice
  • half_circle
  • quarter_circle

Usage

Install the prawn_shapes gem, then:

require 'prawn_shapes'

And:

pdf.star([x, y], :radius => r)

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

arcs and pies

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

2014-07-21 - updated for Prawn 1.1

2014-09-22 - updated for Prawn 1.2