diff options
Diffstat (limited to 'utils/cover/barcode.scm')
-rw-r--r-- | utils/cover/barcode.scm | 24 |
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")) |