Skip to content

Commit d4bebf3

Browse files
committed
add version to footer; use portraitPage and landscapePage on every page
1 parent f4e7653 commit d4bebf3

6 files changed

+50
-68
lines changed

SSS32.ps

399 Bytes
Binary file not shown.

default.nix

+16-18
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,19 @@ let
4141
sourceHeader = "Title Page";
4242
content = builtins.readFile "${src}/include/title.ps.inc";
4343
dependencies = [ ];
44+
skipPageNumber = true;
4445
};
4546
license = {
4647
sourceHeader = "License Information";
47-
drawPageContent = true;
4848
content = builtins.readFile "${src}/include/license.ps.inc";
4949
dependencies = [ ];
50+
skipPageNumber = true;
5051
};
5152
reference = {
5253
sourceHeader = "Reference Sheet";
53-
drawPageContent = true;
5454
content = builtins.readFile "${src}/include/reference.ps.inc";
5555
dependencies = [ ];
56+
drawFooter = true;
5657
};
5758
principalTables = {
5859
sourceHeader = "Arithmetic Tables";
@@ -90,21 +91,25 @@ let
9091
content = builtins.readFile "${src}/include/checksum-table-1.ps.inc";
9192
isLandscape = true;
9293
dependencies = [ ];
94+
drawFooter = true;
9395
};
9496
checksumTable2 = {
9597
content = builtins.readFile "${src}/include/checksum-table-2.ps.inc";
96-
isLandscape = true;
9798
dependencies = [ ];
99+
isLandscape = true;
100+
drawFooter = true;
98101
};
99102
checksumWorksheet = {
100103
content = builtins.readFile "${src}/include/checksum-worksheet.ps.inc";
101-
isLandscape = true;
102104
dependencies = [ ];
105+
isLandscape = true;
106+
drawFooter = true;
103107
};
104108

105109
shareTable = a: b: c: d: {
106110
content = "${toString a} ${toString b} ${toString c} ${toString d} showShareTablePage\n";
107111
dependencies = [ ];
112+
drawFooter = true;
108113
};
109114
};
110115

@@ -154,25 +159,18 @@ let
154159
%****************************************************************
155160
'' + ''
156161
%%Page: ${toString content.nextPgIdx} ${toString content.nextPgIdx}
157-
${lib.optionalString (pageData ? isLandscape) "%%PageOrientation: Landscape\n"}%%BeginPageSetup
162+
${lib.optionalString (pageData ? isLandscape) "%%PageOrientation: Landscape\n"}
163+
%%BeginPageSetup
158164
/pgsave save def
159165
%%EndPageSetup
160-
'' + (
161-
if pageData ? drawPageContent
162-
then
163-
if pageData ? isLandscape
164-
then "landscapePage begin ${toString content.nextFooterIdx} drawPageContent\n"
165-
else "portraitPage begin ${toString content.nextFooterIdx} drawPageContent\n"
166-
else
167-
if pageData ? isLandscape
168-
then "90 rotate\n"
169-
else ""
170-
) + ''
166+
${if pageData ? isLandscape then "landscapePage" else "portraitPage"} begin
167+
${lib.optionalString (pageData ? drawFooter) "${toString content.nextFooterIdx} drawFooter"}
171168
${pageData.content}
172-
${lib.optionalString (pageData ? drawPageContent) "end\n"}pgsave restore
169+
end
170+
pgsave restore
173171
showpage
174172
'';
175-
nextFooterIdx = content.nextFooterIdx + (if pageData ? drawPageContent then 1 else 0);
173+
nextFooterIdx = content.nextFooterIdx + (if pageData ? drawFooter then 1 else 0);
176174
nextPgIdx = content.nextPgIdx + 1;
177175
};
178176
initialContent = {

include/checksum-table-1.ps.inc

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
10 dict begin
2-
pgsize aload pop
3-
/pageW exch def
4-
/pageH exch def
5-
6-
0 pageH neg translate
7-
81
/Helvetica-Bold findfont 10 scalefont setfont
92
pageW 2 div pageH 48 sub moveto (MS32 Checksum Table) centreshow
103

114
/Courier findfont 8.5 scalefont setfont
125
36 pageH 64 sub % x y
13-
pageW 64 sub pageH 144 sub 2 div % w h
6+
pageW 64 sub pageH 148 sub 2 div % w h
147
0 drawChecksumTable
158

169
36 pageH 2 div 16 sub % x y
17-
pageW 64 sub pageH 144 sub 2 div % w h
10+
pageW 64 sub pageH 148 sub 2 div % w h
1811
8 drawChecksumTable
19-
end

include/checksum-table-2.ps.inc

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
10 dict begin
2-
pgsize aload pop
3-
/pageW exch def
4-
/pageH exch def
5-
6-
0 pageH neg translate
7-
81
/Helvetica-Bold findfont 10 scalefont setfont
92
pageW 2 div pageH 48 sub moveto (MS32 Checksum Table) centreshow
103

114
/Courier findfont 8.5 scalefont setfont
125
36 pageH 64 sub % x y
13-
pageW 64 sub pageH 144 sub 2 div % w h
6+
pageW 64 sub pageH 148 sub 2 div % w h
147
16 drawChecksumTable
158

169
36 pageH 2 div 16 sub % x y
17-
pageW 64 sub pageH 144 sub 2 div % w h
10+
pageW 64 sub pageH 148 sub 2 div % w h
1811
24 drawChecksumTable
19-
end

include/checksum-worksheet.ps.inc

+23-27
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,63 @@
1-
% 0 pgsize aload pop pop neg translate
2-
0 -750 translate
3-
41
/Helvetica-Bold findfont 10 scalefont setfont
52
pgsize aload pop exch pop 2 div 700
63
moveto (ms32 Checksum Worksheet) centreshow
74

85
gsave
9-
50 680 translate
6+
50 560 translate
107
ladder begin
118
drawgrid
129
% (2NAMES5GS8YDXGMLUW34LEN0PRDAK9GLF307N04SN6SKL) fillgrid
1310
% (2NAMES5GS8YDXGMLUW34LEN0PRDAK9GL ) fillgrid
1411
end
1512
grestore
1613

17-
100 420 moveto
14+
100 320 moveto
1815
/Helvetica-Bold findfont 10 scalefont setfont
1916
(Verifying Checksums) show
20-
100 400 moveto
17+
100 300 moveto
2118
/Helvetica findfont 9 scalefont setfont
2219
(Write out the 45 character data portion in the) show
23-
100 390 moveto
20+
100 290 moveto
2421
(bold boxes, two at a time, starting on the top) show
25-
100 380 moveto
22+
100 280 moveto
2623
(row. Working from the top row down, look up) show
27-
100 370 moveto
24+
100 270 moveto
2825
(the first two characters of each odd row in the) show
29-
100 360 moveto
26+
100 260 moveto
3027
(ms32 Checksum Table and write the ) polymodulus length 10 string cvs concatstrings show
31-
100 350 moveto
28+
100 250 moveto
3229
(character word into the even row below it. Fill) show
33-
100 340 moveto
30+
100 240 moveto
3431
(in the odd rows by adding the two characters) show
35-
100 330 moveto
32+
100 230 moveto
3633
(above each cell. You may use either the) show
37-
100 320 moveto
34+
100 220 moveto
3835
(addition wheel table. The first few boxes are) show
39-
100 310 moveto
36+
100 210 moveto
4037
(already filled in for you. The last row will sum) show
41-
100 300 moveto
38+
100 200 moveto
4239
(to ) show checksumstring {glyphshow} forall ( if the checksum is valid.) show
43-
100 260 moveto
40+
100 160 moveto
4441
/Helvetica-Bold findfont 10 scalefont setfont
4542
(Creating Checksums) show
46-
100 240 moveto
43+
100 140 moveto
4744
/Helvetica findfont 9 scalefont setfont
4845
(Follow the "Verifying Checksums" instructions) show
49-
100 230 moveto
46+
100 130 moveto
5047
(to fill in everything but the shaded cells. To fill in) show
51-
100 220 moveto
48+
100 120 moveto
5249
(the shaded cells, write ) show checksumstring {glyphshow} forall ( into the bottom) show
53-
100 210 moveto
50+
100 110 moveto
5451
(row. Working from the bottom up, fill in the) show
55-
100 200 moveto
52+
100 100 moveto
5653
(shaded cells by adding the two characters below) show
57-
100 190 moveto
54+
100 90 moveto
5855
(each cell. The ) polymodulus length 10 string cvs ( characters in the bold shaded) concatstrings concatstrings show
59-
100 180 moveto
56+
100 80 moveto
6057
(boxes will be the checksum.) show
6158

62-
450 650
63-
/offsety exch def
64-
/offsetx exch def
59+
/offsety 550 def
60+
/offsetx 450 def
6561
/Courier findfont 10 scalefont setfont
6662
20 offsetx add offsety moveto (Addition Table) show
6763
/Courier-Bold findfont 8 scalefont setfont

include/setup.ps.inc

+7-3
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,17 @@ def
370370

371371
% Draw the page number and any (TODO) content in the page content array
372372
% Takes the pagenum as a numeric value
373-
/drawPageContent {
373+
/drawFooter {
374374
10 dict begin
375375
/pagenum exch def
376376
gsave
377377
/Times-Roman findfont 12 scalefont setfont
378378
centerX marginY2 moveto
379379
pagenum pagenum 10 lt { 1 } { 2 } ifelse string cvs show
380+
381+
/Courier findfont 10 scalefont setfont
382+
marginX1 marginY2 4 sub moveto
383+
ver show
380384
grestore
381385
end
382386
} bind def
@@ -396,10 +400,10 @@ portraitPage dup 20 dict copy dup /landscapePage exch def begin
396400
/pageW portraitPage /pageH get def
397401
/pageH portraitPage /pageW get def
398402

399-
/drawPageContent {
403+
/drawFooter {
400404
90 rotate
401405
0 pageH neg translate
402-
portraitPage /drawPageContent get exec
406+
portraitPage /drawFooter get exec
403407
} bind def
404408
end
405409

0 commit comments

Comments
 (0)