summaryrefslogtreecommitdiff
path: root/utils/cover
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-07-16 17:13:02 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-07-16 17:13:02 +0200
commitf3868f9d7be48f24a1505cd596f5b73ae733e916 (patch)
tree1d3dfe79ea834bd741b14fa7785d05e8ef69c505 /utils/cover
parent96d77792fcc799b6eb2bfa18ec044e2de8c36d0a (diff)
Add PDF cover creation system
Diffstat (limited to 'utils/cover')
-rw-r--r--utils/cover/cover.scm28
1 files changed, 23 insertions, 5 deletions
diff --git a/utils/cover/cover.scm b/utils/cover/cover.scm
index 915f42a..65769a5 100644
--- a/utils/cover/cover.scm
+++ b/utils/cover/cover.scm
@@ -140,8 +140,12 @@
(style
(string-append
"
+ #meta-content-box{
+ stroke: none;
+ fill: none;
+ }
.margin-mark {
- stroke-width: 0.1;
+ stroke-width: 0.1mm;
stroke-linecap: butt;
stroke: red;
}
@@ -245,6 +249,8 @@
;; CUTTING MARKS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
,(map (lambda (posx posy rot)
+ (let* ((margin (- margin 0.1))
+ (len (* 0.6 margin)))
`(g (@ (id ,(string-append "marks-"
(num posx)
"-"
@@ -253,15 +259,15 @@
(line (@
(x1 ,(+ posx))
(y1 ,(+ posy margin))
- (x2 ,(+ posx (* 0.6 margin)))
+ (x2 ,(+ posx len))
(y2 ,(+ posy margin))
(class "margin-mark")))
(line (@
(x1 ,(+ posx margin))
(y1 ,(+ posy))
(x2 ,(+ posx margin))
- (y2 ,(+ posy (* 0.6 margin)))
- (class "margin-mark")))))
+ (y2 ,(+ posy len))
+ (class "margin-mark"))))))
(list 0 0 width width)
(list 0 height 0 height)
@@ -272,7 +278,19 @@
(num height) ")")))
- ;; BACK SIDE
+ ; NOTE:
+ ; This element simulates the offset and size of the full page inside
+ ; the svg file.
+ ; inkscape cover.svg -I meta-content-box -XYWH
+ ; will return the bounding box of the printable part of the file in
+ ; X0\nY0\nX1\nY1 format
+ (rect (@ (id "meta-content-box")
+ (x ,margin)
+ (y ,margin)
+ (width ,(- width margin))
+ (height ,(- height margin))))
+
+ ;; BACK SIDE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TITLE + BOOK SUMMARY