-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lined-paper script for generating grids for the Graded Chinese Reader 1
- Loading branch information
1 parent
911adb8
commit c719b76
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |