From 1d39a878915d786b300926adebab5be7c581c587 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 10 Jan 2021 13:05:27 +0100 Subject: text: Add support for border-color and border-width. --- pict.scm | 9 +++++++-- 1 file 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) -- cgit v1.2.3