Created
August 30, 2020 21:45
-
-
Save jbosboom/d25571290789b68065dbb480fec654eb to your computer and use it in GitHub Desktop.
Generates landscape ruled paper
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
#!/usr/bin/env python2 | |
margin = 0.375 | |
lineheight = (8.5 - 2*margin)/25 | |
linewidth = 11 - 2*margin | |
midgutter = 11.0/2 | |
ypts = [(margin, midgutter-(margin/2)), (midgutter+(margin/2), 11.0 - margin)] | |
color = '#A4DDED' | |
thickness = 1.0/64 | |
print '<svg width="11in" height="8.5in" xmlns="http://www.w3.org/2000/svg">' | |
for line in xrange(0, 26): | |
x = margin + line*lineheight | |
for (ystart, yend) in ypts: | |
print '<line x1="{1}in" x2="{2}in" y1="{0}in" y2="{0}in" stroke-width="{3}in" stroke="{4}" stroke-opacity="0.5"/>'.format(x, ystart, yend, thickness, color) | |
print '</svg>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment