diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2017-06-22 09:37:19 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2017-06-22 09:37:19 +0200 |
commit | d53fb5574b34c011e9bc994c4e044a45e065b44f (patch) | |
tree | 6db60443b295187d2d64a1148571aab2130b1ad9 |
Import existing postscript files
-rw-r--r-- | src/graph-paper.ps | 195 | ||||
-rw-r--r-- | src/hex-paper.ps | 190 | ||||
-rw-r--r-- | src/iso-paper.ps | 209 | ||||
-rw-r--r-- | src/music-paper.ps | 164 | ||||
-rw-r--r-- | src/pointed-paper.ps | 190 |
5 files changed, 948 insertions, 0 deletions
diff --git a/src/graph-paper.ps b/src/graph-paper.ps new file mode 100644 index 0000000..c32b9c6 --- /dev/null +++ b/src/graph-paper.ps @@ -0,0 +1,195 @@ +%!PS-Adobe-1.0 +%%Title: graph-paper - part of rpgTools by Elena of Valhalla +%%Pages:1 +%%BoundingBox: 0 0 596 842 +%%DocumentPaperSizes: a4 +%%CreationDate: 2004/10/19 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%EndComments +%%BeginProlog +% Copyright (C) 2004 Elena Grandi +% All rights reserved. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% * Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% * Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% * Neither the name of the <organization> nor the +% names of its contributors may be used to endorse or promote products +% derived from this software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +% ------ Usage ---------------------------------------------------------------- + +% To use this file either send it to a postscript printer, or use your +% favourite postscript interpreter to visualize and print it. + +% You can customize the result by changing the values in the Settings +% section below (see the comments for details) + +% ------ sizes ---------------------------------------------------------------- +% This will allow you to give measurements in inches or millimiters +% do not change +/inch {72 mul} def +/mm {0.03937 inch mul} def + +% ------ Settings ------------------------------------------------------------- + +% ------ Basic settings + +/SquaXLen 4 mm def % hor spacing between lines +/SquaYLen 4 mm def % ver spacing between lines + +/SquaXStr 5 def % hor number of thin lines between strong ones +/SquaYStr 5 def % ver number of thin lines between strong ones + +% line width and color for thin lines +/LineSizeThin 0.5 def +/LineColoThin { 0.8 0.8 0.8 } def +% line width and color for strong lines +/LineSizeStro 0.5 def +/LineColoStro { 0.6 0.6 0.6 } def +% line width and color for border +/LineSizeBord 0.5 def +/LineColoBord { 0.6 0.6 0.6 } def + +/BackColo { 1.0 1.0 1.0 } def % background color + +% page size: if you change this, you should change the BoundingBox +% in line 4 accordingly (you CAN'T use mm or inch over there) +% Default is A4 paper ( BoundingBox: 0 0 596 842 ) +/PageWidth 210 mm def +/PageHeight 297 mm def +% alternate page sizes (with BoundingBox values) may be +% A3 paper ( BoundingBox: 0 0 842 1192) +%/PageWidth 297 mm def +%/PageHeight 420 mm def +% Letter paper ( BoundingBox: 0 0 612 792) +%/PageWidth 8.5 inch def +%/PageHeight 11 inch def + +% white margins +/BorderTop 10 mm def +/BorderBottom 10 mm def +/BorderLeft 10 mm def +/BorderRight 10 mm def + +% ------ Advanced settings + +% translation of the starting point of the pattern +/PattTrasX 00 mm def +/PattTrasY 02 mm def + +% ------ Behaviour + +% Whether to print a line around the margins (1) or not (0) +/WillPrintBorder 1 def + +% From here on you shouldn't worry about changing or configuring anything +% ------ Variables ------------------------------------------------------------ + +% number of vert and hor lines +/SquaXNum PageWidth BorderLeft sub BorderRight sub SquaXLen div def +/SquaYNum PageHeight BorderTop sub BorderBottom sub SquaYLen div def + +% starting vert and hor line num +/SquaXSta PattTrasX SquaXLen div cvi neg def +/SquaYSta PattTrasY SquaYLen div cvi neg def + +% ending vert and hor line num +/SquaXEnd SquaXNum SquaXSta add def +/SquaYEnd SquaYNum SquaYSta add def + +% ------ Procedures ----------------------------------------------------------- + +% Describes the printable area (does NOT print anything) +/UsedArea { + newpath + BorderLeft BorderBottom moveto + BorderLeft PageHeight BorderTop sub lineto + PageWidth BorderRight sub PageHeight BorderTop sub lineto + PageWidth BorderRight sub BorderBottom lineto + closepath +} def + +%%EndProlog +%%Page: 1 + +% set printing area +UsedArea clip + +% print background +BackColo setrgbcolor +UsedArea fill + +% print hor thin line pattern +newpath + SquaXSta 1 SquaXEnd { %for + SquaXLen mul BorderLeft add PattTrasX add BorderBottom moveto + 0 PageHeight BorderTop sub BorderBottom sub rlineto + } for + LineSizeThin setlinewidth + LineColoThin setrgbcolor +stroke + +% print hor strong line pattern +newpath + SquaXSta 1 SquaXEnd { %for + dup + SquaXStr mod 0 eq { %if + SquaXLen mul BorderLeft add PattTrasX add BorderBottom moveto + 0 PageHeight BorderTop sub BorderBottom sub rlineto + } if + } for + LineSizeStro setlinewidth + LineColoStro setrgbcolor +stroke + +% print vert thin line pattern +newpath + SquaYSta 1 SquaYEnd { %for + SquaYLen mul BorderBottom add PattTrasY add BorderLeft exch moveto + PageWidth BorderLeft sub BorderRight sub 0 rlineto + } for + LineSizeThin setlinewidth + LineColoThin setrgbcolor +stroke + +% print vert strong line pattern +newpath + SquaYSta 1 SquaYEnd { %for + dup + SquaYStr mod 0 eq { %if + SquaYLen mul BorderBottom add PattTrasY add BorderLeft exch moveto + PageWidth BorderLeft sub BorderRight sub 0 rlineto + } if + } for + LineSizeStro setlinewidth + LineColoStro setrgbcolor +stroke + + +% print border (if WillPrintBorder is not 0 ) +WillPrintBorder 0 ne { + LineSizeBord setlinewidth + LineColoBord setrgbcolor + UsedArea stroke +} if + +showpage +%%Trailer diff --git a/src/hex-paper.ps b/src/hex-paper.ps new file mode 100644 index 0000000..4a117cc --- /dev/null +++ b/src/hex-paper.ps @@ -0,0 +1,190 @@ +%!PS-Adobe-1.0 +%%Title: hex-paper - part of rpgTools by Elena of Valhalla +%%Pages:1 +%%BoundingBox: 0 0 596 842 +%%DocumentPaperSizes: a4 +%%CreationDate: 2004/10/04 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%EndComments +%%BeginProlog +% Copyright (C) 2004 Elena Grandi +% All rights reserved. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% * Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% * Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% * Neither the name of the <organization> nor the +% names of its contributors may be used to endorse or promote products +% derived from this software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +% ------ Usage ---------------------------------------------------------------- + +% To use this file either send it to a postscript printer, or use your +% favourite postscript interpreter to visualize and print it. + +% You can customize the result by changing the values in the Settings +% section below (see the comments for details) + +% ------ sizes ---------------------------------------------------------------- +% This will allow you to give measurements in inches or millimiters +% do not change +/inch {72 mul} def +/mm {0.03937 inch mul} def + +% ------ Settings ------------------------------------------------------------- + +% ------ Basic settings + +/HexSide 24 mm def % lenght of hexagon side (or "radius") + +/LineSize 0.5 def % lines width +/LineColo { 0.5 0.5 0.5 } def % rgb triplet of line color +/FillColo { 1.0 1.0 1.0 } def % rgb triplet of hexagon color +/BackColo { 1.0 1.0 1.0 } def % rgb triplet of background color + +% page size: if you change this, you should change the BoundingBox +% in line 4 accordingly (you CAN'T use mm or inch over there) +% Default is A4 paper ( BoundingBox: 0 0 596 842 ) +/PageWidth 210 mm def +/PageHeight 297 mm def +% alternate page sizes (with BoundingBox values) may be +% A3 paper ( BoundingBox: 0 0 842 1192) +%/PageWidth 297 mm def +%/PageHeight 420 mm def +% Letter paper ( BoundingBox: 0 0 612 792) +%/PageWidth 8.5 inch def +%/PageHeight 11 inch def + +% white margins +/BorderTop 10 mm def +/BorderBottom 10 mm def +/BorderLeft 10 mm def +/BorderRight 10 mm def + +% ------ Advanced settings + +% spacing between consecutive hexes (hor and vert) +/HexSpaceX 0 def +/HexSpaceY 0 def +% uncomment the following line to have uniform spacing +%/HexSpaceY HexSpaceX 3 sqrt 0.5 mul mul def + +% translation of the starting point of the pattern +/PattTrasX 10 mm def +/PattTrasY 10 mm def + +% ------ Behaviour + +% Whether to print a line around the margins (1) or not (0) +/WillPrintBorder 1 def + +% From here on you shouldn't worry about changing or configuring anything +% ------ Variables ------------------------------------------------------------ + +% Spacing between hexagons +/HexSpacingX HexSide 3 sqrt mul HexSpaceX add def +/RowSpacingY HexSide 1.5 mul HexSpaceY add def +/ColSpacingX HexSide 3 sqrt 0.5 mul mul HexSpaceX 2 div add def + +% x y movements to get oblique sides +/HexSideX HexSide 3 sqrt 0.5 mul mul def +/HexSideY HexSide 2 div def + +% number of hexagons in a row and of rows in a page +/HexRowNum PageWidth HexSpacingX div 2 add def +/HexColNum PageHeight RowSpacingY div 2 add def + +% starting hexagon number in a row and row number in a page +/HexRowSta PattTrasX HexSpacingX div cvi neg 1 sub def +/HexColSta PattTrasY RowSpacingY div cvi neg 1 sub def + +% ending hexagon number in a row and row number in a page +/HexRowEnd HexRowSta HexRowNum add def +/HexColEnd HexColSta HexColNum add def + +% ------ Procedures ----------------------------------------------------------- + +% Describes the printable area (does NOT print anything) +/UsedArea { + newpath + BorderLeft BorderBottom moveto + BorderLeft PageHeight BorderTop sub lineto + PageWidth BorderRight sub PageHeight BorderTop sub lineto + PageWidth BorderRight sub BorderBottom lineto + closepath +} def + +% Prints an hexagon in the given position +% x y = cohordinates of bottom point of left side +/PrintHex { %stk: x y + newpath + moveto + 0 HexSide rlineto + HexSideX HexSideY rlineto + HexSideX HexSideY neg rlineto + 0 HexSide neg rlineto + HexSideX neg HexSideY neg rlineto + HexSideX neg HexSideY rlineto + closepath + gsave + FillColo setrgbcolor + fill + grestore + LineColo setrgbcolor + LineSize setlinewidth + stroke +} def + +% Prints a row in the given position +% x y = cohordinates of first hexagon in the row +/PrintRow { %stk: x y + /RowY exch def + /RowX exch def + HexRowSta 1 HexRowEnd { + HexSpacingX mul RowX add RowY PrintHex + } for +} def + +%%EndProlog +%%Page: 1 + +% set printing area +UsedArea clip + +% print background +BackColo setrgbcolor +UsedArea fill + +% print hex pattern +HexColSta 2 HexColEnd { + /rownum exch def + PattTrasX RowSpacingY rownum mul PattTrasY add PrintRow + PattTrasX ColSpacingX add RowSpacingY rownum mul PattTrasY add RowSpacingY add PrintRow +} for + +% print border (if WillPrintBorder is not 0 ) +WillPrintBorder 0 ne { + LineSize setlinewidth + LineColo setrgbcolor + UsedArea stroke +} if + +showpage +%%Trailer diff --git a/src/iso-paper.ps b/src/iso-paper.ps new file mode 100644 index 0000000..799e452 --- /dev/null +++ b/src/iso-paper.ps @@ -0,0 +1,209 @@ +%!PS-Adobe-1.0 +%%Title: iso-paper by Elena of Valhalla +%%Pages:1 +%%BoundingBox: 0 0 596 842 +%%DocumentPaperSizes: a4 +%%CreationDate: 2011/05/25 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%EndComments +%%BeginProlog +% Copyright (C) 2011 Elena Grandi +% All rights reserved. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% * Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% * Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% * Neither the name of the <organization> nor the +% names of its contributors may be used to endorse or promote products +% derived from this software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +% ------ Usage ---------------------------------------------------------------- + +% To use this file either send it to a postscript printer, or use your +% favourite postscript interpreter to visualize and print it. + +% You can customize the result by changing the values in the Settings +% section below (see the comments for details) + +% ------ sizes ---------------------------------------------------------------- +% This will allow you to give measurements in inches or millimiters +% do not change +/inch {72 mul} def +/mm {0.03937 inch mul} def + +% ------ Settings ------------------------------------------------------------- + +% ------ Basic settings + +/SideLen 5 mm def % spacing between lines + +/StrongStep 4 def % number of thin lines between strong ones + +% line width and color for thin lines +/LineSizeThin 0.5 def +/LineColoThin { 0.8 0.8 0.8 } def +% line width and color for strong lines +/LineSizeStro 0.5 def +/LineColoStro { 0.6 0.6 0.6 } def +% line width and color for border +/LineSizeBord 0.5 def +/LineColoBord { 0.6 0.6 0.6 } def + +/BackColo { 1.0 1.0 1.0 } def % background color + +% page size: if you change this, you should change the BoundingBox +% in line 4 accordingly (you CAN'T use mm or inch over there) +% Default is A4 paper ( BoundingBox: 0 0 596 842 ) +/PageWidth 210 mm def +/PageHeight 297 mm def +% alternate page sizes (with BoundingBox values) may be +% A3 paper ( BoundingBox: 0 0 842 1192) +%/PageWidth 297 mm def +%/PageHeight 420 mm def +% Letter paper ( BoundingBox: 0 0 612 792) +%/PageWidth 8.5 inch def +%/PageHeight 11 inch def +% landscape A4 paper ( BoundingBox: 0 0 842 596 ) - print it with +% lp -o landscape iso-paper.ps +%/PageWidth 297 mm def +%/PageHeight 210 mm def + +% white margins +/BorderTop 10 mm def +/BorderBottom 10 mm def +/BorderLeft 10 mm def +/BorderRight 10 mm def + +% ------ Advanced settings + +% translation of the starting point of the pattern +/PattTrasX 00 mm def +/PattTrasY 00 mm def + +% ------ Behaviour + +% Whether to print a line around the margins (1) or not (0) +/WillPrintBorder 1 def + +% From here on you shouldn't worry about changing or configuring anything +% ------ Variables ------------------------------------------------------------ + +/Sin 30 sin def +/Cos 30 cos def + +/AreaHeight PageHeight BorderTop sub BorderBottom sub def +/AreaWidth PageWidth BorderLeft sub BorderRight sub def +/DiaHor AreaHeight Sin mul Cos div def + +% number of diagonal lines +/DiaNum AreaWidth SideLen div AreaHeight SideLen Sin mul div 2 mul add def +/HorNum AreaHeight SideLen Sin mul div def + +% starting vert and hor line num +/DiaSta PattTrasX SideLen div cvi neg AreaHeight SideLen Sin mul div sub cvi def +/HorSta PattTrasY SideLen Sin mul div cvi neg def + +% ending vert and hor line num +/DiaEnd DiaNum DiaSta add def +/HorEnd DiaNum HorSta add def + +% ------ Procedures ----------------------------------------------------------- + +% Describes the printable area (does NOT print anything) +/UsedArea { + newpath + BorderLeft BorderBottom moveto + BorderLeft PageHeight BorderTop sub lineto + PageWidth BorderRight sub PageHeight BorderTop sub lineto + PageWidth BorderRight sub BorderBottom lineto + closepath +} def + +%%EndProlog +%%Page: 1 1 + +% set printing area +UsedArea clip + +% print background +BackColo setrgbcolor +UsedArea fill + +% print diagonal thin line pattern +newpath + DiaSta 1 DiaEnd { %for + dup SideLen mul BorderLeft add PattTrasX add PattTrasY Cos div add + BorderBottom moveto + DiaHor neg AreaHeight rlineto + SideLen mul BorderLeft add PattTrasX add BorderBottom moveto + DiaHor AreaHeight rlineto + } for + LineSizeThin setlinewidth + LineColoThin setrgbcolor +stroke + +% print diagonal strong line pattern +newpath + DiaSta 1 DiaEnd { %for + dup + StrongStep mod 0 eq { %if + dup SideLen mul BorderLeft add PattTrasX add PattTrasY Cos div add + BorderBottom moveto + DiaHor neg AreaHeight rlineto + SideLen mul BorderLeft add PattTrasX add BorderBottom moveto + DiaHor AreaHeight rlineto + } if + } for + LineSizeStro setlinewidth + LineColoStro setrgbcolor +stroke + +% print horizontal thin line pattern +newpath + HorSta 1 HorEnd { %for + SideLen Cos mul mul BorderBottom add PattTrasY add BorderLeft exch moveto + AreaWidth 0 rlineto + } for + LineSizeThin setlinewidth + LineColoThin setrgbcolor +stroke + +% print horizontal strong line pattern +newpath + HorSta 1 HorEnd { %for + dup + StrongStep mod 0 eq { %if + SideLen Cos mul mul BorderBottom add PattTrasY add BorderLeft exch moveto + AreaWidth 0 rlineto + } if + } for + LineSizeStro setlinewidth + LineColoStro setrgbcolor +stroke + +% print border (if WillPrintBorder is not 0 ) +WillPrintBorder 0 ne { + LineSizeBord setlinewidth + LineColoBord setrgbcolor + UsedArea stroke +} if + +showpage +%%Trailer diff --git a/src/music-paper.ps b/src/music-paper.ps new file mode 100644 index 0000000..8860c13 --- /dev/null +++ b/src/music-paper.ps @@ -0,0 +1,164 @@ +%!PS-Adobe-1.0 +%%Title: music-paper by Elena of Valhalla +%%Pages:1 +%%BoundingBox: 0 0 596 842 +%%DocumentPaperSizes: a4 +%%CreationDate: 2005-05-23 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%EndComments +%%BeginProlog +% Copyright (C) 2005 Elena Grandi +% All rights reserved. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% * Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% * Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% * Neither the name of the <organization> nor the +% names of its contributors may be used to endorse or promote products +% derived from this software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +% ------ Usage ---------------------------------------------------------------- + +% To use this file either send it to a postscript printer, or use your +% favourite postscript interpreter to visualize and print it. + +% You can customize the result by changing the values in the Settings +% section below (see the comments for details) + +% ------ sizes ---------------------------------------------------------------- +% This will allow you to give measurements in inches or millimiters +% do not change +/inch {72 mul} def +/mm {0.03937 inch mul} def + +% ------ Settings ------------------------------------------------------------- + +% ------ Basic settings + +/LineSpac 3 mm def % ver spacing between lines +/LineNumb 5 def % number of lines in a stave + +/StavSpac 6 mm def % ver spacing between staves +/StavNumb 1 def % number of staves in a grouping + +/GrouSpac 15 mm def % ver spacing between groupings of staves + + +% line width and color for thin lines +/LineSizeThin 0.5 def +/LineColoThin { 0.8 0.8 0.8 } def + +/BackColo { 1.0 1.0 1.0 } def % background color + +% page size: if you change this, you should change the BoundingBox +% in line 4 accordingly (you CAN'T use mm or inch over there) +% Default is A4 paper ( BoundingBox: 0 0 596 842 ) +/PageWidth 210 mm def +/PageHeight 297 mm def +% alternate page sizes (with BoundingBox values) may be +% A3 paper ( BoundingBox: 0 0 842 1192) +%/PageWidth 297 mm def +%/PageHeight 420 mm def +% Letter paper ( BoundingBox: 0 0 612 792) +%/PageWidth 8.5 inch def +%/PageHeight 11 inch def + +% white margins +/BorderTop 10 mm def +/BorderBottom 10 mm def +/BorderLeft 10 mm def +/BorderRight 10 mm def + +% ------ Advanced settings + +% ------ Behaviour + +% Whether to print a line around the margins (1) or not (0) +/WillPrintBorder 0 def + +% From here on you shouldn't worry about changing or configuring anything +% ------ Variables ------------------------------------------------------------ + +/StavHeig LineSpac LineNumb 1 sub mul def + +/GrouHeig StavHeig StavNumb mul StavSpac StavNumb 1 sub mul add def + +/GrouNumb PageHeight BorderBottom sub BorderTop sub GrouHeig GrouSpac add div def + +% ------ Procedures ----------------------------------------------------------- + +% Describes the printable area (does NOT print anything) +/UsedArea { + newpath + BorderLeft BorderBottom moveto + BorderLeft PageHeight BorderTop sub lineto + PageWidth BorderRight sub PageHeight BorderTop sub lineto + PageWidth BorderRight sub BorderBottom lineto + closepath +} def + +/PrintStave { % stk: y + gsave + 0 exch translate + newpath + 0 1 LineNumb 1 sub { % for + LineSpac mul dup BorderLeft exch moveto + PageWidth BorderRight sub exch lineto + } for + LineSizeThin setlinewidth + LineColoThin setrgbcolor + stroke + grestore +} def + +/PrintGroup { % stk: y + gsave + 0 exch translate + 0 1 StavNumb 1 sub { % for + StavHeig StavSpac add mul PrintStave + } for + grestore +} def + +%%EndProlog +%%Page: 1 + +% set printing area +UsedArea clip + +% print background +BackColo setrgbcolor +UsedArea fill + +%BorderBottom PrintGroup + +0 1 GrouNumb 1 sub { % for + GrouHeig GrouSpac add mul BorderBottom add PrintGroup +} for + +% print border (if WillPrintBorder is not 0 ) +WillPrintBorder 0 ne { + LineSizeBord setlinewidth + LineColoBord setrgbcolor + UsedArea stroke +} if + +showpage +%%Trailer diff --git a/src/pointed-paper.ps b/src/pointed-paper.ps new file mode 100644 index 0000000..6bda92b --- /dev/null +++ b/src/pointed-paper.ps @@ -0,0 +1,190 @@ +%!PS-Adobe-1.0 +%%Title: pointed-paper +%%Pages:1 +%%BoundingBox: 0 0 596 842 +%%DocumentPaperSizes: a4 +%%CreationDate: 2010/10/08 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%EndComments +%%BeginProlog +% Copyright (C) 2010 Elena Grandi +% All rights reserved. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% * Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% * Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% * Neither the name of the author nor the +% names of its contributors may be used to endorse or promote products +% derived from this software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +% DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +% ------ Usage ---------------------------------------------------------------- + +% To use this file either send it to a postscript printer, or use your +% favourite postscript interpreter to visualize and print it. + +% You can customize the result by changing the values in the Settings +% section below (see the comments for details) + +% ------ sizes ---------------------------------------------------------------- +% This will allow you to give measurements in inches or millimiters +% do not change +/inch {72 mul} def +/mm {0.03937 inch mul} def + +% ------ Settings ------------------------------------------------------------- + +% ------ Basic settings + +/SquaXLen 0.1 inch def % hor spacing between points +/SquaYLen 0.1 inch def % ver spacing between points + +/SquaXStr 4 def % hor number of thin points between strong ones +/SquaYStr 4 def % ver number of thin points between strong ones + +/PointSizeThin 1 def +/PointSizeStro 1 def + +% line width and color for thin lines +/LineSizeThin 0.5 def +/LineColoThin { 0.8 0.8 0.8 } def +% line width and color for strong lines +/LineSizeStro 0.5 def +/LineColoStro { 0.6 0.6 0.6 } def +% line width and color for border +/LineSizeBord 0.5 def +/LineColoBord { 0.6 0.6 0.6 } def + +/BackColo { 1.0 1.0 1.0 } def % background color + +% page size: if you change this, you should change the BoundingBox +% in line 4 accordingly (you CAN'T use mm or inch over there) +% Default is A4 paper ( BoundingBox: 0 0 596 842 ) +/PageWidth 210 mm def +/PageHeight 297 mm def +% alternate page sizes (with BoundingBox values) may be +% A3 paper ( BoundingBox: 0 0 842 1192) +%/PageWidth 297 mm def +%/PageHeight 420 mm def +% Letter paper ( BoundingBox: 0 0 612 792) +%/PageWidth 8.5 inch def +%/PageHeight 11 inch def + +% white margins +/BorderTop 14 mm def +/BorderBottom 12 mm def +/BorderLeft 10 mm def +/BorderRight 10 mm def + +% ------ Advanced settings + +% translation of the starting point of the pattern +/PattTrasX 0.05 inch def +/PattTrasY 0.05 inch def + +% ------ Behaviour + +% Whether to print a line around the margins (1) or not (0) +/WillPrintBorder 0 def + +% From here on you shouldn't worry about changing or configuring anything +% ------ Procedures ----------------------------------------------------------- + +% Describes the printable area (does NOT print anything) +/UsedArea { + newpath + BorderLeft BorderBottom moveto + BorderLeft PageHeight BorderTop sub lineto + PageWidth BorderRight sub PageHeight BorderTop sub lineto + PageWidth BorderRight sub BorderBottom lineto + closepath +} def + +/PrintPointThin { %stk: x y + newpath + 1 index + 1 index + moveto + PointSizeThin 0 rmoveto + PointSizeThin 0 360 arc + closepath + LineSizeThin setlinewidth + LineColoThin setrgbcolor + stroke +} def + +/PrintPointStro { %stk: x y + newpath + 1 index + 1 index + moveto + PointSizeStro 0 rmoveto + PointSizeStro 0 360 arc + closepath + LineSizeStro setlinewidth + LineColoStro setrgbcolor + stroke +} def + +%%EndProlog +%%Page: 1 + +% set printing area +UsedArea clip + +% print background +BackColo setrgbcolor +UsedArea fill + +% Print thin points +BorderLeft PattTrasX add SquaXLen sub % x starting position +SquaXLen % step +PageWidth % stop +{ % for + BorderBottom PattTrasY add SquaYLen sub % y starting position + SquaYLen % step + PageHeight % stop + { %for + 1 index exch PrintPointThin + } for +} for + +% Print strong points +BorderLeft PattTrasX add SquaXLen sub % x starting position +SquaXLen SquaXStr mul % step +PageWidth % stop +{ % for + BorderBottom PattTrasY add SquaYLen sub % y starting position + SquaYLen SquaYStr mul % step + PageHeight % stop + { %for + 1 index exch PrintPointStro + } for +} for + +% print border (if WillPrintBorder is not 0 ) +WillPrintBorder 0 ne { + LineSizeBord setlinewidth + LineColoBord setrgbcolor + UsedArea stroke +} if + +showpage +%%Trailer |