summaryrefslogtreecommitdiff
path: root/pict.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-01-10 13:05:27 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-01-10 13:05:27 +0100
commit1d39a878915d786b300926adebab5be7c581c587 (patch)
tree353d479770e4b52791f546e02506b2b8ff623e03 /pict.scm
parent61fb3cbfe9b9c59f1258d778873e328e08658cb0 (diff)
text: Add support for border-color and border-width.
Diffstat (limited to 'pict.scm')
-rw-r--r--pict.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/pict.scm b/pict.scm
index 916d527..34dfe84 100644
--- a/pict.scm
+++ b/pict.scm
@@ -794,13 +794,16 @@ filled with black."
;; U+2588 and then align the text.
(define* (text txt #:key
(color "black")
+ (border-color "none")
+ (border-width 0)
(font-family "sans-serif")
(font-size 32)
(font-style 'normal)
(font-weight 'normal))
"Render the provided string TXT. The keywords COLOR (a string),
-FONT-FAMILY (a string), FONT-SIZE (an integer), FONT-STYLE (a symbol),
-and FONT-WEIGHT (also a symbol) can be used to change the appearance."
+BORDER-COLOR (a string), BORDER-WIDTH (an integer), FONT-FAMILY (a
+string), FONT-SIZE (an integer), FONT-STYLE (a symbol), and
+FONT-WEIGHT (also a symbol) can be used to change the appearance."
(define validate-weight
(or (member font-weight '(normal bold bolder lighter))
(error "font-weight must be one of: normal, bold, bolder, lighter.")))
@@ -870,6 +873,8 @@ and FONT-WEIGHT (also a symbol) can be used to change the appearance."
(define (make-text content)
`(text (@ (style ,(style-list->string
`(("fill" ,color)
+ ("stroke" ,border-color)
+ ("stroke-width" ,(number->string border-width))
("font-family" ,font-family)
("font-style" ,(symbol->string font-style)))))
(font-size ,font-size)