don't repeat work

main
Matthew Butterick 5 years ago
parent 5f977d253d
commit ca349fee9e

@ -67,9 +67,10 @@
(define (resolve-font-path attrs)
(define this-font-family (hash-ref! attrs 'font-family default-font-family))
(define this-bold (hash-ref! attrs 'font-bold #false))
(define this-italic (hash-ref! attrs 'font-italic #false))
(hash-set! attrs 'font-path (font-attrs->path this-font-family this-bold this-italic)))
(unless (complete-path? this-font-family)
(define this-bold (hash-ref! attrs 'font-bold #false))
(define this-italic (hash-ref! attrs 'font-italic #false))
(hash-set! attrs 'font-path (font-attrs->path this-font-family this-bold this-italic))))
(define (parse-percentage pstr)
(/ (string->number (string-trim pstr "%")) 100.0))

Loading…
Cancel
Save