From 7169de11db036b4da45a8b7160134637043126d9 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 26 Jul 2020 17:02:33 +0200 Subject: Update isbn creation from dashed ISBN --- utils/cover/barcode.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/cover/barcode.scm b/utils/cover/barcode.scm index b016e27..b178703 100644 --- a/utils/cover/barcode.scm +++ b/utils/cover/barcode.scm @@ -1,4 +1,5 @@ (import (chibi) + (chibi string) (chibi sxml) (srfi 1)) @@ -50,7 +51,7 @@ (E L G G L G L S R R R R R R E))) (define (barcode number) - "Get number in decima string" + "Get number in decimal string" (let* ((nums (string->list number)) (digits (map (lambda (x) (string->number (list->string (list x)))) @@ -71,6 +72,8 @@ sep)))))) +(define (remove-dashes code) + (string-join (string-split code #\-) "")) (define (barcode-sxml code x y scale) @@ -84,7 +87,8 @@ (number->string width) " " (number->string height))) - (encoded (barcode code))) + (code (remove-dashes code)) + (encoded (barcode code))) `(g (@ (transform ,(string-append "translate(" (number->string x) "," (number->string y) ")" -- cgit v1.2.3