Skip to content

Commit

Permalink
Lined-paper script for generating grids for the Graded Chinese Reader 1
Browse files Browse the repository at this point in the history
  • Loading branch information
batterseapower committed Feb 20, 2010
1 parent 911adb8 commit c719b76
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lined-paper
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'prawn'
require 'prawn/measurement_extensions'

if ARGV.size < 1
puts "Usage: #{$0} output-file"
exit 1
end

Prawn::Document.generate(ARGV[0],
:page_layout => :portrait,
:left_margin => 1.5.cm,
:right_margin => 1.5.cm,
:top_margin => 1.5.cm,
:bottom_margin => 1.5.cm,
:page_size => 'A5') do
for i in (1..(bounds.height / 5.15.mm) + 1)
next if i % 2 == 0

stroke do
rectangle [bounds.left, i*5.15.mm], bounds.width, 5.15.mm
end
end
end

0 comments on commit c719b76

Please sign in to comment.