Comment detail

年間カレンダー (Nested Flatten)
PostScript 版です。A4一枚に出力します。 年号を変更するときには先頭部の書き換えが必要です。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%!PS

/Year 2008 def

% Design Parameters 
/Columns 3 def
/FontSize 10 def
20 600  /Y0 exch def    /X0 exch def    % Top Left Position
200 150 /VMY exch def   /VMX exch def   % Size of 1 Month
20 13   /VY exch def    /VX exch def    % Size of 1 Day

% Color / Font Settings , Tables
% [ Sunday Monday ....  Saturday ]
/WColorR { [1 0 0 0 0 0 0] } def
/WColorG { [0 0 0 0 0 0 0] } def
/WColorB { [0 0 0 0 0 0 1] } def
/WFont { [ /Times-Bold /Times-Roman /Times-Roman /Times-Roman /Times-Roman
     /Times-Roman  /Times-Bold ] } def
/MonthName {[(January) (February) (March) (April) (May) (June)
 (July) (Augusut) (September) (October) (November) (December)]} def
/WeekdayName {[(Sun) (Mon) (Tue) (Wed) (Thu) (Fri) (Sat)]} def
/MDays { [31 28 31 30 31 30 31 31 30 31 30 31] } def

% -------------------------------------------------------------------------
/MonthFont {/Times-Roman findfont FontSize 2 mul scalefont setfont 0 setgray} \
def
/SetFont { dup WFont exch get findfont FontSize scalefont setfont
    dup WColorR exch get exch dup WColorG exch get exch
    WColorB exch get setrgbcolor
} def

/POS { VY mul YM0 exch sub exch VX mul XM0 add exch moveto } def
/POS2 { WOffset add dup 7 mod exch 7 idiv 2 add POS } def


/LeapYear {dup 400 mod 0 eq exch dup 100 mod 0 eq not
    exch 4 mod 0 eq and or } def
/MDay { dup MDays exch get exch 1 eq Year LeapYear and { 1 add } if } def
/ZellerFomula {
    dup 2 le { 12 add exch 1 sub exch } if
    13 mul 8 add 5 idiv exch dup 5 mul 4 idiv exch dup 100 idiv exch
    400 idiv exch sub add add 1 add 7 mod
} def

/DrawTitle {
    X0 150 add Y0 50 add moveto
    /Times-Italic findfont 100 scalefont setfont
    Year 4 string cvs show
} def

% -------------- Main Program -----------------
DrawTitle
0 1 11 {
    /Month exch def
    MonthFont
    /XM0 X0 Month Columns mod VMX mul add def
    /YM0 Y0 Month Columns idiv VMY mul sub def
    XM0 YM0 moveto
    Month 1 add 4 string cvs show
    MonthName Month get 10 0 rmoveto show
    0 1 6 {
    dup SetFont
    dup 1 POS
    WeekdayName exch get show
    } for
    /WOffset Year Month 1 add ZellerFomula def
    0 1 Month MDay 1 sub {
    dup POS2
    dup WOffset add 7 mod SetFont
    1 add 3 string cvs show
    } for
    grestore

} for

showpage
またも失敗。
72行は不要です。

月曜始まりにするには
4行目に
/StartMonday true def
を追加
33行目変更
/POS2 { WOffset StartMonday { 6 add 7 mod } if
    add dup 7 mod exch 7 idiv 2 add POS } def
63行目変更
        dup StartMonday { 6 add 7 mod } if 1 POS 

Index

Feed

Other

Link

Pathtraq

loading...