diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2021-01-10 13:00:16 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2021-01-10 13:00:16 +0100 |
commit | 61fb3cbfe9b9c59f1258d778873e328e08658cb0 (patch) | |
tree | 5c877ff6a3ae979ec8b6b203426f6d34f181e006 | |
parent | 6541899b521b333a7b4a3ae999adf72e8b4dacc3 (diff) |
text: Validate font-weight and font-style.
-rw-r--r-- | pict.scm | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |