5
5
6
6
# By Marcos Cruz (programandala.net)
7
7
8
- # Last modified 202012111910
9
- # See change log at the end of the file
8
+ # Last modified: 202101071859.
9
+ # See change log at the end of the file.
10
10
11
11
# ==============================================================
12
12
# Requirements {{{1
18
18
# https://gitlab.mister-muffin.de/josch/img2pdf
19
19
20
20
# ==============================================================
21
- # Create the cover image {{{1
21
+ # Config {{{1
22
+
23
+ width=1200
24
+ height=1600
25
+ size=$(width)x$(height)
22
26
23
- # ------------------------------------------------
24
- # Create the canvas and texts of the cover image {{{2
27
+ margin=+048
28
+ title_y=-384
29
+ subtitle_y=-312
30
+ author_y=-128
25
31
26
32
font=Helvetica
27
33
background=lightgray
28
34
fill=black
29
35
strokewidth=4
30
36
subtitle_pointsize=48
31
37
38
+ # ==============================================================
39
+ # Create the canvas {{{1
40
+
32
41
tmp/$(cover).title.png:
33
42
convert \
34
43
-background transparent \
35
44
-fill $(fill) \
36
45
-font $(font) \
37
46
-pointsize 96 \
38
- -size 1200x \
47
+ -size $(width)x \
39
48
-gravity east \
40
49
caption:$(cover_title) \
41
50
$@
42
51
52
+ # ==============================================================
53
+ # Create the texts {{{1
54
+
43
55
tmp/$(cover).gplusdos_subtitle.png:
44
56
convert \
45
57
-background transparent \
@@ -51,6 +63,17 @@ tmp/$(cover).gplusdos_subtitle.png:
51
63
caption:$(cover_gplusdos_subtitle) \
52
64
$@
53
65
66
+ tmp/$(cover).nextzxos_subtitle.png:
67
+ convert \
68
+ -background transparent \
69
+ -fill $(fill) \
70
+ -font $(font) \
71
+ -pointsize $(subtitle_pointsize) \
72
+ -size 1200x \
73
+ -gravity east \
74
+ caption:$(cover_nextzxos_subtitle) \
75
+ $@
76
+
54
77
tmp/$(cover).plus3dos_subtitle.png:
55
78
convert \
56
79
-background transparent \
@@ -84,47 +107,74 @@ tmp/$(cover).author.png:
84
107
caption:$(cover_author) \
85
108
$@
86
109
87
- # ------------------------------------------------
88
- # Create the cover image {{{2
110
+ # ==============================================================
111
+ # Convert the background of the current release {{{1
112
+
113
+ tmp/$(cover).background.png: backgrounds/current.pbm
114
+ convert \
115
+ $< \
116
+ -fuzz 4% -transparent "#ffffff" \
117
+ -resize $(width)x \
118
+ $@
119
+
120
+ # ==============================================================
121
+ # Create the cover image {{{1
89
122
90
123
doc/gplusdos_$(cover).jpg: \
91
124
tmp/$(cover).title.png \
92
125
tmp/$(cover).gplusdos_subtitle.png \
126
+ tmp/$(cover).background.png \
127
+ tmp/$(cover).author.png
128
+ convert -size $(size) canvas:$(background) $@
129
+ composite -gravity east -geometry $(margin)$(title_y) tmp/$(cover).title.png $@ $@
130
+ composite -gravity east -geometry $(margin)$(subtitle_y) tmp/$(cover).gplusdos_subtitle.png $@ $@
131
+ composite -gravity east -geometry $(margin)$(author_y) tmp/$(cover).author.png $@ $@
132
+ composite -gravity southeast -geometry $(margin)$(margin) tmp/$(cover).background.png $@ $@
133
+
134
+ doc/nextzxos_$(cover).jpg: \
135
+ tmp/$(cover).title.png \
136
+ tmp/$(cover).nextzxos_subtitle.png \
137
+ tmp/$(cover).background.png \
93
138
tmp/$(cover).author.png
94
- convert -size 1200x1600 canvas:$(background) $@
95
- composite -gravity east -geometry +048+000 tmp/$(cover).title.png $@ $@
96
- composite -gravity east -geometry +048+072 tmp/$(cover).gplusdos_subtitle.png $@ $@
97
- composite -gravity east -geometry +048+256 tmp/$(cover).author.png $@ $@
139
+ convert -size $(size) canvas:$(background) $@
140
+ composite -gravity east -geometry $(margin)$(title_y) tmp/$(cover).title.png $@ $@
141
+ composite -gravity east -geometry $(margin)$(subtitle_y) tmp/$(cover).nextzxos_subtitle.png $@ $@
142
+ composite -gravity east -geometry $(margin)$(author_y) tmp/$(cover).author.png $@ $@
143
+ composite -gravity southeast -geometry $(margin)$(margin) tmp/$(cover).background.png $@ $@
98
144
99
145
doc/plus3dos_$(cover).jpg: \
100
146
tmp/$(cover).title.png \
101
147
tmp/$(cover).plus3dos_subtitle.png \
148
+ tmp/$(cover).background.png \
102
149
tmp/$(cover).author.png
103
- convert -size 1200x1600 canvas:$(background) $@
104
- composite -gravity east -geometry +048+000 tmp/$(cover).title.png $@ $@
105
- composite -gravity east -geometry +048+072 tmp/$(cover).plus3dos_subtitle.png $@ $@
106
- composite -gravity east -geometry +048+256 tmp/$(cover).author.png $@ $@
150
+ convert -size $(size) canvas:$(background) $@
151
+ composite -gravity east -geometry $(margin)$(title_y) tmp/$(cover).title.png $@ $@
152
+ composite -gravity east -geometry $(margin)$(subtitle_y) tmp/$(cover).plus3dos_subtitle.png $@ $@
153
+ composite -gravity east -geometry $(margin)$(author_y) tmp/$(cover).author.png $@ $@
154
+ composite -gravity southeast -geometry $(margin)$(margin) tmp/$(cover).background.png $@ $@
107
155
108
156
doc/trdos_$(cover).jpg: \
109
157
tmp/$(cover).title.png \
110
158
tmp/$(cover).trdos_subtitle.png \
159
+ tmp/$(cover).background.png \
111
160
tmp/$(cover).author.png
112
- convert -size 1200x1600 canvas:$(background) $@
113
- composite -gravity east -geometry +048+000 tmp/$(cover).title.png $@ $@
114
- composite -gravity east -geometry +048+072 tmp/$(cover).trdos_subtitle.png $@ $@
115
- composite -gravity east -geometry +048+256 tmp/$(cover).author.png $@ $@
161
+ convert -size $(size) canvas:$(background) $@
162
+ composite -gravity east -geometry $(margin)$(title_y) tmp/$(cover).title.png $@ $@
163
+ composite -gravity east -geometry $(margin)$(subtitle_y) tmp/$(cover).trdos_subtitle.png $@ $@
164
+ composite -gravity east -geometry $(margin)$(author_y) tmp/$(cover).author.png $@ $@
165
+ composite -gravity southeast -geometry $(margin)$(margin) tmp/$(cover).background.png $@ $@
116
166
117
- # ------------------------------------------------
118
- # Convert the cover image to PDF {{{2
167
+ # ==============================================================
168
+ # Convert the cover image to PDF {{{1
119
169
120
170
# This is needed in order to make sure the cover image ocuppies the whole page
121
171
# in the PDF versions of the book.
122
172
123
173
tmp/%.pdf: doc/%.jpg
124
174
img2pdf --output $@ --border 0 $<
125
175
126
- # ------------------------------------------------
127
- # Create a thumb version of the cover image {{{2
176
+ # ==============================================================
177
+ # Create a thumb version of the cover image {{{1
128
178
129
179
%_thumb.jpg: %.jpg
130
180
convert $< -resize 190x $@
@@ -135,3 +185,7 @@ tmp/%.pdf: doc/%.jpg
135
185
# 2020-10-08: Start. Adapt the code from other projects of the author.
136
186
#
137
187
# 2020-12-11: Add the list of requirements.
188
+ #
189
+ # 2021-01-07: Add the rules to make the NextZXOS cover image. Add the Solo
190
+ # Forth background image to the cover image. Use variables to set the positions
191
+ # and sizes. Improve the layout.
0 commit comments