summaryrefslogtreecommitdiff
path: root/utils/cover/barcode.scm
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2020-07-23 20:11:32 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2020-07-23 20:11:32 +0200
commit2c100ae2b2eb7dcabc2abc0963c8ae72a04322d3 (patch)
treedf1178f0bed031cce6d4959c707c169826064337 /utils/cover/barcode.scm
parentb0b9f78f09bac6c505882ab8542d97393c07d441 (diff)
Massive rework on makefiles and cover generator:
- New style in cover - Support for call from main Makefile - Reorder directory structure
Diffstat (limited to 'utils/cover/barcode.scm')
-rw-r--r--utils/cover/barcode.scm24
1 files changed, 14 insertions, 10 deletions
diff --git a/utils/cover/barcode.scm b/utils/cover/barcode.scm
index 85f28c2..b016e27 100644
--- a/utils/cover/barcode.scm
+++ b/utils/cover/barcode.scm
@@ -86,7 +86,8 @@
(number->string height)))
(encoded (barcode code)))
`(g
- (@ (transform ,(string-append "translate(" (number->string x) "," (number->string y) ")"
+ (@ (transform ,(string-append "translate(" (number->string x) ","
+ (number->string y) ")"
"scale(" (number->string scale) ")")))
,(map
@@ -105,14 +106,17 @@
,(map
(lambda (char pos)
- `(text (@ (style ,(string-append "font-size: " (number->string text-size) ";"
- "text-anchor: middle"))
- (x ,(cond ((= 0 pos) (* 3.5 colwidth))
- ((<= 1 pos 6) (+ border (* (+ 3 (* (- pos 0.5) 7)) colwidth)))
- ((< 6 pos) (+ border (* (+ 3 5 (* (- pos 0.5) 7)) colwidth)))))
- (y ,height))
- ,(list->string (list char))))
+ `(text
+ (@ (style ,(string-append "font-size: "
+ (number->string text-size) ";"
+ "text-anchor: middle"))
+ (x ,(cond
+ ((= 0 pos) (* 3.5 colwidth))
+ ((<= 1 pos 6) (+ border (* (+ 3 (* (- pos 0.5) 7))
+ colwidth)))
+ ((< 6 pos) (+ border (* (+ 3 5 (* (- pos 0.5) 7))
+ colwidth)))))
+ (y ,height))
+ ,(list->string (list char))))
(string->list code)
(iota (string-length code))))))
-
-#;(display (barcode-svg "9780201379624"))