summaryrefslogtreecommitdiff
path: root/pict.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-01-10 13:00:16 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-01-10 13:00:16 +0100
commit61fb3cbfe9b9c59f1258d778873e328e08658cb0 (patch)
tree5c877ff6a3ae979ec8b6b203426f6d34f181e006 /pict.scm
parent6541899b521b333a7b4a3ae999adf72e8b4dacc3 (diff)
text: Validate font-weight and font-style.
Diffstat (limited to 'pict.scm')
-rw-r--r--pict.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/pict.scm b/pict.scm
index 7ea2905..916d527 100644
--- a/pict.scm
+++ b/pict.scm
@@ -801,6 +801,12 @@ filled with black."
"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."
+ (define validate-weight
+ (or (member font-weight '(normal bold bolder lighter))
+ (error "font-weight must be one of: normal, bold, bolder, lighter.")))
+ (define validate-style
+ (or (member font-style '(normal italic oblique))
+ (error "font-style must be one of: normal, italic, oblique.")))
;; Return ascent, descent, height, max_x_advance, max_y_advance
(define (font-extents)
(call-with-values