From bfd350ca71a62888f1b5a291d4cfc25fe43cf0f7 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Wed, 2 Oct 2024 21:28:51 +0200 Subject: Add font support --- stickers.scm | 17 +++++++++-------- 1 file 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)))) -- cgit v1.2.3