summaryrefslogtreecommitdiff
path: root/stickers.scm
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-10-02 21:28:51 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-10-02 21:32:42 +0200
commitbfd350ca71a62888f1b5a291d4cfc25fe43cf0f7 (patch)
treecbda78d2b18df15386c534390f1c06a6458fe726 /stickers.scm
parenta7688175d3a4019cd5e7e62085ce7ee3c6dbcf49 (diff)
Add font support
Diffstat (limited to 'stickers.scm')
-rw-r--r--stickers.scm17
1 files changed, 9 insertions, 8 deletions
diff --git a/stickers.scm b/stickers.scm
index 05a22a0..264f3e1 100644
--- a/stickers.scm
+++ b/stickers.scm
@@ -1,3 +1,4 @@
+; Generate keys
(import (scheme char)
(chibi)
(chibi string)
@@ -7,23 +8,24 @@
(srfi 41))
(define-record-type :glyph
- (glyph char size color style)
+ (glyph char font size color style)
glyph?
(char glyph-char glyph-set-char!)
+ (font glyph-font glyph-set-font!)
(size glyph-size glyph-set-size!)
(color glyph-color glyph-set-color!)
(style glyph-style glyph-set-style!))
; Load here the glyphs you need, the only ones that are more or less defined
; are the English ones
-(load "glyphs/en.scm")
+(load "glyphs/ru.scm")
(define a4-size '(297 . 210))
(define a5-size '(210 . 148))
(define a6-size '(148 . 105))
(define a7-size '(105 . 74))
-(define page-size a7-size)
+(define page-size a6-size)
(define x car)
(define y cdr)
@@ -37,8 +39,6 @@
(define style (string-append
"
text {
- /*font-family: 'Unifont';*/
- font-family: 'B612';
stroke: black;
stroke-width: 0.01;
}
@@ -96,9 +96,10 @@ text {
(lambda (cx cy)
`(text (@ (x ,cx)
(y ,cy)
- (style ,(string-append "font-style: " (glyph-style glyph)
- "; font-size: " (glyph-size glyph)
- "; fill: " (glyph-color glyph)))
+ (style ,(string-append "font-style: " (glyph-style glyph)
+ "; font-size: " (glyph-size glyph)
+ "; font-family: " (glyph-font glyph)
+ "; fill: " (glyph-color glyph)))
(text-anchor middle)
(dominant-baseline central))
,(glyph-char glyph))))