From ca349fee9e4ad6f18917bd1ead68c4074dd40670 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 1 May 2019 14:06:36 -0700 Subject: [PATCH] don't repeat work --- quad/quadwriter/font.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quad/quadwriter/font.rkt b/quad/quadwriter/font.rkt index 8ecffa1c..fe982de4 100644 --- a/quad/quadwriter/font.rkt +++ b/quad/quadwriter/font.rkt @@ -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))