Skip to content

Commit 7b7bd2e

Browse files
Update <Makefile.cover_image> from the "nextzxos" branch: Add the release background image to the cover image and improve its layout.
FossilOrigin-Name: f406e9ad4ef91906987b069b0cd6801bf51e90feea2a43f44e1ccdd63e6d6860
1 parent e31a330 commit 7b7bd2e

File tree

1 file changed

+78
-24
lines changed

1 file changed

+78
-24
lines changed

Makefile.cover_image

+78-24
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
# By Marcos Cruz (programandala.net)
77

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.
1010

1111
# ==============================================================
1212
# Requirements {{{1
@@ -18,28 +18,40 @@
1818
# https://gitlab.mister-muffin.de/josch/img2pdf
1919

2020
# ==============================================================
21-
# Create the cover image {{{1
21+
# Config {{{1
22+
23+
width=1200
24+
height=1600
25+
size=$(width)x$(height)
2226

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
2531

2632
font=Helvetica
2733
background=lightgray
2834
fill=black
2935
strokewidth=4
3036
subtitle_pointsize=48
3137

38+
# ==============================================================
39+
# Create the canvas {{{1
40+
3241
tmp/$(cover).title.png:
3342
convert \
3443
-background transparent \
3544
-fill $(fill) \
3645
-font $(font) \
3746
-pointsize 96 \
38-
-size 1200x \
47+
-size $(width)x \
3948
-gravity east \
4049
caption:$(cover_title) \
4150
$@
4251

52+
# ==============================================================
53+
# Create the texts {{{1
54+
4355
tmp/$(cover).gplusdos_subtitle.png:
4456
convert \
4557
-background transparent \
@@ -51,6 +63,17 @@ tmp/$(cover).gplusdos_subtitle.png:
5163
caption:$(cover_gplusdos_subtitle) \
5264
$@
5365

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+
5477
tmp/$(cover).plus3dos_subtitle.png:
5578
convert \
5679
-background transparent \
@@ -84,47 +107,74 @@ tmp/$(cover).author.png:
84107
caption:$(cover_author) \
85108
$@
86109

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
89122

90123
doc/gplusdos_$(cover).jpg: \
91124
tmp/$(cover).title.png \
92125
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 \
93138
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 $@ $@
98144

99145
doc/plus3dos_$(cover).jpg: \
100146
tmp/$(cover).title.png \
101147
tmp/$(cover).plus3dos_subtitle.png \
148+
tmp/$(cover).background.png \
102149
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 $@ $@
107155

108156
doc/trdos_$(cover).jpg: \
109157
tmp/$(cover).title.png \
110158
tmp/$(cover).trdos_subtitle.png \
159+
tmp/$(cover).background.png \
111160
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 $@ $@
116166

117-
# ------------------------------------------------
118-
# Convert the cover image to PDF {{{2
167+
# ==============================================================
168+
# Convert the cover image to PDF {{{1
119169

120170
# This is needed in order to make sure the cover image ocuppies the whole page
121171
# in the PDF versions of the book.
122172

123173
tmp/%.pdf: doc/%.jpg
124174
img2pdf --output $@ --border 0 $<
125175

126-
# ------------------------------------------------
127-
# Create a thumb version of the cover image {{{2
176+
# ==============================================================
177+
# Create a thumb version of the cover image {{{1
128178

129179
%_thumb.jpg: %.jpg
130180
convert $< -resize 190x $@
@@ -135,3 +185,7 @@ tmp/%.pdf: doc/%.jpg
135185
# 2020-10-08: Start. Adapt the code from other projects of the author.
136186
#
137187
# 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

Comments
 (0)